Linkedin API 1
Linkedin API 1
Where to Start
b GET STARTED
Authentication
API Concepts
Best Practices
Error Handling
Consumer Solutions
e OVERVIEW
Consumer Overview
Share on LinkedIn
Plugins
Learning Solutions
e OVERVIEW
Learning Home
Learning Overview
Request Access
API Terminology
API Foundations
Marketing Solutions
e OVERVIEW
Marketing Overview
Getting Started
Use Cases
Integrations Overview
Recent Changes
Talent Solutions
e OVERVIEW
Talent Overview
Apply Connect
Talent Hub
Job Posting
Easy Apply
Sales Solutions
e OVERVIEW
Sales Overview
Analytics Services
Display Services
Sync Services
Compliance
e OVERVIEW
Compliance Overview
Release Notes
Getting Access to LinkedIn APIs
Article • 02/05/2025
The LinkedIn API uses OAuth 2.0 for user authorization and API authentication.
Applications must be authorized and authenticated before they can fetch data from
LinkedIn or get access to member data. This page summarizes the available permissions
and partner programs available for accessing LinkedIn APIs. Most permissions and
partner programs require explicit approval from LinkedIn. Open Permissions are the only
permissions that are available to all developers without special approval.
All permissions listed below are used in either Member Authentication Flow (3-legged)
or Application Authentication Flow (2-legged). More about these permission types can
be found in Authenticating with OAuth 2.0 Overview.
ノ Expand table
Share on LinkedIn w_member_social Member Auth: Post, comment and like posts
on behalf of an authenticated member.
Learning
Developers seeking to build a learning related integration should refer to the Request
API Access page within the LinkedIn Learning API space.
Marketing
Developers seeking to build a marketing related integration using Advertising APIs
permissions must be approved. You can apply for access through the Developer
Portal . This can be done by selecting your app from My Apps , navigate to the
Products tab, and add the Marketing Developer Platform product. Qualifications to be
an Advertising APIs partner are available at Become a Partner .
ノ Expand table
ACCOUNT_BILLING_ADMIN
ACCOUNT_MANAGER
CAMPAIGN_MANAGER
CREATIVE_MANAGER
VIEWER
Sales
Developers seeking to build sales related integration using one of the permissions
below must be approved as a Sales Navigator Application Platform (SNAP) partner.
Apply here to be a SNAP partner.
ノ Expand table
Talent
Developers seeking to build talent related integrations through one of the programs
listed below can apply here . We recommend familiarizing yourself with the types of
partner integrations available before applying by visiting here and here .
Compliance (Closed)
The following permissions used for Compliance integrations are listed for reference
purposes only. Access is closed and may not be requested.
ノ Expand table
Product/Program Permission Description
Compliance w_compliance Member Auth: Manage and delete data for compliance.
Feedback
Was this page helpful? Yes No
The LinkedIn API uses OAuth 2.0 for member (user) authorization and API
authentication. Applications must be authorized and authenticated before they can
fetch data from LinkedIn or get access to LinkedIn member data.
Depending on the type of permissions your integration will require, follow one of the
authorization flows to get started.
7 Note
There are several third-party libraries in the open source community which
abstract the OAuth 2.0 authentication process in every major programming
language.
LinkedIn does not support TLS 1.0.
Tip
7 Note
Always request the minimal permission scopes necessary for your use case.
Sample Application
You can explore the OAuth Sample Applications that enables you to try out RESTful
OAuth calls to the LinkedIn Authentication server. The sample app is available in Java.
Feedback
Was this page helpful? ツ Yes ト No
The Authorization Code Flow is used for applications to request permission from a
LinkedIn member to access their account data. The level of access or profile detail is
explicitly requested using the scope parameter during the authorization process
outlined below. This workflow will send a consent prompt to a selected member, and
once approved your application may begin making API calls on behalf of that member.
This approval process ensures that LinkedIn members are aware of what level of detail
an application may access or action it may perform on their behalf.
If multiple scopes are requested, the user must be consent to all of them and may not
select individual scopes. For the benefit of your LinkedIn users, please ensure that your
application requests the least number of scope permissions.
7 Note
Prerequisites
A LinkedIn Developer application to create a new application or select your
existing application
Prior authorization access granted for at least one 3-legged OAuth permission.
7 Note
LinkedIn servers will only communicate with URLs that you have identified as
trusted.
not /auth/linkedin/callback
parameters are ignored:
https://dev.example.com/auth/linkedin/callback?id=1
will be https://dev.example.com/auth/linkedin/callback
URLs cannot include a #
https://dev.example.com/auth/linkedin/callback#linkedin is invalid.
Each application is assigned a unique Client ID (Consumer key/API key) and Client
Secret. Please make a note of these values as they will be integrated into your
application. Your Client Secret protects your application's security so be sure to keep it
secure!
2 Warning
Do not share your Client Secret value with anyone, and do not pass it in the URL
when making API calls, or URI query-string parameters, or post in support forums,
chat, etc.
2. If there is an existing permission grant from the member: the authorization screen
is bypassed and the member is immediately redirected to the URL provided in the
redirect_uri query parameter.
When the member completes the authorization process, the browser is redirected to the
URL provided in the redirect_uri query parameter.
7 Note
If the scope permissions are changed in your app, your users must re-authenticate
to ensure that they have explicitly granted your application all of the permissions
that it is requesting on their behalf.
https
GET https://www.linkedin.com/oauth/v2/authorization
ノ Expand table
response_type string The value of this field should always be: code Yes
client_id string The API Key value generated when you registered your Yes
application.
redirect_uri url The URI your users are sent back to after authorization. This Yes
value must match one of the Redirect URLs defined in your
application configuration . For example,
https://dev.example.com/auth/linkedin/callback .
state string A unique string value of your choice that is hard to guess. No
Used to prevent CSRF . For example,
state=DCEeFWf45A53sdfKef424 .
The scopes available to your app depend on which Products or Partner Programs your
app has access to. This information is available in the Developer Portal . Your app's
Auth tab will show current scopes available. You can apply for new Products under the
Products tab. If approved, your app will have access to new scopes.
Sample Request
https
GET https://www.linkedin.com/oauth/v2/authorization?
response_type=code&client_id={your_client_id}&redirect_uri=
{your_callback_url}&state=foobar&scope=liteprofile%20emailaddress%20w_member
_social
Once redirected, the member is presented with LinkedIn's authentication screen. This
identifies your application and outlines the particular member permissions/scopes that
your application is requesting. You can change the logo and application name in the
Developer Portal under My apps > Settings
Member Approves Request
By providing valid LinkedIn credentials and clicking Allow, the member approves your
application's request to access their member data and interact with LinkedIn on their
behalf. This approval instructs LinkedIn to redirect the member to the redirect URL that
you defined in your redirect_uri parameter.
https
https://dev.example.com/auth/linkedin/callback?
state=foobar&code=AQTQmah11lalyH65DAIivsjsAQV5P-
1VTVVebnLl_SCiyMXoIjDmJ4s6rO1VBGP5Hx2542KaR_eNawkrWiCiAGxIaV-TCK-
mkxDISDak08tdaBzgUYfnTJL1fHRoDWCcC2L6LXBCR_z2XHzeWSuqTkR1_jO8CeV9E_WshsJBgE-
PWElyvsmfuEXLQbCLfj8CHasuLafFpGb0glO4d7M
Attached to the redirect_uri are two important URL arguments that you need to read
from the request:
The code is a value that you exchange with LinkedIn for an OAuth 2.0 access token in
the next step of the authentication process. For security reasons, the authorization code
has a 30-minute lifespan and must be used immediately. If it expires, you must repeat all
of the previous steps to request another authorization code.
2 Warning
Before you use the authorization code, your application should ensure that the
value returned in the state parameter matches the state value from your original
authorization code request. This ensures that you are dealing with the real member
and not a malicious script. If the state values do not match, you are likely the victim
of a CSRF attack and your application should return a 401 Unauthorized error
code in response.
Failed Requests
If the member chooses to cancel, or the request fails for any reason, the client is
redirected to your redirect_uri with the following additional query parameters
appended:
account.
user_cancelled_authorize - The member refused to authorize the permissions
https
POST https://www.linkedin.com/oauth/v2/accessToken
To do this, make the following HTTP POST request with a Content-Type header of x-www-
form-urlencoded using the following parameters:
ノ Expand table
Parameter Type Description Required
grant_type string The value of this field should always be: authorization_code Yes
client_secret string The Secret Key value generated in Step 1. See the Best Yes
Practices Guide for ways to keep your client_secret value
secure.
redirect_uri url The same redirect_uri value that you passed in the previous Yes
step.
Sample Request
https
https
POST https://www.linkedin.com/oauth/v2/accessToken
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
code={authorization_code_from_step2_response}
client_id={your_client_id}
client_secret={your_client_secret}
redirect_uri={your_callback_url}
Response
A successful access token request returns a JSON object containing the following
fields:
ノ Expand table
access_token string The access token for the application. This value must be kept
secure as specified in the API Terms of Use . The length of
access tokens is ~500 characters. We recommend that you
plan for your application to handle tokens with length of at
least 1000 characters to accommodate any future expansion
plans. This applies to both access tokens and refresh tokens.
Parameter Type Description
expires_in int The number of seconds remaining until the token expires.
Currently, all access tokens are issued with a 60-day lifespan.
refresh_token string Your refresh token for the application. This token must be kept
secure.
refresh_token_expires_in int The number of seconds remaining until the refresh token
expires. Refresh tokens usually have a longer lifespan than
access tokens.
JSON
{
"access_token":"AQUvlL_DYEzvT2wz1QJiEPeLioeA",
"expires_in":5184000,
"scope":"r_basicprofile"
}
For more error details, refer to the API Error Details table.
7 Note
Sample Request
Bash
curl -X GET https://api.linkedin.com/v2/me' \
-H 'Authorization: Bearer {INSERT_TOKEN}'
Tip
To protect members' data, LinkedIn does not generate long-lived access tokens.
Make sure your application refreshes access tokens before they expire, to avoid
unnecessarily sending your application's users through the authorization
process again.
Programmatic refresh tokens are available for a limited set of partners. If this feature has
been enabled for your application, see Programmatic Refresh Tokens for instructions.
/oauth/v2/authorization
ノ Expand table
HTTP ERROR ERROR DESCRIPTION RESOLUTION
STATUS MESSAGE
CODE
401 Redirect_uri Redirect URI passed in the Ensure that the redirect URI passed
doesn’t match request does not match the in the request match the redirect
redirect URI added to the URI added in the developer
developer application. application under the
Authorization tab.
401 Client_id Client ID passed in the Ensure that the client ID passed is
doesn’t match request does not match the in match with the developer
client ID of the developer application.
application.
401 Invalid scope Permissions passed in the Ensure that the permissions sent in
request is invalid scope parameter is assigned to the
developer application in the
developer portal.
/oauth/v2/accessToken
ノ Expand table
400 invalid_request "A required Redirect_uri in the Pass the redirect_uri in the
parameter "redirect_uri" is request is missing. request to route user back to
missing" It is mandatory correct landing page.
parameter.
400 invalid_request "A required Client ID in the Pass the client id of the app in
parameter "client_id" is request is missing. request.
missing" It is mandatory
parameter.
400 invalid_request "A required Client Secret in the Pass the client secret of the
parameter "client_secret" is request is missing. app in request.
missing" It is mandatory
parameter.
400 invalid_redirect_uri "Unable to Invalid redirect uri Pass the right redirect uri
retrieve access token: is passed in the tagged to the developer
appid/redirect uri/code verifier request. application.
does not match authorization
code. Or authorization code
expired. Or external member
binding exists"
Feedback
Was this page helpful? Yes No
If your application needs to access APIs that are not member specific, use the Client
Credential Flow. Your application cannot access these APIs by default.
Learn more:
) Important
7 Note
Each application is assigned a unique Client ID (Consumer key/API key) and Client
Secret. Please make a note of these values as they will be integrated into your
application config files. Your Client Secret protects your application's security so be sure
to keep it secure!
2 Warning
Do not share your Client Secret value with anyone, and do not pass it in the URL
when making API calls, or URI query-string parameters, or post in support forums,
chat, etc.
body:
https
https://www.linkedin.com/oauth/v2/accessToken
ノ Expand table
client_id The Client ID value generated when you registered your application Yes
client_secret The Client Secret value generated when you registered your Yes
application. All values requiring URL encoding must be encoded. Client
secrets can include characters like / , = , + which require URL encoding.
View the Best Practices for Secure Applications page for more security info.
https
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
client_id={your_client_id}
client_secret={your_client_secret}
A successful access token request returns a JSON object containing the following
fields:
access_token — The access token for the application. This token must be kept
secure.
expires_in — Seconds until token expiration.
The access token has a 30-minute lifespan and must be used immediately. You
may request a new token once your current token expires.
Sample Response
JSON
{
"access_token": "AQV8...",
"expires_in": "1800"
}
Sample Request
https
401 invalid_client_id "Client Client Authentication Check whether the right Client
authentication failed" failed due to bad client ID, Client Secret are passed as
credentials passed as part of the request.
part of the request.
400 invalid_request "A Client ID in the request is Pass the Client ID of the
required parameter missing. It is a developer application in
"client_id" is missing" mandatory parameter. request.
400 invalid_request "A Client Secret in the Pass the Client Secret of the
required parameter request is missing. It is a developer application in the
"client_secret" is mandatory parameter. request.
missing"
400 invalid_client_id "The Invalid client ID is passed Pass the right client ID from the
passed in client_id is in the request. developer application.
invalid "abcdefghijk""
Feedback
Was this page helpful? Yes No
Summary
The full process your application will need to implement for 3-legged tokens is
described in Authorization Code Flow and 2-legged tokens is described in Client
Credentials Flow. The steps outlined below describe the process for using LinkedIn's
Public Postman workspaces to generate OAuth tokens for testing. For any specific
examples, we will use the Marketing Solutions workspace, but all steps should easily
apply to all workspaces. These steps assume you have already created a free Postman
account .
Step 1 - Application
Go to the LinkedIn Developer Portal , select the app you'll be using, click the "Auth"
tab, and locate your Client ID and Client Secret. Please note these values for use later
during this process.
Choose a workspace and fork the collections and relevant environments of interest. Each
collection will have an environment it should be used with. For example, if you were to
navigate to the LinkedIn Marketing Solutions workspace, the Campaign Management
collection should be used with the campaign-management-env environment.
Fork an environment:
https://www.microsoft.com/en-us/videoplayer/embed/RWNqGv?postJsllMsg=true
Step 4 - Fill in Environment Variables
Fill in the Client ID and Client Secret environment variables before moving onto the next
step. Don't forget to save your changes!
Step 5 - Headers
Each collection in each workspace will have its OAuth 2.0 Authorization settings pre-
populated with the correct URLs, environment variables, and scopes to be able to
successfully run the requests within the corresponding Use Cases folder. Click on a
collection title to open it's Authorization tab. Ensure that the correct environment is
selected and click "Get new access token":
Step 8 - Testing
Finally, send a request within the Use Cases folder. Ensure the correct environment is
selected and that if any environment or collection level variables are being used in the
request, ensure they are set. For example, in the screenshot below, the request uses the
sponsoredaccount_id variable from the campaign-management-env environment.
Feedback
Was this page helpful? ツ Yes ト No
LinkedIn supports programmatic refresh tokens for all approved Marketing Developer
Platform (MDP) partners.
Introduction
Refresh tokens are used to get a new access token when your current access token
expires. For more information, see the OAuth 2.0 RFC .
LinkedIn offers programmatic refresh tokens that are valid for a fixed length of time. By
default, access tokens are valid for 60 days and programmatic refresh tokens are valid
for a year. The member must reauthorize your application when refresh tokens expire.
When you use a refresh token to generate a new access token, the lifespan or Time To
Live (TTL) of the refresh token remains the same as specified in the initial OAuth flow
(365 days), and the new access token has a new TTL of 60 days.
7 Note
Refresh Tokens are useful in minting new Access tokens and allow for seamless
operations for extended periods of time. However, LinkedIn reserves the right to
revoke Refresh Tokens or Access Tokens at any time due to technical or policy
reasons. In such scenarios, the expectation from products leveraging Refresh
Tokens is to fallback to the standard OAuth flow, and present the login screen to
the end users.
refresh_token — Your refresh token for the application. This token must be kept
secure.
refresh_token_expires_in — The number of seconds remaining until the refresh
token expires. Refresh tokens usually have a longer lifespan than access tokens.
scope — URL-encoded, space-delimited list of member permissions your
Sample Response
JSON
{
"access_token": "AQXNnd2kXITHELmWblJigbHEuoFdfRhOwGA0QNnumBI8XOVSs0HtOHEU-
wvaKrkMLfxxaB1O4poRg2svCWWgwhebQhqrETYlLikJJMgRAvH1ostjXd3DP3BtwzCGeTQ7K9vvA
qfQK5iG_eyS-q-
y8WNt2SnZKZumGaeUw_zKqtgCQavfEVCddKHcHLaLPGVUvjCH_KW0DJIdUMXd90kWqwuw3UKH27k
i5raFDPuMyQXLYxkqq4mYU-IUuZRwq1pcrYp1Vv-
ltbA_svUxGt_xeWeSxKkmgivY_DlT3jQylL44q36ybGBSbaFn-
UU7zzio4EmOzdmm2tlGwG7dDeivdPDsGbj5ig",
"expires_in": 86400,
"refresh_token": "AQWAft_WjYZKwuWXLC5hQlghgTam-tuT8CvFej9-
XxGyqeER_7jTr8HmjiGjqil13i7gMFjyDxh1g7C_G1gyTZmfcD0Bo2oEHofNAkr_76mSk84sppsG
bygwW-5oLsb_OH_EXADPIFo0kppznrK55VMIBv_d7SINunt-
7DtXCRAv0YnET5KroQOlmAhc1_HwW68EZniFw1YnB2dgDSxCkXnrfHYq7h63w0hjFXmgrdxeeAuO
HBHnFFYHOWWjI8sLLenPy_EBrgYIitXsAkLUGvZXlCjAWl-
W459feNjHZ0SIsyTVwzAQtl5lmw1ht08z5Du-RiQahQE0sv89eimHVg9VSNOaTvw",
"refresh_token_expires_in": 525600,
"scope":"r_basicprofile"
7 Note
Refresh tokens are approximately 500 characters long. We recommend that your
application stack be made to handle tokens of at least 1000 characters to
accommodate future expansion plans. This applies to access tokens as well as
refresh tokens.
POST
https://www.linkedin.com/oauth/v2/accessToken
client_id The Client ID value generated when you registered your application. Yes
client_secret The Client Secret value generated when you registered your Yes
application.
Sample Request
https
POST https://www.linkedin.com/oauth/v2/accessToken
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token&refresh_token=AQQOMeCIQMa6-zjU-
02w8EJW67wPVk3hjJE5x1lZhU013LihKD8i1DpvaAl2jnuP8F1uXMgkm8nzjPfnaJR_kQNOxsLRL
ZWnAMzHMm81S0yQlkBYicw&client_id=861hhm46p48to2&client_secret=gPecS7yqHkyySh
vR
A successful request returns a new access token with a new expiration time and the
refresh token.
JSON
{
"access_token": "BBBB2kXITHELmWblJigbHEuoFdfRhOwGA0QNnumBI8XOVSs0HtOHEU-
wvaKrkMLfxxaB1O4poRg2svCWWgwhebQhqrETYlLikJJMgRAvH1ostjXd3DP3BtwzCGeTQ7K9vvA
qfQK5iG_eyS-q-
y8WNt2SnZKZumGaeUw_zKqtgCQavfEVCddKHcHLaLPGVUvjCH_KW0DJIdUMXd90kWqwuw3UKH27k
i5raFDPuMyQXLYxkqq4mYU-IUuZRwq1pcrYp1Vv-
ltbA_svUxGt_xeWeSxKkmgivY_DlT3jQylL44q36ybGBSbaFn-
UU7zzio4EmOzdmm2tlGwG7dDeivdPDsGbj5ig",
"expires_in": 86400,
"refresh_token": "AQWAft_WjYZKwuWXLC5hQlghgTam-tuT8CvFej9-
XxGyqeER_7jTr8HmjiGjqil13i7gMFjyDxh1g7C_G1gyTZmfcD0Bo2oEHofNAkr_76mSk84sppsG
bygwW-5oLsb_OH_EXADPIFo0kppznrK55VMIBv_d7SINunt-
7DtXCRAv0YnET5KroQOlmAhc1_HwW68EZniFw1YnB2dgDSxCkXnrfHYq7h63w0hjFXmgrdxeeAuO
HBHnFFYHOWWjI8sLenPy_EBrgYIitXsAkLUGvZXlCjAWl-
W459feNjHZ0SIsyTVwzAQtl5lmw1ht08z5Du-RiQahQE0sv89eimHVg9VSNOaTvw",
"refresh_token_expires_in": 439200,
"scope":"r_basicprofile"
}
400 invalid_request "A required Redirect_URI in the Pass the Redirect_URI in the
parameter "redirect_uri" is request is missing. It request to route user back to
missing" is mandatory correct landing page.
parameter.
HTTP ERROR MESSAGE ERROR RESOLUTION
STATUS DESCRIPTION
CODE
400 invalid_request "A required Client ID in the Pass the client id of the app in
parameter "client_id" is request is missing. It request.
missing" is mandatory
parameter.
400 invalid_request "A required Refresh Token in the Pass the stored Refresh Token
parameter "refresh_token" request is missing. It received as part of initial access
is missing" is mandatory token call.
parameter.
Feedback
Was this page helpful? ツ Yes ト No
The LinkedIn Developer Portal Token Generator Tool allows a quick and easy method for
generating an access token to make authenticated API calls.
4. Member approval
The authenticated member will receive a request for your app to access to their profile.
5. Token Generation
Once the token is generated, the "Token Details" will be shown along with the token.
Click "Copy token" to paste it into your application code.