API Reference
Image upload (www.linkedin.com)PUTUpload the image bytesGETDownload an image
Authentication (OAuth 2.0)

Exchange a code or refresh a token

POST/oauth/v2/accessToken
Base URL: https://linkedin-ads.mimicr.dev · provider: https://www.linkedin.com

Exchanges the authorization code for an access token (60 days) and a refresh token (365 days), or refreshes the access token. Form-encoded.

  • grant_type=authorization_code: code, client_id, client_secret, redirect_uri (the same as on the authorization URL).
  • grant_type=refresh_token: refresh_token, client_id, client_secret. Returns a new access token and the same refresh token with its remaining lifetime.

Requesting a different set of scopes than an earlier grant revokes the member's earlier tokens for this app.

Authorization

Public route, no token.

Body

application/x-www-form-urlencoded
grant_typestringrequired

Grant type.

authorization_coderefresh_token
codestring

The authorization code (authorization_code).

redirect_uristring

The redirect_uri of the authorization (authorization_code).

refresh_tokenstring

The refresh token (refresh_token).

client_idstringrequired

Client id of the app.

client_secretstringrequired

Client secret of the app.

Responses

200Tokens.
access_tokenstring

Opaque access token, about 500 characters (plan for 1,000).

expires_ininteger

Seconds until the access token expires: 5184000 (60 days).

refresh_tokenstring

Programmatic refresh token. In Mimicr it comes while the homologation toggle programmaticRefresh is on (default).

refresh_token_expires_ininteger

Seconds until the refresh token expires: 31536000 (365 days) on the first exchange, then the remaining time; a refresh never extends it.

scopestring

Granted scopes, space-separated.

400invalid_request (missing parameter, or a bad, expired or revoked refresh token) or invalid_redirect_uri (code expired or used, or another app or redirect_uri).
errorstring

Error code (invalid_request, invalid_redirect_uri, invalid_client, server_error).

error_descriptionstring

Error message.

401invalid_request "authorization code not found" or invalid_client (wrong secret).
errorstring

Error code (invalid_request, invalid_redirect_uri, invalid_client, server_error).

error_descriptionstring

Error message.

500server_error, from the sandbox chaos.
errorstring

Error code (invalid_request, invalid_redirect_uri, invalid_client, server_error).

error_descriptionstring

Error message.