Exchanges a service account client ID and secret for a short-lived bearer token. Only grant_type=client_credentials is supported.
application/json
POST
/api/v1/oauth/token
cURL (application/json)
curl \
--request POST 'https://agentengine.mongodb.com/api/v1/oauth/token' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"client_id": "string",
"client_secret": "string",
"grant_type": "client_credentials"
}'
curl \
--request POST 'https://agentengine.mongodb.com/api/v1/oauth/token' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'grant_type=client_credentials&client_id=string&client_secret=string'
Request examples
{
"client_id": "string",
"client_secret": "string",
"grant_type": "client_credentials"
}
Response examples (200)
{
"access_token": "string",
"expires_in": 42,
"token_type": "string"
}
Response examples (400)
{
"error": "string",
"error_description": "string"
}
Response examples (401)
{
"error": "string",
"error_description": "string"
}
Response examples (429)
# Headers
Retry-After: string
# Payload
{
"error": "string",
"error_description": "string"
}
Response examples (500)
{
"error": "string",
"error_description": "string"
}