# Send a LinkedIn message

### Send a LinkedIn message

`POST /api/v1/linkedin/messages`

Operation ID: `sendLinkedinMessage`

Sends a direct message. Only first-degree connections can receive one, so check isConnected on the profile first and send an InMail otherwise. Open Profile (isOpenProfile) can receive InMail without a connection. Attach files with POST /api/v1/files first, then pass the returned url.

**Request body** (required)

- `connectedAccountId` (string · uuid, required): Connected account to act as
- `identity` (string, required): User id (ACoAAA…) or public identifier.
- `text` (string, required)
- `attachments` (object[], optional): Files from POST /api/v1/files. Pass the returned url, not a signed URL. Needle reads the private object and sends the bytes to LinkedIn.

**201**: Send result.

- `result` (object, required)
  - `messageId` (string | null, required)
  - `conversationId` (string | null, required)
  - `sentAt` (string · date-time, required)
- `remainingUsage` (object, required): Remaining allowance for this action on the connected account across hourly, daily, and weekly windows. Each action type has its own limits.
  - `hour` (integer | null, required): Remaining hourly allowance for this action. Null when this action has no hourly cap.
  - `day` (integer, required): Remaining daily allowance for this action.
  - `week` (integer | null, required): Remaining weekly allowance for this action. Null when this action has no weekly cap.
- `requestId` (string · uuid, required): Id of this request, for support and troubleshooting

**Errors**

- `400`: Bad request
- `401`: Unauthorized: missing or invalid API key
- `403`: Forbidden
- `404`: Not found
- `422`: Invalid request payload
