Skip to main content
POST
/
api
/
v1
/
api-keys
Create Api Key
curl --request POST \
  --url https://api.copass.id/api/v1/api-keys \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "expires_in_days": 1825
}
'
{
  "id": "<string>",
  "name": "<string>",
  "key": "<string>",
  "key_prefix": "<string>",
  "created_at": "<string>",
  "expires_at": "<string>",
  "jwt_expires_at": "<string>",
  "warning": "Store this key securely — it will not be shown again."
}

Body

application/json
name
string
required

Human-readable key name (stored as label).

Required string length: 1 - 128
expires_in_days
integer | null

Key lifetime in days (default: no expiry).

Required range: 1 <= x <= 3650

Response

Successful Response

id
string
required
name
string
required
key
string
required

Full API key — shown only once.

key_prefix
string
required
created_at
string
required
expires_at
string | null
jwt_expires_at
string | null
warning
string
default:Store this key securely — it will not be shown again.