Skip to main content

Endpoint

POST https://api.apifycloud.io/api/v1/oauth/token

Authentication

No bearer token required.

Request body

  • grant_type (string, required) must be client_credentials
  • client_id (string, required)
  • client_secret (string, required)
{
  "grant_type": "client_credentials",
  "client_id": "your_client_id",
  "client_secret": "your_client_secret"
}

Response

{
  "data": {
    "access_token": "string",
    "token_type": "Bearer",
    "expires_in": 3600
  },
  "meta": {
    "timestamp": "2024-01-01T00:00:00.000Z"
  }
}

Errors

  • 400 invalid_request invalid JSON body
  • 400 unsupported_grant_type only client_credentials supported
  • 400 invalid_client missing client_id or client_secret
  • 401 invalid_client client not found or invalid secret
  • 500 server_error

Example

curl -X POST "https://api.apifycloud.io/api/v1/oauth/token" \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "your_client_id",
    "client_secret": "your_client_secret"
  }'