Skip to main content
POST
/
oauth2
/
token
Create access token
curl --request POST \
  --url https://auth.neuronsearchlab.com/oauth2/token \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data 'scope=neuronsearchlab-api/read neuronsearchlab-api/write'
{
  "access_token": "<token>",
  "expires_in": 3600,
  "token_type": "Bearer",
  "scope": "neuronsearchlab-api/read neuronsearchlab-api/write"
}

Documentation Index

Fetch the complete documentation index at: https://docs.neuronsearchlab.com/llms.txt

Use this file to discover all available pages before exploring further.

Endpoint

POST https://auth.neuronsearchlab.com/oauth2/token
This endpoint is unauthenticated. Send SDK credentials with HTTP Basic authentication from a trusted server.

Request

curl -X POST https://auth.neuronsearchlab.com/oauth2/token \
  -H "Authorization: Basic <base64(client_id:client_secret)>" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&scope=neuronsearchlab-api/read%20neuronsearchlab-api/write"
FieldTypeRequiredDescription
grant_typestringyesMust be client_credentials.
scopestringnoSpace-delimited scopes. Omit to use the scopes configured for the client.

Response

{
  "access_token": "<token>",
  "expires_in": 3600,
  "token_type": "Bearer",
  "scope": "neuronsearchlab-api/read neuronsearchlab-api/write"
}
Use access_token as the Bearer token for Core API resource calls. expires_in is a lifetime in seconds; compute expires_at = now + expires_in in your token cache and refresh before that time.

Errors

StatusScenario
400Unsupported grant type or malformed request body
401Invalid client credentials
429Token request rate limit exceeded

Authorizations

Authorization
string
header
required

HTTP Basic authentication using client_id:client_secret for token exchange.

Body

application/x-www-form-urlencoded
grant_type
enum<string>
required
Available options:
client_credentials
scope
string

Space-delimited OAuth scopes. Omit to use the scopes configured for the client.

Example:

"neuronsearchlab-api/read neuronsearchlab-api/write"

Response

Access token

access_token
string
required

Bearer token to send in the Authorization header.

expires_in
integer
required

Token lifetime in seconds.

Example:

3600

token_type
enum<string>
required
Available options:
Bearer
scope
string
Example:

"neuronsearchlab-api/read neuronsearchlab-api/write"