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

# Create OAuth2 access token

`POST /oauth/token`

## Request

- Base URL: `https://api.hoorayhr.io`
- URL: `https://api.hoorayhr.io/oauth/token`
- Auth: none required

POST request to create an access token. The access token can be used to authorize external requests.

## Query parameters

- `grant_type` string, required
- `code` string, required
- `redirect_uri` string, url, required
- `client_id` string, required
- `client_secret` string, required

## Request body

- object

## Response `200`

success

- object
  - `access_token` string: 512 bit hexadecimal access token that grants access to the API. **Store this token securely!**
  - `token_type` string: Indicates what kind of token is given. In this case, the access_token is a Bearer token. Meaning everyone who owns the token has access.

## Other responses

- `400`: Bad request

---

[API](https://skmtc.dev/hoorayhr/apis/hoorayhr-api-documentation.md) · [All operations](https://skmtc.dev/hoorayhr/apis/hoorayhr-api-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/hoorayhr/apis/hoorayhr-api-documentation/revisions/3adcd47cd827?raw)
