---
title: "Create OAuth2 token"
method: POST
path: "/auth/1/oauth2/token"
tags: ["platform", "account-management", "oauth"]
---

# Create OAuth2 token

`POST /auth/1/oauth2/token`

## Request

- Base URL: `https://api.infobip.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.infobip.com/auth/1/oauth2/token`
- Auth: none declared

Generate OAuth2 access token that can later on be used to authenticate other Infobip API calls.

## Request body `application/x-www-form-urlencoded`

- B1075107f5bba728f6a701eb8a72357dfcf0d9c4405dd06e85e56496153a8d2fTokenRequest: Request used for creating OAuth2 token.
  - `client_id` string, required: The username created when signing up with Infobip.
  - `client_secret` string, required: The password created when signing up with Infobip.
  - `grant_type` 'client_credentials' | 'authorization_code ', required: Grant type as defined by the OAuth framework.
  - `code` string: Authorization code received from the authorization server. This parameter is required only if the `grant_type` is set to `authorization_code`.

## Response `200`

successful response

- B1075107f5bba728f6a701eb8a72357dfcf0d9c4405dd06e85e56496153a8d2fTokenResponse: Successful response that indicates OAuth2 token was created.
  - `access_token` string: OAuth2 token.
  - `expires_in` integer: OAuth2 token expiration in seconds.
  - `token_type` string: OAuth2 token type.

## Other responses

- `400`: Bad Request
- `429`: Too Many Requests
- `500`: Internal Server Error
- `4XX`: Error responses
- `5XX`: Error responses

---

[API](https://skmtc.dev/infobip/apis/infobip-openapi-specification.md) - [All operations](https://skmtc.dev/infobip/apis/infobip-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/infobip/apis/infobip-openapi-specification/revisions/9dcbbaf902de?raw)
