Skip to main content
POST
/
api
/
v1
/
api-keys
Create API key
curl --request POST \
  --url https://api.logfleet.io/api/v1/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Production Edge Agents",
  "permissions": [
    "edge:register"
  ],
  "expires_at": "2023-11-07T05:31:56Z"
}
'
{
  "api_key": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "key_prefix": "<string>",
    "permissions": [
      "<string>"
    ],
    "last_used_at": "2023-11-07T05:31:56Z",
    "expires_at": "2023-11-07T05:31:56Z",
    "revoked_at": "2023-11-07T05:31:56Z",
    "created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created_at": "2023-11-07T05:31:56Z"
  },
  "raw_key": "<string>"
}
The raw_key in the response is only shown once at creation time. Store it securely—it cannot be retrieved later.

Authorizations

Authorization
string
header
required

JWT token obtained from /auth/login

Body

application/json
name
string
required
Example:

"Production Edge Agents"

permissions
enum<string>[]
required
Minimum array length: 1
Available options:
edge:register,
edge:heartbeat,
edge:metrics,
edge:stream
expires_at
string<date-time>

Response

API key created

api_key
object
raw_key
string

The actual API key. Only shown once!