Store hosts
| Endpoint | Description | Auth |
|---|---|---|
POST /v1/hosts | Register a host and request pairing | Secret key |
GET /v1/hosts/{id} | Retrieve a host | Secret key |
GET /v1/hosts | List hosts | Secret key |
POST /v1/hosts/{id}/pairings | Request pairing with a terminal | Secret key |
DELETE /v1/hosts/{id}/pairings/{terminal_id} | End a pairing | Secret key |
DELETE /v1/hosts/{id} | Revoke a host | Secret key |
POST /v1/hosts/{id}/sessions | Get a host token | Host private key signature |
GET /v1/hosts/self | Host reads its own pairings | Host token |
A store host is the register computer that drives a terminal in companion mode. It never holds a secret key. Authentication flow:
- The store host generates an Ed25519 key pair locally; the private key never leaves the machine.
- Your server calls Register a host with the public key and requests pairing with a terminal.
- A store manager checks the comparison code and confirms the pairing on the terminal.
- The store host signs a request to Get a host token and uses the 900-second token for subsequent calls.
Register a host
POST /v1/hostsRegisters the store host's public key and requests pairing with a terminal. Call it from your server.
| Item | Value |
|---|---|
| Auth | Secret key only |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Host name, 1–80 printable chars, shown on the terminal confirmation screen |
public_key | String | Yes | Ed25519 public key, Base64 of the SubjectPublicKeyInfo DER |
terminal_id | String | Yes | First terminal to pair; must be in companion mode |
Comparison code: while a pairing is pending, the response carries a six-digit comparison_code. The host computes and displays the same code; the manager checks they match and confirms on the terminal within 10 minutes. Computation:
SHA-256("kuvex-host-pair-v1\n{host_id}\n{terminal_id}\n{public_key}")
read the first 4 bytes as a big-endian unsigned integer, modulo 1,000,000, left-pad with zeros to 6 digitsResponse
| Status | Description |
|---|---|
201 Created | New host, or an existing host started a new pairing request |
200 OK | Public key already registered and its pairing with this terminal is active or pending; the existing host is returned unchanged |
{
"object": "host",
"id": "host_4kW9nT2qX7mV1pL5sR8b",
"host_id": "host_4kW9nT2qX7mV1pL5sR8b",
"name": "Register 1",
"livemode": true,
"created_at": "2026-11-30T16:02:00Z",
"revoked_at": null,
"pairings": [
{ "terminal_id": "KV100023", "status": "pending", "comparison_code": "482913", "expires_at": "2026-11-30T16:12:00Z" }
]
}Fields: Host fields.
Errors
| HTTP | Code | Description | Retriable |
|---|---|---|---|
| 400 | host_name_invalid | Name empty, too long, or contains unprintable characters | No |
| 400 | host_public_key_invalid | Invalid public key format | No |
| 404 | terminal_not_found | Terminal does not exist or belongs to another account | No |
| 409 | host_pairing_not_enabled | Terminal is not in companion mode. Test terminals can be switched with Switch run mode | No |
| 409 | host_key_conflict | Public key registered in another account or the other mode; generate a new key pair | No |
| 409 | terminal_livemode_mismatch | Key and terminal are in different modes | No |
Retrieve a host
GET /v1/hosts/{id}Returns the host with all its pairings. After registering, poll until the pairing becomes active, rejected or expired.
| Item | Value |
|---|---|
| Auth | Secret key only |
List hosts
GET /v1/hostsReturns hosts of the current mode (test / live) in reverse creation order, with their pairings.
| Item | Value |
|---|---|
| Auth | Secret key only |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
terminal_id | String | No | Only hosts with a pairing record (any status) for this terminal |
limit | int | No | Number of results |
Request pairing with a terminal
POST /v1/hosts/{id}/pairingsRequests pairing of a registered host with another terminal, or re-requests a rejected, expired or revoked pairing. The manager must confirm on the terminal again.
| Item | Value |
|---|---|
| Auth | Secret key only |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
terminal_id | String | Yes | Terminal ID |
Response: 201 Created (new request) or 200 OK (already active / pending). Errors as in Register a host, plus 404 host_not_found.
End a pairing
DELETE /v1/hosts/{id}/pairings/{terminal_id}Ends the pairing between the host and one terminal; other pairings are unaffected. An already ended pairing is returned as is.
| Item | Value |
|---|---|
| Auth | Secret key only |
Errors
| HTTP | Code | Description | Retriable |
|---|---|---|---|
| 404 | host_not_found | Host does not exist | No |
| 404 | pairing_not_found | No pairing record between the host and the terminal | No |
Revoke a host
DELETE /v1/hosts/{id}Ends all pairings of the host; issued host tokens stop working immediately and return 401 host_revoked. Use when a store host is lost or replaced. Idempotent. To reuse the host, request pairing and have the manager confirm.
| Item | Value |
|---|---|
| Auth | Secret key only |
Response: 200 OK
{ "object": "host", "id": "host_4kW9nT2qX7mV1pL5sR8b", "revoked_at": "2026-11-30T20:15:00Z", "revoked_pairings": 1 }| Field | Type | Description |
|---|---|---|
revoked_pairings | int | Pairings ended by this call; 0 on a repeated call |
Get a host token
POST /v1/hosts/{id}/sessionsCalled by the store host to exchange a signature for a host token. No Authorization header.
| Item | Value |
|---|---|
| Auth | Kuvex-Host-Signature header: signature with the host private key |
| Rate limit | Per IP. Cache the token and renew only when it is about to expire |
Request headers
| Name | Required | Description |
|---|---|---|
Kuvex-Host-Signature | Yes | Base64 Ed25519 signature over the UTF-8 bytes of kuvex-host-session-v1\n{host_id}\n{timestamp_ms}\n{nonce} (three line feeds, no trailing newline) |
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
timestamp_ms | long | Yes | Host clock, Unix milliseconds; within 60 seconds of Kuvex time |
nonce | String | Yes | Random value, unique per request; accepted once |
Response: 201 Created
{
"object": "host_session",
"token": "kvs_...",
"expires_in": 900,
"host_id": "host_4kW9nT2qX7mV1pL5sR8b",
"livemode": true,
"terminal_ids": ["KV100023"]
}| Field | Type | Description |
|---|---|---|
token | String | Host token; keep in memory only |
expires_in | int | Lifetime in seconds |
terminal_ids | Array | Terminals with an active pairing |
An expired token returns 401 session_expired; sign a new request with a new nonce. A host token may call only endpoints whose Auth lists "host token", and only for paired terminals; anything else returns 403 scope_forbidden.
Errors
| HTTP | Code | Description | Retriable |
|---|---|---|---|
| 401 | host_signature_invalid | Bad signature, clock skew over 60 seconds, reused nonce, or unknown host | No |
| 401 | host_revoked | Host has no active pairing | No |
| 403 | host_not_paired | Pairing not yet confirmed | No |
Host reads its own pairings
GET /v1/hosts/selfReturns the calling host and its pairings, as in Retrieve a host. Read-only.
| Item | Value |
|---|---|
| Auth | Host token only |
Host fields
| Field | Type | Description |
|---|---|---|
id / host_id | String | Host ID, host_ prefix; identical values |
name | String | Host name |
livemode | boolean | Mode |
created_at | String | Registration time |
revoked_at | String | Time the whole host was revoked; null otherwise |
pairings | Array | One record per terminal, fields below |
pairings fields:
| Field | Type | Description |
|---|---|---|
terminal_id | String | Terminal ID |
status | String | pending (awaiting confirmation, 10 minutes), active, rejected (declined by the manager), expired (not confirmed in time), revoked |
comparison_code | String | Six-digit comparison code; only while pending |
expires_at | String | Confirmation deadline; only while pending |
paired_at | String | Pairing time |
last_used_at | String | Last call by this host for the terminal |
revoked_at | String | Revocation time |
revoked_reason | String | isv (merchant), kuvex, terminal_manager (ended on the terminal), terminal_reassigned (terminal ownership changed) |