Skip to main content
POST
/
api-keys
curl -X POST https://app.trypost.it/api/api-keys \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CI/CD Pipeline",
    "expires_at": "2025-12-31"
  }'
{
  "token": {
    "id": "a7b8c9d0-e1f2-3a4b-5c6d-7e8f9a0b1c2d",
    "name": "CI/CD Pipeline",
    "last_used_at": null,
    "expires_at": "2025-12-31T00:00:00+00:00",
    "created_at": "2025-01-14T12:00:00+00:00"
  },
  "plain_token": "9f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a..."
}

Documentation Index

Fetch the complete documentation index at: https://docs.trypost.it/llms.txt

Use this file to discover all available pages before exploring further.

Request

name
string
required
The API key name. Maximum 255 characters.
expires_at
string
Optional expiration. ISO 8601 datetime, must be in the future. Omit for a non-expiring key.

Response

Returns 201 with the new key plus the plain token. The plain token is shown only here — store it immediately.
token
object
Same shape as one entry in GET /api-keysid, name, last_used_at, expires_at, created_at (all timestamps ISO 8601).
plain_token
string
The opaque bearer token to send in Authorization: Bearer …. Never returned again.
Copy the plain_token immediately after creation. TryPost stores a hash of your API key, not the key itself. If you lose it, you’ll need to create a new one.
curl -X POST https://app.trypost.it/api/api-keys \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CI/CD Pipeline",
    "expires_at": "2025-12-31"
  }'
{
  "token": {
    "id": "a7b8c9d0-e1f2-3a4b-5c6d-7e8f9a0b1c2d",
    "name": "CI/CD Pipeline",
    "last_used_at": null,
    "expires_at": "2025-12-31T00:00:00+00:00",
    "created_at": "2025-01-14T12:00:00+00:00"
  },
  "plain_token": "9f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a..."
}