---
title: "Generate a token for usage with authenticating via OAuth2 in subsequent API calls."
method: POST
path: "/token"
tags: ["authentication"]
---

# Generate a token for usage with authenticating via OAuth2 in subsequent API calls.

`POST /token`

## Request

- Base URL: `https://{tenant_name}.benchling.com/api/v2`
- URL: `https://{tenant_name}.benchling.com/api/v2/token`
- Auth: HTTP bearer

Generate a token

## Request body

- TokenCreate
  - `client_id` string: ID of client to request token for. Leave off if client ID and secret are being supplied through Authorization header.
  - `client_secret` string: Leave off if client ID and secret are being supplied through Authorization header.
  - `grant_type` 'client_credentials', required

## Response `200`

Generated token

- TokenResponse
  - `access_token` string
  - `expires_in` integer: Number of seconds that token is valid for
  - `token_type` 'Bearer'

## Other responses

- `400`: Bad Request
- `401`: Unauthorized

---

[API](https://skmtc.dev/benchling/apis/benchling-api-2.md) - [All operations](https://skmtc.dev/benchling/apis/benchling-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/benchling/apis/benchling-api-2/revisions/01d2fa8523cd?raw)
