---
title: "Mint an access token (secret)"
method: POST
path: "/api/v1/integrations/{integrationId}/token"
tags: ["Integrations"]
---

# Mint an access token (secret)

`POST /api/v1/integrations/{integrationId}/token`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/integrations/{integrationId}/token`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Mints a fresh, short-lived OAuth access token for a Gmail or Outlook integration using its stored refresh token, and returns it with its expiry and scopes. The token grants access to the connected mailbox; treat it as a secret. Returns 409 connection_unusable if the grant was revoked at the provider, and 503 provider_not_configured if the integration's provider is not configured in this environment.

## Path parameters

- `integrationId` string, required

## Response `200`

A freshly-minted access token. Secret-bearing.

- object
  - `accessToken` string, required
  - `tokenType` 'Bearer', required
  - `expiresAt` string, nullable, required
  - `scopes` string[], required

## Other responses

- `400`: The request was malformed or failed validation.
- `401`: Authentication is missing or invalid.
- `404`: The resource was not found.
- `409`: Response.
- `429`: Too many requests; retry after the indicated delay.
- `503`: Response.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
