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

# Create OAuth token

`POST /token`

Creates OAuth token using various grant types

## Request body

- CreateOAuthToken
  - `client_id` string, required
  - `client_secret` string, required
  - `grant_type` 'authorization_code' | 'refresh_token' | 'password' | 'client_credentials', required
  - `code` string — Required if grant_type is 'authorization_code'
  - `refresh_token` string — Required if grant_type is 'refresh_token'
  - `username` string — Required if grant_type is 'password'
  - `password` string — Required if grant_type is 'password'

## Response `200`

OK. Token created successfully <a href='http://tools.ietf.org/html/rfc6749#section-5.1' target='_blank'>RFC 6749 Section 5.1</a>.

- OAuthToken
  - `access_token` string, required — The OAuth access token
  - `token` string — The OAuth access token
  - `token_type` string, required — The type of token issued
  - `expires_in` integer, required — Token expiration time in seconds
  - `refresh_token` string — The refresh token (only provided for certain grant types)
  - `scope` string — The scope of the access token

## Other responses

- `400` — Bad Request <a href='http://tools.ietf.org/html/rfc6749#section-5.2' target='_blank'>RFC 6749 Section 5.2</a>.

---

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