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

# Create access token

`POST /tokens`

Create a new API access token by providing a token in header.

## Request body

- object — Name of token.
  - `name` string, required — A name for your new token. Token name must be unique for a user. Best practice is to select a name which reminds you of how you intend to use the token, e.g. "PushSamplesFromSystemXyz".

## Response `201`

Token created.

- TokenResponse — API access token if authentication success.
  - `Success` boolean
  - `id` string
  - `isDisabled` string
  - `name` string — Name of token.
  - `token` string — API token.
  - `createdBy` string — TODO
  - `apiLinks` HATEOAS[] — Hypertext As The Engine Of Application State.
    - `href` string, required — URL of the related HATEOAS link you can use for subsequent calls.
    - `rel` string, required — Link relation that describes how this link relates to the previous call.
    - `method` string, required — The HTTP method required for the related call.

## Other responses

- `401` — Caller did not supply credentials or did not provide the correct credentials. If you are using an API key, it may be invalid or your Authorization header may be malformed.
- `403` — Caller is not authorized to create token. While your authentication is valid, the authenticated user or token does not have permission to perform this action.
- `default` — An unexpected error occurred. Please review the response for error details.

---

[API](https://skmtc.net/salesforce/apis/refocus-api.md) · [All operations](https://skmtc.net/salesforce/apis/refocus-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/salesforce/refocus-api/versions/42c2153b047e/schema)
