---
title: "Create a new token owned by the logged in user."
method: POST
path: "/users/tokens"
tags: ["Tokens"]
---

# Create a new token owned by the logged in user.

`POST /users/tokens`

A successful response from this resource will contain json-encoded details of API token.
This is the only time the customer will be able to view the secret key associated with the token.

## Request body

- CreateTokenRequest
  - `alias` string
  - `expires_at` string, required

## Response `200`

- TokensPostResponse
  - `token` GeneratedToken, required — These are the fields returned from a PUT request.
    - `access_key` string, required
    - `alias` string
    - `created_at` string, required
    - `expires_at` string, required
    - `secret_key` string, required

## Other responses

- `401` — Error Authentication Failed
- `500` — Error Internal Server

---

[API](https://skmtc.net/crusoecloud/apis/crusoe-cloud-api-gateway.md) · [All operations](https://skmtc.net/crusoecloud/apis/crusoe-cloud-api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crusoecloud/crusoe-cloud-api-gateway/revisions/a3fd2dedc72b/schema)
