Skip to Content
dropshelf
REST API

Create a personal access token

Returns the plaintext once. expiresIn defaults to the instance's tokens.defaultTTL and is silently capped at tokens.maxTTL; read expiresAt in the response. Requires a session: a bearer token cannot mint tokens.

POST
/api/v1/tokens

Returns the plaintext once. expiresIn defaults to the instance's tokens.defaultTTL and is silently capped at tokens.maxTTL; read expiresAt in the response. Requires a session: a bearer token cannot mint tokens.

Authorization

session
cookie__Host-dropshelf_session<token>

The dashboard session cookie. Its name has no __Host- prefix on an instance served over plain http, because browsers refuse prefixed cookies there. Unsafe methods must also send an Origin header equal to the control plane's origin; a request that sends no Origin at all passes instead on Sec-Fetch-Site: same-origin. POST, PUT and PATCH must declare Content-Type: application/json, application/zip, application/x-ndjson, application/octet-stream (one file of a plan) or, for an avatar, a PNG, JPEG or WebP image, on top of that, whether or not they carry a body; DELETE is held to the Origin rule alone.

Request Body

Name and lifetime.

application/json
  1. body
expiresIn?string

A duration such as 90d or 12h. Defaults to tokens.defaultTTL, capped at tokens.maxTTL.

name*string

1 to 64 characters.

Response Body

The new token, plaintext included.

application/json
  1. response
createdAt*string

For a sign-in from an MCP client, when the member approved it.

Formatdate-time
expiresAt*string

For a sign-in from an MCP client, the current access token's expiry, which the client renews by itself.

Formatdate-time
id*string

ULID.

lastUsedAt*|

Updated at most once a minute. For a sign-in from an MCP client or the CLI, its latest use across refreshes.

Formatdate-time
name*string

The label given at creation.

oauth?
prefix*string

The first 8 characters after odp_, for recognising the token.

token*string

The plaintext. Shown once; store it now.

Example Request
curl -X POST 'https://drop.example.com/api/v1/tokens' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
Example Response
{  "createdAt": "2019-08-24T14:15:22Z",  "expiresAt": "2019-08-24T14:15:22Z",  "id": "string",  "lastUsedAt": "2019-08-24T14:15:22Z",  "name": "string",  "oauth": {    "client": "string",    "renewsUntil": "2019-08-24T14:15:22Z"  },  "prefix": "string",  "token": "string"}

Generated from dropshelf core at 6a548b2, 26 Nov 2026.