The API works with the same accounts, seats and limits as the app. Use it from your own code, a pipeline, or an AI agent such as Claude Code, Codex or Cursor.
The full reference with every endpoint is in Swagger. You can also download the OpenAPI JSON there and give it to your AI agent.
Base URL and authentication
All requests go to:
https://ai.gologin.com/accounts-api
Send your Gologin API token in the Authorization header of every request:
curl https://ai.gologin.com/accounts-api/accounts \
-H "Authorization: Bearer YOUR_API_TOKEN"
This call lists your connected accounts, newest first. Disconnected accounts aren't included. Without a valid token, the API answers 401.
Create a token in the Gologin app: API & MCP > API > New Token, or in the API section under Connected accounts in the AI Assistant. A token can be created on a paid plan with two-factor authentication turned on in Gologin.
Sends are dry runs by default
Invitations, messages, comments and replies are sent only when you pass "send": true. Without it, the request is a dry run: it checks the target and tells you what would happen - who the recipient is, whether an invitation is possible, whether a conversation already exists - and sends nothing. Make the dry run first, then repeat the request with "send": true.
Publishing posts, reactions and accepting invitations use their own flags: publish, react and accept.
Connect an account
Get your workspace ID:
GET https://api.gologin.com/workspaceswith the same token returns your workspaces and theirid.Create the account:
curl -X POST https://ai.gologin.com/accounts-api/accounts \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"provider": "linkedin",
"workspaceId": "YOUR_WORKSPACE_ID",
"proxyCountry": "us",
"cookies": [{ "name": "li_at", "value": "YOUR_LI_AT_COOKIE" }]
}'
To sign in, pass one of:
credentials(loginandpassword),cookies, orbrowserProfileId- a Gologin profile that is already signed in to LinkedIn.For the IP, pass
proxyCountry(the codes come fromGET /available-countries) or your ownproxy(host,port, and optionallyprotocol,username,password). A linked Gologin profile uses its own proxy.To import existing conversations, add
"importHistory": true.
The account comes back as
pendingwhile the setup runs. CheckGET /accounts/{id}untilstatuschanges:
| What to do |
| The account is signed in. Optionally call |
| Send the code LinkedIn emailed: |
| Send the code from the authenticator app: |
| Send |
| Confirm the sign-in in the LinkedIn app and keep checking. If |
| The owner is passing a LinkedIn check in the app. Keep checking. |
|
|
Each wait lasts up to 10 minutes. An unsent code or an unconfirmed sign-in then ends in auth_failed.
Find people and send an invitation
Search.
GET /linkedin/people/search?accountId=ACCOUNT_ID&query=head%20of%20growthreturnsprofile_urlandprofile_idfor each person. Instead ofquery, you can passurl- a LinkedIn search link with its filters.Check the profile.
GET /linkedin/profile?accountId=ACCOUNT_ID&profileUrl=PROFILE_URLshowsis_connected,is_pendingandis_available_to_connect.Invite. Make a dry run first:
curl -X POST https://ai.gologin.com/accounts-api/linkedin/invites/send \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"accountId": "ACCOUNT_ID",
"profileUrl": "https://www.linkedin.com/in/some-person/",
"note": "Hi! I liked your post about onboarding. Would love to connect."
}'
connectable_dry_run means the invitation would go out. not_connectable says why not: already_connected, invite_pending or connect_unavailable. Repeat the request with "send": true. sent_verified means LinkedIn created the invitation.
Send a message
POST /linkedin/messages/send takes accountId, message and one of:
profileUrl- to write to a person. The conversation with them is found, or opened if there isn't one; the answer saysexisting_conversationornew_conversation. If only a paid InMail can reach the person, you getnot_messageablewithpaid_inmail_required. A paid InMail is never spent silently.conversationId- to continue a conversation: theconversation_idfrom/linkedin/inbox, a2-…thread ID or a thread URL.
A sent message returns sent_verified with message_id and conversation_id.
Read conversations
GET /linkedin/inbox?accountId=ACCOUNT_IDlists the account's conversations, newest first.GET /linkedin/messages/conversation?accountId=ACCOUNT_ID&conversationId=CONVERSATION_IDreturns the messages, oldest first.limitkeeps the most recent ones.GET /workspaces/{workspaceId}/conversationslists conversations of all accounts in the workspace, andGET /workspaces/{workspaceId}/inbox/unreadreturns the unread counts.
Get new messages on a webhook
curl -X PUT https://ai.gologin.com/accounts-api/workspaces/YOUR_WORKSPACE_ID/live-updates-webhook \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/gologin-webhook" }'
Every new update from the workspace's accounts is sent to this URL as JSON: { accountId, workspaceId, event }. Delivery is retried on errors, and the same event can arrive twice, so deduplicate by event.id. To remove the webhook, send {"url": null}. Localhost and internal addresses aren't accepted.
Limits
API actions count toward the same limits as the app.
GET /accounts/{id}/limitsreturns the account's stage and every limit: the recommended value, your own value, the applied value, how much is used andresetsAt- when the window has room for one more action.PUT /accounts/{id}/limitschanges thestageor your own values incustomLimits. Anullvalue removes your own value.DELETE /accounts/{id}/limits/customresets all limits to the recommended ones.GET /workspaces/{workspaceId}/accounts-usageshows how many accounts your workspace can connect and how many seats are taken.
Errors worth knowing
Response | What it means |
| The token is missing or invalid. |
| All seats in the workspace are taken. Delete an account or get more seats. |
| LinkedIn has no page at that profile URL. Check the URL: retrying won't help. |
| The account's session needs to be re-established. Call |
| LinkedIn returned a page we couldn't read. Report it to support. |
Warm up before a batch
A session that sits unused goes stale, and the first call after that takes seconds. Call POST /accounts/{id}/warmup before a batch of calls or right after signing in again. The account must be active.
