---
title: "Create server token"
method: POST
path: "/servers/{serverID}/tokens"
tags: ["Tokens"]
---

# Create server token

`POST /servers/{serverID}/tokens`

Creates a new agent token for a server. The token is only returned once.

## Path parameters

- `serverID` string, required

## Request body

- PkgServerCreateServerTokenRequest
  - `description` string
  - `expires_in` integer — Optional expiration in days

## Response `201`

Created

- PkgServerCreateServerTokenResponse
  - `created_at` string
  - `created_by_user_id` integer
  - `description` string
  - `expires_at` string
  - `id` integer
  - `installation_info` object
    - `example_cmd` string
    - `instructions` string
  - `is_active` boolean
  - `last_used_at` string
  - `server_id` string
  - `token` string — The actual token (only returned once)

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

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