---
title: "Create a Personal Access Token (PAT)"
method: POST
path: "/pat"
tags: ["security"]
---

# Create a Personal Access Token (PAT)

`POST /pat`

Generate a new Personal Access Token for programmatic API access. PATs are long-lived tokens that can be used instead of regular authentication for automated systems. Requires elevated permissions.

## Request body

- CreatePATRequest
  - `expiresAt` string, date-time, required — Expiration date of the PAT
  - `metadata` object

## Response `200`

Successfully created a Personal Access Token

- CreatePATResponse
  - `id` string, required — ID of the PAT
  - `personalAccessToken` string, required — PAT

## Other responses

- `default` — An error occurred while processing the request

---

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