- HTTP request headers
- Basic authentication scheme
- Scopes
- OAuth consent screen
- Incremental authorization
- Granted scopes
- oauth/v2/authorize endpoint
- Query parameters for oauth/v2/authorize
- Response fields for oauth/v2/authorize
- oauth/v2/tokens endpoint
- Request body parameters for oauth/v2/tokens
- Response fields for oauth/v2/tokens
- v2/api/appinfo endpoint
- Parameters for v2/api/appinfo
- Response fields for v2/api/appinfo
- v2/api/userinfo endpoint
- Parameters for v2/api/userinfo
- Response fields for v2/api/userinfo
- Error response
- See also
- Guides
- Glossary
- Specifications
OAuth reference
HTTP request headers, scopes, and API endpoints with request parameters and response fields.
By using this API and its documentation and building an integration, you agree to the Additional API Terms and Guidelines.
HTTP request headers
#The request headers are:
| Header | Value and description |
|---|---|
Accept | application/json |
Authorization |
In each API call, pass the access token in this header with the When you request or refresh an access token through the See also access token and basic authentication scheme. |
Content-Type |
When you request or refresh an access token through the |
Basic authentication scheme
#When you get an access token, you can pass your client ID and secret in an Authorization: Basic header instead of in the /oauth/v2/tokens request body.
See also Basic Authentication Scheme (opens in a new window) in RFC 2617: HTTP Authentication: Basic and Digest Access Authentication.
To generate the Authorization Basic header value:
-
Concatenate the
client_idandclient_secretwith a colon (:) as a separator.base64.encode("<client_id>:<client_secret>"); -
Apply the Base64-encoding algorithm to the string:
base64.encode("5e175cbb7f88e2048bd95323bbc9ca2fcec32ad60f95f7ee66ab53e099abe6f3:pJ4qRe2sdXRP0Whr3bwz9D37exFuuOtqJDRHMmmlLWV7J25rH7oItrPNCKzhaQf2"); -
Pass the Base64-encoded string as a basic HTTP
Authorizationheader:Authorization: Basic NWUxNzVjYmI3Zjg4ZTIwNDhiZDk1MzIzYmJjOWNhMmZjZWMzMmFkNjBmOTVmN2VlNjZhYjUzZTA5OWFiZTZmMzpwSjRxUmUyc2RYUlAwV2hyM2J3ejlEMzdleEZ1dU90cUpEUkhNbW1sTFdWN0oyNXJIN29JdHJQTkNLemhhUWYy
Scopes
#Scopes let your app act for itself, for other user accounts, or for the employer accounts associated with them.
For 3-legged OAuth, include the requested scopes in the scope parameter of the /oauth/v2/authorize request before consent. For 2-legged OAuth, include the scope parameter when required, such as scope=employer_access when getting a token for an employer account. Some Indeed APIs need extra scopes; see each API's documentation.
OAuth consent screen
#For the authorization code grant type (3-legged OAuth), Indeed shows the OAuth consent screen when your app calls https://secure.indeed.com/oauth/v2/authorize.
When the user selects Allow for the scopes your app requests, such as employer_access, Indeed sends an authorization code to the redirect_uri and appends the code, iss, and state response fields. See Response fields for oauth/v2/authorize.
After a user grants a scope, your app keeps it. For example, if your app later needs employer_access, the OAuth consent screen prompts the user only for employer_access, not for email or offline_access.
The user can revoke granted scopes at any time on Indeed's Third-party applications with account access (opens in a new window) page. The user can grant the scopes again the next time they use the app.
Incremental authorization
#Incremental authorization lets OAuth apps request scopes only when they need them. It requires the offline_access scope, which keeps the permissions your app already has. For example, if your app requests email, it must also request offline_access.
Granted scopes
#The consented_scope field in the oauth/v2/tokens response lists the app's granted scopes:
{ "access_token": "<access_token>", "refresh_token": "<refresh_token>", "id_token": "<id_token>", "scope": "offline_access employer_access email", "consented_scope": "offline_access employer_access email", "convid": "1er835qvtu54n800", "token_type": "Bearer", "expires_in": 3600}For 3-legged OAuth, the Current permissions tab on the OAuth consent screen also lists them.
| Scope | Permissions |
|---|---|
email | Consent screen: View your email address Lets your app read the user's
|
employer_access | Consent screen: List employers associated with a user account and get an access token for an employer Lists every employer account associated with the user. Required to get an access token for an employer. To list employers and get an access token for an employer:
|
offline_access | Consent screen: Maintain the permissions that you have granted Required to generate a refresh token. Indeed OAuth access tokens expire after one hour, so use a refresh token to get a new one.
|
oauth/v2/authorize endpoint
#To get an authorization code for the authorization code grant type (3-legged OAuth), call the https://secure.indeed.com/oauth/v2/authorize endpoint with the query parameters.
Indeed shows the OAuth consent screen to the end user who owns the target account.
When the user selects Allow for the scopes your app requests, such as employer_access, Indeed sends an authorization code to the redirect_uri and appends the code, iss, and state response fields. See Response fields for oauth/v2/authorize.
For an example call, see Get an authorization code.
Query parameters for oauth/v2/authorize
#This endpoint and these query parameters apply to 3-legged OAuth only:
| Query parameter | Description |
|---|---|
client_id | Required. The client ID. Examples:
|
code_challenge | Required for public clients, recommended for confidential clients. The OAuth PKCE code challenge derived from a code verifier per RFC 7636: Proof Key for Code Exchange by OAuth Public Clients (opens in a new window). Example:
|
code_challenge_method | Required when you use PKCE with Only Example:
|
employer | Optional. The employer ID to associate with the access token. You can also pass this parameter when you exchange a refresh token for an access token. Example:
|
prompt | Optional. Shows the authorizing user an Indeed employer selection screen, where they pick the employer account to assign to your access token. Add Example:
|
redirect_uri | Required. The URL-encoded redirect URL. Identifies the page on your site that captures the authorization code. It must match one of the redirect URLs your app registered. Example: Encode
Indeed accepts query parameters in |
response_type | Required. Always Example:
|
scope | Optional. The permissions your app requests. URL-encode and space-delimit the scopes. Encoding turns spaces into plus signs ( Example:
See Scopes. |
state | Recommended. Prevents CSRF attacks. Use any unique string your app creates to keep state between the request and the callback. Indeed passes this value back to your redirect URI. Example:
See Threat: CSRF Attack against redirect-uri (opens in a new window) in RFC 6819: OAuth 2.0 Threat Model and Security Considerations. |
Response fields for oauth/v2/authorize
#| Response field | Type | Description |
|---|---|---|
code | String | The authorization code. Valid for 10 minutes. Example:
|
iss | String | The authorization server's issuer ID, such as Indeed always returns this value in both successful and error responses (RFC 9207 (opens in a new window)). If you integrate only with Indeed, you can ignore it. If your client connects to multiple authorization servers, verify that the value matches Indeed's expected issuer to protect against mix-up attacks. Indeed declares support through Example:
|
state | String | Returned only when you pass Example:
|
oauth/v2/tokens endpoint
#To get or refresh an access token, send a POST to https://apis.indeed.com/oauth/v2/tokens with the Accept: application/json and Content-Type: application/x-www-form-urlencoded headers and the request body parameters.
For example calls, see:
Request body parameters for oauth/v2/tokens
#| Request body parameter | Description |
|---|---|
client_id | Your client ID. Example:
You can pass it in the
|
client_secret | Your client secret. Omit for public clients. Example:
You can pass it in the
|
code | The authorization code to exchange for an access token. To exchange a refresh token instead, use Example:
|
code_verifier | The code verifier that produced Example:
|
employer | The employer ID to associate with the access token. Example:
|
grant_type | Use one of these grant types:
Example:
|
redirect_uri | The URL-encoded redirect URL. It must match the redirect URL you used when you got the authorization code. Example: Encode
|
refresh_token | The refresh token to exchange for an access token. Indeed returns the refresh token when you get an access token. To exchange an authorization code instead, use Example:
|
scope | Conditional. To list the employer accounts associated with the user who registered the app, or to get an access token for one of those accounts, set For the token exchange grant type (OAuth), See Scopes. Example:
|
sub | The user's ID in the identity provider. Must map to Example:
|
subject_token | The token that identifies the party you're making the request for. The token issuer must give Indeed a way to validate it. Indeed supports only ID tokens. Example:
|
subject_token_type | The token type passed in Example:
|
Response fields for oauth/v2/tokens
#v2/api/appinfo endpoint
#To list the employers associated with the user account that registered the app, call https://secure.indeed.com/v2/api/appinfo and pass the access token in the Authorization header with the Bearer scheme.
For an example call, see Build selection screen.
Parameters for v2/api/appinfo
#This endpoint takes no request body or query parameters.
Response fields for v2/api/appinfo
#v2/api/userinfo endpoint
#To get account information for the current user, send a GET to https://secure.indeed.com/v2/api/userinfo. The response matches the information in the ID token.
Parameters for v2/api/userinfo
#This endpoint takes no request body or query parameters.
Response fields for v2/api/userinfo
#| Response field | Type | Description |
|---|---|---|
email | String | The user's email address. Indeed returns the Example: |
email_verified | Boolean | Whether the user has verified their email address. Indeed returns the Example:
|
employers | Object | The employer accounts associated with the user account that registered the app. Each employer includes the employer ID and name. The user must grant the |
sub | String | The unique identifier for the user's account. Example:
|
Error response
#See Troubleshoot OAuth errors.
See also
#Guides
#- 2-legged OAuth > Get an employer access token — Explains how to get an access token for an employer that's associated with your app.
- 3-legged OAuth > Get an employer access token — Explains how to get an access token for an employer that a user authorizes.
- 3-legged OAuth > Show the Indeed employer selection screen — Explains how to let the user pick the employer account for your access token.
- 3-legged OAuth > The userinfo endpoint — Explains how to get account information for the current user.
Glossary
#Specifications
#- OpenID Connect Core 1.0 > ID Token (opens in a new window) — Defines the ID token.
- RFC 6819 > Threat: CSRF Attack against redirect-uri (opens in a new window) — Explains why to use the
stateparameter. - RFC 7636: Proof Key for Code Exchange by OAuth Public Clients (opens in a new window) — Defines PKCE and
code_challenge. - RFC 9207: OAuth 2.0 Authorization Server Issuer Identification (opens in a new window) — Defines the
issresponse field.