---
title: "Connect a LinkedIn account for scraping (session cookies)"
method: POST
path: "/linkedin-scrappers/authes"
tags: ["LinkedIn scraper"]
---

# Connect a LinkedIn account for scraping (session cookies)

`POST /linkedin-scrappers/authes`

## Request

- Base URL: `https://api.emelia.io`
- URL: `https://api.emelia.io/linkedin-scrappers/authes`
- Auth: API key in header `Authorization`

Connects a LinkedIn account for Sales Navigator scraping by sending the cookies of a browser session where the user is logged in to LinkedIn and Sales Navigator. No password is involved. The Emelia browser extension does this for you; use this route to automate it.

`li_at` is required. Strongly recommended: `li_a` (Sales Navigator session), `ua` (user agent of the browser the cookies come from), `additionnalsCookie` (the other linkedin.com cookies, as objects `{ name, value, domain }`), `viewport` (that browser window size) and `country` (ISO alpha-2 code: Emelia browses LinkedIn through a proxy located in this country; default the workspace country, then FR).

Returns `authId`, to use in `authes` of `POST /linkedin-scrappers`. The same `li_at` cannot be registered twice. When a session expires, update the existing account with `PUT /linkedin-scrappers/authes/{id}` instead of creating a new one.

Emelia stores these cookies and refreshes them after each scraping session. There is currently no API route to remove a connected scraping account.

Pitfalls: `jsessionid` is accepted but ignored (send `JSESSIONID` inside `additionnalsCookie`). Cookies sent as `"name=value"` strings are accepted but not used by the Sales Navigator scraper: send objects. Fields not described here are reserved for Emelia apps; any other field is rejected.

## Request body

- ScrapperAuthCookies: Session cookies of a LinkedIn account logged in to Sales Navigator.
  - `li_at` string, required: Value of the `li_at` cookie (LinkedIn session). Required.
  - `li_a` string: Value of the `li_a` cookie (Sales Navigator session).
  - `jsessionid` string: Accepted but ignored. Send `JSESSIONID` in `additionnalsCookie`.
  - `ua` string: User agent of the browser the cookies come from.
  - `additionnalsCookie` union[]: Other linkedin.com cookies of the same session (spelling with two n is the real field name). `li_at`, `li_a` and `JSESSIONID` entries are dropped (the latter is then lost).
    - union
      - ScrapperCookie: A browser cookie as exported by the browser (extra attributes such as `path`, `expires`, `secure` are accepted). Without `domain`, `.www.linkedin.com` is used.
        - `name` string, required
        - `value` string, required
        - `domain` string
      - string: `name=value` string: accepted, but not used by the Sales Navigator scraper.
  - `viewport` ScrapperViewport: Window size of the browser the cookies come from. Both values required when the object is sent.
    - `width` number, required
    - `height` number, required
  - `country` string: ISO 3166-1 alpha-2 code of the country the account is used from (for example `FR`). Emelia browses LinkedIn through a proxy located in this country.

## Response `200`

Account connected.

- ScrapperAuthIdResponse
  - `success` boolean, required
  - `authId` string, required: Account id.

## Other responses

- `400`: Invalid body or cookie already registered.
- `401`: Missing or invalid API key (`Authorization` header).
- `500`: Unexpected server error. Current behavior: also returned when the per-minute API quota of the workspace is exceeded (30 requests per minute without subscription, 100 on Start, 300 on Grow, 1,000 on Scale). A 429 would be expected; retry after a minute.

---

[API](https://skmtc.dev/emelia/apis/emelia-api.md) · [All operations](https://skmtc.dev/emelia/apis/emelia-api/llms.txt) · [OpenAPI document](https://skmtc.dev/emelia/apis/emelia-api/revisions/8c0cb435f2c4?raw)
