---
title: "Create an access token"
method: POST
path: "/oauth/token"
tags: ["OAuth"]
---

# Create an access token

`POST /oauth/token`

## Request

- Base URL: `https://api.clients.wellhub.com`
- URL: `https://api.clients.wellhub.com/oauth/token`
- Auth: none declared
- TypeScript: <https://skmtc.dev/wellhub/apis/integrations-api/docs/oauth/token/post.ts> (a function with typed inputs; its response is checked against the schema)

Exchanges client credentials for a Bearer access token using the `client_credentials` grant type. The returned token must be included in the `Authorization` header for all protected endpoints.

> **⚠️ Content-Type required.** This request **must** be sent with `Content-Type: application/x-www-form-urlencoded`. If your HTTP client sets a session-level default of `application/json` (a common pattern), you must override it explicitly for this request — otherwise the server will return `400: invalid grant type` without further explanation.

## Request body `application/x-www-form-urlencoded`

- object
  - `client_id` string, uuid, required: The unique UUID identifier for the client application.
  - `client_secret` string, required: The secret associated with the client application.
  - `grant_type` 'client_credentials', required: Must be `client_credentials`.

## Response `200`

Token successfully created.

- TokenResponse
  - `access_token` string, required: The JWT Bearer token to include in the Authorization header of protected requests.
  - `token_type` 'Bearer', required: Token type. Always `Bearer`.
  - `expires_in` integer, required: Token lifetime in seconds.

## Other responses

- `400`: Bad Request. Possible causes: 1. Missing or invalid `grant_type` (must be `client_credentials`). 2. Malformed form data.
- `401`: Unauthorized. Invalid `client_id` or `client_secret`.
- `500`: Internal Server Error.

---

[API](https://skmtc.dev/wellhub/apis/integrations-api.md) - [All operations](https://skmtc.dev/wellhub/apis/integrations-api/llms.txt) - [OpenAPI document](https://skmtc.dev/wellhub/apis/integrations-api/revisions/3e6a46a18a2e?raw)
