# Issue Token

`POST /oauth2/token`

Issue OAuth 2.0 token

## Body Parameters

```typescript
interface BodyParameters {
  /** Grant type: authorization_code, client_credentials, or refresh_token */
  grant_type: string;
  /** OAuth 2.0 client identifier */
  client_id?: string;
  /** OAuth 2.0 client secret */
  client_secret?: string;
  /** Authorization code (required for authorization_code grant) */
  code?: string;
  /** Redirect URI */
  redirect_uri?: string;
  /** PKCE code verifier */
  code_verifier?: string;
  /** Refresh token (required for refresh_token grant) */
  refresh_token?: string;
  /** Requested OAuth 2.0 scopes (required for client_credentials grant) */
  scope?: string;
}
```

## Response Body

```typescript
interface ResponseBody {
  /** The access token issued by the authorization server */
  access_token?: string;
  /** The type of the token issued */
  token_type?: string;
  /** The lifetime in seconds of the access token */
  expires_in?: number;
  /** The refresh token, which can be used to obtain new access tokens */
  refresh_token?: string;
  /** The lifetime in seconds of the refresh token */
  refresh_token_expires_in?: number;
}
```

## Response Example

**Status:** `200 OK`

```json
{
  "access_token": "e4d6521d0cbad72e1e7f2d0ba3ef74b6b2e7a5c8",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c",
  "refresh_token_expires_in": 15811201
}
```

---
Original source: https://buddy.works/docs/api/oauth/token