---
title: "aid_customers_cid_tokens_post"
method: POST
path: "/accounts/{aid}/customers/users/{customer_id}/tokens"
tags: ["tokens"]
---

# aid_customers_cid_tokens_post

`POST /accounts/{aid}/customers/users/{customer_id}/tokens`

## Request

- Base URL: `https://api.dintero.com/v1`
- URL: `https://api.dintero.com/v1/accounts/{aid}/customers/users/{customer_id}/tokens`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/dintero/apis/account-management-api/docs/accounts/:aid/customers/users/:customer_id/tokens/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new customer token
scopes:
- admin:customers
- write:customers
- user:customers

## Path parameters

- `aid` string, ^[PT]{1}\d{8}$, required
- `customer_id` string, required

## Query parameters

- `delete_token_events` boolean

## Request body

- object
  - `token_id` string: The token id you have defined for the token. (must not have trailing or leading spaces)
  - `id` string, uuid: An UUID that uniquely identifies the resource
  - `created_at` string, date-time: The date-time when the resource was created
  - `created_by` string: The ID of the user/client created the resource
  - `updated_at` string, date-time: The date-time when the resource was last updated
  - `deleted_by` string: The ID of the user/client created the resource
  - `deleted_at` string, date-time
  - `type` string, required: identifies how or who is resposible for the token value
  - `value` string, required
  - `metadata` object: Additional metadata about the token or the entity the token was created from

## Response `201`

Customer token added

- CustomerToken
  - `id` string, uuid: An UUID that uniquely identifies the resource
  - `created_at` string, date-time: The date-time when the resource was created
  - `created_by` string: The ID of the user/client created the resource
  - `updated_at` string, date-time: The date-time when the resource was last updated
  - `deleted_by` string: The ID of the user/client created the resource
  - `deleted_at` string, date-time
  - `token_id` string: The token id you have defined for the token. (must not have trailing or leading spaces)
  - `type` string, required: identifies how or who is resposible for the token value
  - `value` string, required
  - `metadata` object: Additional metadata about the token or the entity the token was created from

## Other responses

- `400`: Bad / Invalid request
- `401`: Access forbidden, invalid JWT token was used
- `403`: Forbidden
- `404`: Resource was not found
- `500`: Unexpected Error

---

[API](https://skmtc.dev/dintero/apis/account-management-api.md) - [All operations](https://skmtc.dev/dintero/apis/account-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dintero/apis/account-management-api/revisions/9b83a4199008?raw)
