Errors and limits
Errors
Errors are application/problem+json with a stable code. Branch on the code; the detail is for a person reading a log and may be reworded.
HTTP/1.1 402 Payment Required
Content-Type: application/problem+json
{
"title": "Payment required",
"status": 402,
"detail": "This month's credits are used up. Messages can be sent again when the plan renews or is upgraded.",
"code": "credit_limit_reached"
}| code | HTTP | Meaning |
|---|---|---|
| missing_api_key | 401 | No key was sent. |
| invalid_api_key | 401 | The key is wrong, revoked or expired. |
| insufficient_scope | 403 | The key lacks the read or send permission this call needs. |
| not_found | 404 | No such account or conversation — or it is not yours; the two look the same. |
| invalid_request | 400 / 422 | The request is malformed, or a pagination cursor is no longer reachable. For a file: more than one, not in a part named file, no file name, empty, or a multipart body that cannot be read. |
| unsupported_operation | 422 | The channel cannot do this — for example a file on WhatsApp. Check the account's capabilities first. |
| attachment_type_not_allowed | 422 | The file is not a PDF, PNG or JPEG, or its content is not the type it says it is. |
| attachment_too_large | 413 | The file is over the limit in capabilities.maxAttachmentBytes (10 MB). |
| attachment_needs_conversation | 422 | LinkedIn takes a file only into a conversation that has started. Send the text first, the file once that conversation exists. |
| account_not_ready | 409 | The account is signed out or needs a new password. Fix it in the dashboard. |
| credit_limit_reached | 402 | This month's credits are used up. |
| attachment_storage_unavailable | 503 | The file could not be stored, so nothing was queued. Not the channel being down: wait for Retry-After and send again with the same Idempotency-Key. While storage is not set up, capabilities.attachments is false. |
| too_many_line_breaks | 400 | A LinkedIn message has more than 20 line breaks (counted after runs of blank lines are collapsed). Other control characters in a message are invalid_request. |
| remote_account_not_found | 404 | Adopting an account: linkedin-api has no account with that id for this service's key. It must exist under the same linkedin-api tenant. |
| remote_account_already_linked | 409 | Adopting an account: that LinkedIn account is already linked here, to you or to anyone else. |
| plan_required | 403 | Creating, signing in, signing out and deleting accounts through the API is part of the Enterprise plan. |
| account_limit_reached | 403 | Your plan's connected accounts are all in use. Delete one or upgrade to create another. |
| authentication_not_waiting | 409 | You submitted a code, but that sign-in is not waiting for one. Start again. |
| idempotency_key_required | 400 | A send needs an Idempotency-Key header. |
| idempotency_key_reused | 422 | That key was already used for a different request. |
| idempotency_key_in_progress | 409 | The first request with that key is still running. Wait, then retry with the same key. |
| rate_limited | 429 | Too many requests. Wait for Retry-After. |
| channel_unavailable | 502 / 503 | WhatsApp, Telegram or LinkedIn could not be reached or refused it. Retry later. |
Rate limits
Each key gets 120 reads and 30 sends per minute, counted separately, so a polling job can't starve your sends. Over the limit you get 429 with a Retry-After header in seconds. LinkedIn adds its own pacing on reads, and holds at most 50 unsent messages per account.