---
title: "Create a new API token"
method: POST
path: "/me/api_tokens/"
tags: ["me"]
---

# Create a new API token

`POST /me/api_tokens/`

## Request

- Base URL: `https://dados.gov.pt/api/1`
- URL: `https://dados.gov.pt/api/1/me/api_tokens/`
- Auth: none declared

The plaintext token is returned only once.

## Headers

- `X-Fields` string, mask

## Request body

- ApiToken2028write29 (unresolved $ref)

## Response `201`

Success

- ApiTokenCreated
  - `created_at` string, date-time, required: Token creation date
  - `expires_at` string, date-time: When this token expires
  - `id` string, required
  - `kind` 'api_key': Token type
  - `last_used_at` string, date-time: Last time this token was used
  - `name` string: User-given label for this token
  - `revoked_at` string, date-time: When this token was revoked
  - `scopes` string[]: Token scopes
  - `token_prefix` string, required: First characters of the token for identification
  - `user_agents` string[]: User agents that have used this token
  - `token` string: The plaintext token (shown only once at creation)

## Changes

- **2026-09-11** `1175d034be00`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/dados/apis/udata-api/changes/me/api_tokens/post.md)

---

[API](https://skmtc.dev/dados/apis/udata-api.md) - [All operations](https://skmtc.dev/dados/apis/udata-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dados/apis/udata-api/revisions/77edaf8a00ea?raw)
