Docs/API reference/POST /api/v1/keys
POST/api/v1/keys
Programmatically create a new API key. The raw value is returned exactly once in the response — store it immediately.
Request
A management key is required (created from the dashboard with the keys:write scope). Pass a short human-readable name in the body.
HTTP
POST https://api.varmir.com/api/v1/keys
Authorization: Bearer <MANAGEMENT_KEY>
Content-Type: application/json
{ "name": "Production server" }Response
The raw_key field is the only place you can read the full token. Subsequent GETs only return the prefix.
{
"id": "key_8f3a2c",
"name": "Production server",
"prefix": "mstk_lfQZYRA",
"raw_key": "mstk_lfQZYRAkdXMZ_UyF-n--Tu7eFS6JuayD",
"created_at": "2026-06-12T14:00:00Z"
}