SET API · Request signing
Register the key's public key (request signing)
POST/v1/api_keys/{key}/signing_key
Registers one Ed25519 public key for an API key. From then on every write made with that key must be signed; reads stay unsigned.
Path parameters
keystringrequired- The API key's id,
key_+ 32 hex, fromGET /v1/api_keys. It must be a key of this business and mode, not revoked (404 api_key_unknown); it need not be the calling key.
Headers
Idempotency-Keystring- Any unique string, so a retry runs once. See Idempotency.
Body
publicKeystringrequired- The Ed25519 public key as a JWK's
x: base64url, 43 characters. Anything else answers400 public_key_invalid.
Notes
- Needs the
writescope. Any account type; no deployment switch. - Keep the private key yourself: SET holds only the public half.
- From then on every write with that key (any method but
GETandHEAD, on/v1and on/api/partner) carriesSET-TimestampandSET-Request-Signature, or answers401 request_signature_required. - The text to sign is four lines joined by
\nwith no trailing newline: theSET-Timestampvalue (unix seconds), the method in upper case, the path with its query, and the hex SHA-256 of the exact body bytes (of the empty string when there is no body). SET-Request-Signatureis the Ed25519 signature of that text, base64url.SET-Timestampmust be within 300 seconds of SET's clock (401 request_signature_expired); a signature that does not match answers401 request_signature_invalid.Idempotency-Keyworks as before on signed writes.signingKeyIdisrsk_and 12 hex characters derived from the public key; it is kept on each signed write's audit row.- One public key per key: a second registration answers
409 signing_key_exists; rotate the key to register another. Because the key now signs, that second request must itself be signed. - This example is a recorded run of SET's own code (wallet release
e9b03447) with a sandbox key; ids and times are that run's.
Errors
403 operator_cannot_issue400 public_key_invalid404 api_key_unknown409 signing_key_exists401 request_signature_required401 request_signature_invalid401 request_signature_expired