ClocknextHelp
DocumentationAPI ReferenceMCP Tools
Dashboard

Get started

OverviewQuickstart

Good to know

Response formatHandling errorsPaginating resultsSending data reliablyYour own customer idsWebhooks

API reference

Record credit POSTRecord outcome POSTComplete outcome POSTRecord wallet POSTRecord unit POSTComplete composite POST
List customers GETCreate a customer POSTGet a customer GETUpdate a customer PATCHDelete a customer DELETEGet a customer's balances GETGet a customer's wallet ledger GETSet a customer's low-balance alert PUTGet a customer's current plan GETChange a recurring grant PUTList Customer Usage Log GETLook Up Usage Logs by ID GET
Manage a customer's credit balance POSTManage a customer's outcome balance POSTManage a customer's unit balance POSTManage a customer's composite balance POSTManage a customer's wallet balance POST
List a customer's members GETAdd a member POSTUpdate a member PATCHRemove a member DELETE
PlansCreditsOutcomesUnitsComposites
List taxes GETCreate a tax POSTGet a tax GETUpdate a tax PATCH
List purchases GETCreate a purchase POSTGet a purchase GETUpdate a purchase's auto-payment setting PATCHCancel a purchase POST
List invoices GETGet an invoice GETMint a hosted pay link GET
List payments GETGet a payment GET
wallet.balance.update POSTwallet.balance.drop POST
Mint a customer-portal access token POST
Signals

Complete composite

Closes and bills ONE occurrence of a composite (a distinct tag value). Required even for outcome-tagged occurrences.

Gated on every credit/outcome/unit the composite is restricted to having reported under the same value. Calling early isn't an error: it answers 422 but parks and completes itself once the rest lands.

POST
/signal/composite/complete

Authorization

apiKey
AuthorizationBearer <token>

Organisation-scoped key from Settings → API Keys.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

composite is REQUIRED and is the whole point of the request — there is nothing to complete without it.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/signal/composite/complete" \  -H "Content-Type: application/json" \  -d '{    "customerId": "cus_abc123",    "composite": {      "voice_ai": "call_5f3a"    }  }'
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "OK"  },  "result": {    "status": "COMPLETED",    "composite": {      "id": "pm_3d9x1c",      "name": "Voice AI call",      "refId": "voice_ai"    },    "value": "call_5f3a",    "rawId": "raw_4k8w2r"  }}
{  "statusCode": 202,  "statusDetail": {    "status": "SUCCESS",    "message": "Signal accepted for processing."  },  "result": {    "queued": true,    "messageId": "msg_2f4a1b8c",    "rawId": "raw_4k8w2r"  }}
{  "statusCode": 400,  "statusDetail": {    "status": "ERROR",    "message": "Request body must be valid JSON."  },  "result": {}}
{  "statusCode": 401,  "statusDetail": {    "status": "ERROR",    "message": "Invalid API key."  },  "result": {}}
{  "statusCode": 404,  "statusDetail": {    "status": "ERROR",    "message": "No customer with id \"cus_abc123\"."  },  "result": {}}
{  "statusCode": 409,  "statusDetail": {    "status": "ERROR",    "message": "Customer \"cus_abc123\" is archived."  },  "result": {}}
{  "statusCode": 422,  "statusDetail": {    "status": "ERROR",    "message": "\"Voice AI call\" is not ready to complete yet — still waiting on a signal for \"Transcription\" unit. Send it first, then complete again."  },  "result": {}}
{  "statusCode": 500,  "statusDetail": {    "status": "ERROR",    "message": "Could not complete the request."  },  "result": {}}

Record unit POST

Records `quantity` (default 1) discrete units against `agentKey`.

List customers GET

Cursor-paginated list of the organisation's customers.

customerId?string

Customer id. Required unless externalId is sent.

Length1 <= length
externalId?string

Your own id for the customer, instead of customerId. Signals are processed asynchronously, so one matching no customer is accepted and then left Pending with a 404 reason — create the customer and retry it.

Match^[A-Za-z0-9-]{1,32}$
Length1 <= length <= 32
member?string

Member email this signal is attributed to; must belong to the customer. Matched case-insensitively.

idempotencyKey?string

Dedupes retries — a repeat request carrying the same key returns the original signal's result instead of recording a duplicate. Scoped per organisation AND per meter, so one key reused across /signal/credit and /signal/wallet is two independent keys, not a collision. See Async, flushing & reliability.

Length1 <= length <= 255
composite*

Composite tag. The property NAME is the composite's refId and the value is your own correlation id — { "voice_ai": "call_5f3a" } groups this signal into the voice_ai occurrence for call_5f3a.

Because the tag is nested under composite, a composite's refId can be any name — even one like model or status — without clashing with a real field of the signal.

A tag naming no live composite is ignored and never fails the signal — the signal carries money, the tag only decides which row of a report it lands in.

custom?

Free-form metadata, stored as sent on the occurrence this ping closes and returned as custom on its composite row in GET /signal/usage-log.