Skip to main content
POST
/
oauth
/
token
Exchange authorization code for user info
curl --request POST \
  --url https://api.maxcare.ai/v4/oauth/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "grant_type": "authorization_code",
  "code": "d4d9cccb37643c5913fe649d1880889a...",
  "redirect_uri": "https://myapp.com/auth/callback"
}
'
{
  "id_token": "eyJhbGciOiJFUzI1NiIs...",
  "user": {
    "id": "usr_1231b6f32b4f4b8f8eeb4f7806bc45b0",
    "email": "jane@clinic.com",
    "firstName": "Jane",
    "lastName": "Doe",
    "imageUrl": "https://img.clerk.com/..."
  },
  "authorizedOrganizations": [
    {
      "id": "org_7e2c8cfeb7a94deb986de7012589e72b",
      "name": "Dermatology Clinic",
      "facilities": [
        {
          "id": "fac_a1b2c3d4e5f67890abcdef1234567890",
          "name": "Main Office",
          "address": "123 Main St, Austin, TX 78701"
        }
      ],
      "role": "admin"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.maxcare.ai/llms.txt

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

Authorizations

Authorization
string
header
required

Marketplace API key

Headers

X-Organization-Id
string
required

Target clinic organization ID

Body

application/json
grant_type
string
required

Must be 'authorization_code'

Example:

"authorization_code"

code
string
required

The authorization code received from the callback

Example:

"d4d9cccb37643c5913fe649d1880889a..."

redirect_uri
string
required

Must match the redirect_uri used in the authorize request

Example:

"https://myapp.com/auth/callback"

Response

Token exchange successful

id_token
string
required

OIDC id_token (ES256-signed JWT)

Example:

"eyJhbGciOiJFUzI1NiIs..."

user
object
required
authorizedOrganizations
object[]
required