entities

Create API key for entity

  Generate a new API key for the entity. API keys are used for programmatic
  access to the auction system.
post/api/v1/entities/{id}/api-keys

Path parameters

idstring required

Entity CUID

Request body

namestring required

Human-readable name for the API key

descriptionstring

Description of the API key usage

scopesstring[] required

Scopes/permissions for the API key

expiresAtstring date-time nullable

Expiration date for the API key (optional, null for no expiration)

Example request

{
  "name": "Production Bidding Bot",
  "description": "API key for automated bidding bot in production environment",
  "scopes": [
    "read",
    "bid:submit",
    "bid:cancel"
  ],
  "expiresAt": "2024-12-31T23:59:59.000Z"
}

Response

API key created successfully

idstring required

Unique API key identifier

entityIdstring required

Entity ID that owns this API key

namestring required

Human-readable name for the API key

descriptionstring

Description of the API key usage

keyPrefixstring required

API key prefix (for identification)

keystring

Full API key (only returned on creation)

scopesstring[] required

Scopes/permissions for the API key

status'active' | 'revoked' | 'expired' required

API key status

createdAtstring date-time required

API key creation timestamp

expiresAtstring date-time nullable

API key expiration timestamp

lastUsedAtstring date-time

Last usage timestamp

totalRequestsnumber required

Total number of requests made with this key

currentWindowRequestsnumber required

Number of requests in the current rate limit window

rateLimitnumber required

Rate limit for this API key (requests per hour)

isActiveboolean required

Whether API key is currently active and valid

hasExpiredboolean required

Whether API key has expired

isNearRateLimitboolean required

Whether API key is approaching rate limit

daysUntilExpirationnumber nullable required

Days until expiration (null if no expiration)

Example response

{
  "id": "ak_1234567890abcdef",
  "entityId": "ent_1234567890abcdef",
  "name": "Production Bidding Bot",
  "description": "API key for automated bidding bot in production environment",
  "keyPrefix": "xga_prod_1234...",
  "key": "xga_prod_1234567890abcdef1234567890abcdef12345678",
  "scopes": [
    "read",
    "bid:submit",
    "bid:cancel"
  ],
  "status": "active",
  "createdAt": "2024-01-01T00:00:00.000Z",
  "expiresAt": "2024-12-31T23:59:59.000Z",
  "lastUsedAt": "2024-01-01T12:30:00.000Z",
  "totalRequests": 15420,
  "currentWindowRequests": 42,
  "rateLimit": 1000,
  "isActive": true,
  "daysUntilExpiration": 45
}

Changes