---
title: "Generate OAuth 2.0 Token"
method: POST
path: "/v1/oauth/token"
tags: ["OAuth"]
---

# Generate OAuth 2.0 Token

`POST /v1/oauth/token`

Generate an OAuth 2.0 token for an API client. The token can be used to authorize access to the Voucherify API. The token inherits the permissions and IP whitelists of the API key that is used to generate the OAuth token. You can define the scope that limits its usage. You can generate up to 1000 OAuth tokens per project. The token expires in 900 seconds (15 minutes).

If the API key that is used to generate the OAuth token is deleted or blocked, you cannot generate new OAuth tokens and the existing ones will stop working within one minute.

If the API key used to generate an OAuth token is regenerated, the OAuth token can still be used.

>🚧 Format of scope values
>
>Separate the values of the `scope` property with spaces.

## Response `200`

Returns details about the token to be used and its expiration times.

- OAuthTokenGenerateResponseBody — Details about the OAuth token.
  - `access_token` string — The access token used to authorize access to the Voucherify API.
  - `client_id` string — Unique client identifier, assigned by Voucherify, for OAuth.
  - `expires_at` integer — Timestamp in seconds in the Unix format indicating when the token expires.
  - `expires_in` integer — Number of seconds left until the token expires.
  - `scope` string — Defines the scope of possible actions that can be done with the OAuth token. The `api` scope allows using the server-side API. The `client_api` scope allows using the whole client-side API. Possible values: `api`, `assets`, `async-actions`, `campaigns`, `categories`, `client_api`, `client_consents`, `client_customers`, `client_events`, `client_promotions`, `client_publish`, `client_qualifications`, `client_redeem`, `client_redemptions`, `client_validate`, `client_validations`, `client_vouchers`, `consents`, `customers`, `events`, `exports`, `locations`, `loyalties`, `metadata-schemas`, `orders`, `product-collections`, `products`, `promotions`, `publications`, `qualifications`, `redemptions`, `referrals`, `rewards`, `segments`, `skus`, `task-results`, `templates`, `trash-bin`, `validation-rules-assignments`, `validation-rules`, `validations`, `vouchers`.
  - `token_type` 'Bearer' — Type of the token. Use the value as the header prefix for authorization.

## Other responses

- `400` — Returns an error if an invalid request body is provided.

---

[API](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions.md) · [All operations](https://skmtc.net/voucherifyio/apis/voucherify-api-async-actions/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voucherifyio/voucherify-api-async-actions/revisions/4982266e0494/schema)
