Skip to main content
POST
/
v1
/
orgs
/
{org_id}
/
platform-tokens
Create Platform Token
curl --request POST \
  --url https://api.letpiper.com/v1/orgs/{org_id}/platform-tokens/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "permissions": [
    "<string>"
  ],
  "expires_at": "2023-11-07T05:31:56Z"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "permissions": [
    "<string>"
  ],
  "expires_at": "2023-11-07T05:31:56Z",
  "last_used_at": "2023-11-07T05:31:56Z",
  "is_active": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "token_preview": "<string>",
  "token": "<string>"
}

Authorizations

Authorization
string
header
required

Platform token (starts with pat_)

Path Parameters

org_id
string<uuid>
required

Body

application/json

Schema for creating a platform token.

name
string
required

Human-readable token name

Required string length: 1 - 255
permissions
string[]
required

Permissions granted to this token. Use presets like 'admin', 'editor', 'viewer' or specific permissions.

Minimum array length: 1
expires_at
string<date-time> | null

Token expiration datetime (null for no expiration)

Response

Successful Response

Schema returned only on token creation, includes the full token once.

id
string<uuid>
required
name
string
required
organization_id
string<uuid>
required
permissions
string[]
required
expires_at
string<date-time> | null
required
last_used_at
string<date-time> | null
required
is_active
boolean
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
token_preview
string
required

Masked preview of the token (e.g., 'pat_abc...xyz')

token
string
required

Full token string - save this, it won't be shown again