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

# Create an access token

`POST /oauth/token`

Obtain an access token for a service account using the OAuth2 client credentials flow. An access token is needed to authorize requests to the Pinecone Admin API.
The host domain for OAuth endpoints is `login.pinecone.io`.

## Headers

- `X-Pinecone-Api-Version` string, required

## Request body

- OauthTokenRequest — A request to obtain an access token.
  - `client_id` string, required — The service account's client ID.
  - `client_secret` string, required — The service account's client secret.
  - `grant_type` string, required — The type of grant to use.
  - `audience` string, required — The audience for the token.

## Response `200`

A response that contains the access token.

- OauthTokenResponse — A response that contains the access token.
  - `access_token` string, required — The access token.
  - `token_type` string, required — The type of token. Possible values: `Bearer`.
  - `expires_in` integer, required — The number of seconds until the token expires.

## Other responses

- `400` — Invalid request.
- `401` — Unauthorized.
- `403` — Forbidden.
- `429` — Too many requests.
- `500` — Internal server error.
- `501` — Not implemented.
- `503` — Service unavailable.

---

[API](https://skmtc.net/pinecone/apis/pinecone-api.md) · [All operations](https://skmtc.net/pinecone/apis/pinecone-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pinecone/pinecone-api/revisions/35876583485d/schema)
