Skip to main content
POST
/
service-accounts
/
{org}
/
{name}
/
api-keys
Create an API key for a service account
curl --request POST \
  --url https://app.kosli.com/api/v2/service-accounts/{org}/{name}/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "description": "<string>",
  "expires_at": 123
}
'
{
  "id": "<string>",
  "key": "<string>",
  "description": "<string>",
  "created_at": 123,
  "expires_at": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

org
string
required
name
string
required

The name of the service account

Body

application/json
description
string
required

Description for the API key

Minimum string length: 1
expires_at
integer | null

Unix timestamp for key expiry. Use 0 or omit for no expiry. Must not be in the past.

Response

API key created successfully

id
string
required

Unique identifier for the API key

key
string
required

The API key value. This is only returned once at creation time.

description
string
required

Description of the API key

created_at
number
required

Unix timestamp when the key was created

expires_at
integer
required

Unix timestamp when the key expires. 0 means no expiry.

Last modified on April 20, 2026