comecerodocs

Create a usage key

POST
/usage/keys

Makes a key for sending events to the usage meter (POST https://usage.comecero.com/v1/events). A live token makes apk_live_ keys, a test token apk_test_ keys. The key is shown only in this answer. See Send Usage. Secret and trusted tokens may call it; a limited token may not (403).

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Request Body

An optional name.

application/json
  1. body
name?string

Up to 100 characters.

Response Body

Success.

application/json
  1. response
object?string

Always usage_key.

usage_key_id?string

uk_ plus 32 characters.

name?string

Your label.

key_prefix?string

The first characters of the key, to tell keys apart.

status?string

active or revoked.

Value in"active""revoked"
active_in_apollo?boolean

Whether the usage meter takes events with this key now. For a new key it is false until the key reaches the meter (a few minutes at most). For a revoked key it stays true until the revoke reaches the meter.

test?boolean

true for apk_test_ keys.

date_created?string

When it was created.

Formatdate-time
date_revoked?|

When it was revoked.

Formatdate-time
key?|

The key itself: apk_live_ or apk_test_ plus 40 letters and digits. Only in the create answer; null everywhere else. Store it at once.

Example Request
curl -X POST 'https://api.comecero.com/api/v1/usage/keys' \  -H 'Content-Type: application/json' \  -d '{  "name": "Production server"}'
Example Response
{  "object": "usage_key",  "usage_key_id": "uk_5d1c0e7a9b2f4e6c8a0d3b5f7e9c1a2b",  "name": "Production server",  "key_prefix": "apk_live_8Hq2",  "status": "active",  "active_in_apollo": true,  "test": false,  "date_created": "2026-11-01T09:30:00Z",  "date_revoked": null,  "key": "apk_live_..."}