keys

Create a key; the full key is returned once

Creates an API key for the signed-in site user and returns it once, in key; only its hash is stored, so it cannot be shown again. name is optional and defaults to "default". Session cookie auth, not an API key.

post/keys

Request

  • Base URL: https://api.tradingpal.io/api/v1
  • URL: https://api.tradingpal.io/api/v1/keys
  • Auth: API key in cookie tp_sessionid

Request body

namestring

A label for the key, for example the agent or script that will use it, at most 64 characters. Defaults to "default".

Example request

{
  "name": "my-agent"
}

Response

Created; key holds the full secret

idinteger

Numeric id of the key; the key_id of DELETE /keys/{key_id}.

prefixstring

The first 16 characters of the key (tp_live_ plus eight), enough to tell keys apart. The rest is never shown again.

namestring

The label given at creation (default "default"), at most 64 characters.

created_atstring date-time

When the key was created, ISO 8601 date-time.

last_used_atstring date-time nullable

When the key last authenticated a request, refreshed at most every five minutes. Null until first use.

keystring

The full secret key, present only in the POST /keys response. Store it: only its hash is kept, so it cannot be shown again.

Example response

{
  "id": 12,
  "prefix": "tp_live_a1b2c3d4",
  "name": "my-agent",
  "created_at": "2026-09-01T14:03:11+00:00",
  "last_used_at": "2026-09-25T09:12:40+00:00",
  "key": "tp_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}

Changes

No recorded changes to this operation across all 1 revision of this API.