---
title: "Generate a token"
method: POST
path: "/api/projects/{projectId}/security/tokens"
tags: ["Security"]
---

# Generate a token

`POST /api/projects/{projectId}/security/tokens`

Generates a new access token for the specified project.

## Path parameters

- `projectId` string, uuid, required

## Request body

- object
  - `name` string, required — Name to identify the access token

## Response `200`

The newly created project access token

- object — The newly created project access token
  - `id` string, uuid, required — Unique identifier of the project access token
  - `name` string, required — Name of the access token
  - `token` string, required — The access token value
  - `projectId` string, uuid, required — ID of the project this token belongs to
  - `createdBy` object, nullable — User who created the token
    - `id` string, uuid, required — Unique identifier of the user
    - `email` string, email, required — Email address of the user
    - `firstName` string, nullable, required — First name of the user
    - `lastName` string, nullable, required — Last name of the user
  - `createdAt` string, required — Timestamp when the token was created

---

[API](https://skmtc.dev/gorules/apis/gorules-agent-api.md) · [All operations](https://skmtc.dev/gorules/apis/gorules-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gorules/gorules-agent-api/revisions/52c0773fcd80/schema)
