{"openapi":"3.1.0","info":{"title":"API Clients — DayZero API","version":"1.0.0","description":"API Clients endpoints."},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/api-clients":{"get":{"tags":["api-clients"],"summary":"List API clients","description":"The caller's partner API clients, the token endpoint they use, the accepted assertion audiences, and whether mTLS is available.","operationId":"list_api_clients","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApiClientListResponse_"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"list_api_clients_api_v1_api_clients_get"},"post":{"tags":["api-clients"],"summary":"Create API client","description":"Register a partner API client with its public keys (JWK set). Requires the two-factor step-up; refused for API tokens.","operationId":"create_api_client","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiClientCreate"},"example":{"allowed_ips":["203.0.113.10"],"description":"Tie's payment job","jwks":{"keys":[{"alg":"ES256","crv":"P-256","kid":"tie-2026-10","kty":"EC","use":"sig","x":"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU","y":"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"}]},"name":"Tie production","rate_limit_per_minute":600,"require_mtls":false,"require_signed_requests":true,"scopes":["credit:payments"],"token_ttl_seconds":900}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApiClientResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded; back off and retry","content":{"application/json":{"example":{"error":"rate_limited","message":"Too many requests. Please slow down.","code":"GEN_005","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"create_api_client_api_v1_api_clients_post"}},"/api/v1/api-clients/{client_pk}":{"get":{"tags":["api-clients"],"summary":"Get API client","description":"One of the caller's API clients (404 `NOT_FOUND_109` otherwise).","operationId":"get_api_client","parameters":[{"name":"client_pk","in":"path","required":true,"schema":{"type":"string","title":"Client Pk"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApiClientResponse_"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"get_api_client_api_v1_api_clients__client_pk__get"},"patch":{"tags":["api-clients"],"summary":"Update API client","description":"Change an API client's settings. Changing anything but the name or description requires the two-factor step-up.","operationId":"update_api_client","parameters":[{"name":"client_pk","in":"path","required":true,"schema":{"type":"string","title":"Client Pk"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiClientUpdate"},"example":{"allowed_ips":["203.0.113.10"],"rate_limit_per_minute":1200}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApiClientResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"update_api_client_api_v1_api_clients__client_pk__patch"}},"/api/v1/api-clients/{client_pk}/jwks":{"put":{"tags":["api-clients"],"summary":"Replace API client JWK set","description":"Replace the public keys assertions are verified with (step-up).","operationId":"replace_api_client_jwks","parameters":[{"name":"client_pk","in":"path","required":true,"schema":{"type":"string","title":"Client Pk"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiClientJwksReplace"},"example":{"jwks":{"keys":[{"alg":"ES256","crv":"P-256","kid":"tie-2026-10","kty":"EC","use":"sig","x":"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU","y":"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"}]}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApiClientResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"replace_api_client_jwks_api_v1_api_clients__client_pk__jwks_put"}},"/api/v1/api-clients/{client_pk}/signing-keys":{"post":{"tags":["api-clients"],"summary":"Add API client signing key","description":"Add a request-signing key. For `hmac-sha256` DayZero generates the secret and returns it once; for `ed25519` send the public key. Step-up.","operationId":"add_api_client_signing_key","parameters":[{"name":"client_pk","in":"path","required":true,"schema":{"type":"string","title":"Client Pk"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiClientSigningKeyCreate"},"example":{"alg":"hmac-sha256","kid":"sk-2026-10"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApiClientSigningKeyCreateResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"add_api_client_signing_key_api_v1_api_clients__client_pk__signing_keys_post"}},"/api/v1/api-clients/{client_pk}/signing-keys/{kid}/retire":{"post":{"tags":["api-clients"],"summary":"Retire API client signing key","description":"Stop a signing key verifying requests, at once or after an overlap. A retirement can be brought forward, never pushed back.","operationId":"retire_api_client_signing_key","parameters":[{"name":"client_pk","in":"path","required":true,"schema":{"type":"string","title":"Client Pk"}},{"name":"kid","in":"path","required":true,"schema":{"type":"string","title":"Kid"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ApiClientSigningKeyRetire"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApiClientResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"retire_api_client_signing_key_api_v1_api_clients__client_pk__signing_keys__kid__retire_post"}},"/api/v1/api-clients/{client_pk}/disable":{"post":{"tags":["api-clients"],"summary":"Disable API client","description":"Disable the client and revoke every live access token issued to it, effective on the next request.","operationId":"disable_api_client","parameters":[{"name":"client_pk","in":"path","required":true,"schema":{"type":"string","title":"Client Pk"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApiClientDisableResponse_"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"disable_api_client_api_v1_api_clients__client_pk__disable_post"}},"/api/v1/api-clients/{client_pk}/enable":{"post":{"tags":["api-clients"],"summary":"Enable API client","description":"Re-enable a disabled API client (step-up).","operationId":"enable_api_client","parameters":[{"name":"client_pk","in":"path","required":true,"schema":{"type":"string","title":"Client Pk"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ApiClientResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"enable_api_client_api_v1_api_clients__client_pk__enable_post"}}},"components":{"schemas":{"ApiClientCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Client name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"scopes":{"items":{"type":"string","enum":["api","read_only","credit","credit:read","credit:payments"]},"type":"array","minItems":1,"title":"Scopes","description":"What every token issued to this client may do. Same vocabulary as API tokens: `credit`, `credit:read`, `credit:payments`, `read_only`, `api` (full access)."},"allowed_ips":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":32},{"type":"null"}],"title":"Allowed Ips","description":"IPv4/IPv6 addresses or CIDR ranges the client may request tokens from and use them from. Omit for any IP."},"rate_limit_per_minute":{"anyOf":[{"type":"integer","maximum":6000.0,"minimum":10.0},{"type":"null"}],"title":"Rate Limit Per Minute","description":"Requests per minute each issued token may make; omit for the platform default."},"token_ttl_seconds":{"type":"integer","maximum":3600.0,"minimum":60.0,"title":"Token Ttl Seconds","description":"Lifetime of each access token, in seconds (60-3600).","default":900},"jwks":{"additionalProperties":true,"type":"object","title":"Jwks","description":"JWK set (`{\"keys\": [...]}`) with the public keys the client signs its assertions with: RS256 (RSA >= 2048 bits), ES256 (P-256) or EdDSA (Ed25519). Public members only; every key needs a `kid` when there is more than one."},"require_mtls":{"type":"boolean","title":"Require Mtls","description":"Bind every token to the client certificate presented at the token endpoint (RFC 8705). Only available where the load balancer forwards client certificates (`mtls_available`).","default":false},"mtls_cert_thumbprints":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":20},{"type":"null"}],"title":"Mtls Cert Thumbprints","description":"Optional pin list of SHA-256 certificate thumbprints (hex or base64url). Empty: any certificate the load balancer accepted."},"require_signed_requests":{"type":"boolean","title":"Require Signed Requests","description":"Payment requests must also carry a signature from a signing key.","default":false}},"type":"object","required":["name","jwks"],"title":"ApiClientCreate","description":"Register a partner API client.","example":{"allowed_ips":["203.0.113.10"],"description":"Tie's payment job","jwks":{"keys":[{"alg":"ES256","crv":"P-256","kid":"tie-2026-10","kty":"EC","use":"sig","x":"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU","y":"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"}]},"name":"Tie production","rate_limit_per_minute":600,"require_mtls":false,"require_signed_requests":true,"scopes":["credit:payments"],"token_ttl_seconds":900},"examples":[{"allowed_ips":["203.0.113.10"],"description":"Tie's payment job","jwks":{"keys":[{"alg":"ES256","crv":"P-256","kid":"tie-2026-10","kty":"EC","use":"sig","x":"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU","y":"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"}]},"name":"Tie production","rate_limit_per_minute":600,"require_mtls":false,"require_signed_requests":true,"scopes":["credit:payments"],"token_ttl_seconds":900}]},"ApiClientDisableResponse":{"properties":{"client":{"$ref":"#/components/schemas/ApiClientResponse"},"revoked_token_count":{"type":"integer","title":"Revoked Token Count"}},"type":"object","required":["client","revoked_token_count"],"title":"ApiClientDisableResponse","description":"A disabled client and how many live tokens were revoked with it."},"ApiClientJwksReplace":{"properties":{"jwks":{"additionalProperties":true,"type":"object","title":"Jwks","description":"The complete new JWK set."}},"type":"object","required":["jwks"],"title":"ApiClientJwksReplace","description":"Replace a client's JWK set (for example to rotate its assertion key).","example":{"jwks":{"keys":[{"alg":"ES256","crv":"P-256","kid":"tie-2026-10","kty":"EC","use":"sig","x":"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU","y":"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"}]}},"examples":[{"jwks":{"keys":[{"alg":"ES256","crv":"P-256","kid":"tie-2026-10","kty":"EC","use":"sig","x":"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU","y":"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0"}]}}]},"ApiClientListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ApiClientResponse"},"type":"array","title":"Items"},"mtls_available":{"type":"boolean","title":"Mtls Available","description":"Whether require_mtls can be turned on in this environment"},"token_endpoint":{"type":"string","title":"Token Endpoint","description":"URL partners post assertions to"},"assertion_audiences":{"items":{"type":"string"},"type":"array","title":"Assertion Audiences","description":"Accepted values for the assertion's aud claim"},"max_clients":{"type":"integer","title":"Max Clients"}},"type":"object","required":["items","mtls_available","token_endpoint","assertion_audiences","max_clients"],"title":"ApiClientListResponse","description":"The caller's API clients plus what a partner needs to call the token endpoint."},"ApiClientResponse":{"properties":{"id":{"type":"string","title":"Id"},"client_id":{"type":"string","title":"Client Id","description":"Put this in iss and sub of assertions"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"type":"string","enum":["active","disabled"],"title":"Status"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"allowed_ips":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Ips"},"rate_limit_per_minute":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rate Limit Per Minute"},"token_ttl_seconds":{"type":"integer","title":"Token Ttl Seconds"},"jwks":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Jwks","description":"Registered public keys"},"key_ids":{"items":{"type":"string"},"type":"array","title":"Key Ids"},"require_mtls":{"type":"boolean","title":"Require Mtls"},"mtls_cert_thumbprints":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Mtls Cert Thumbprints"},"require_signed_requests":{"type":"boolean","title":"Require Signed Requests"},"signing_keys":{"items":{"$ref":"#/components/schemas/ApiClientSigningKeyResponse"},"type":"array","title":"Signing Keys"},"active_token_count":{"type":"integer","title":"Active Token Count","description":"Unexpired, unrevoked access tokens issued to the client","default":0},"last_token_issued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Token Issued At"},"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Disabled At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"mtls_available":{"type":"boolean","title":"Mtls Available","description":"Whether this environment forwards client certificates. When false, require_mtls cannot be turned on."}},"type":"object","required":["id","client_id","name","status","scopes","token_ttl_seconds","require_mtls","require_signed_requests","created_at","mtls_available"],"title":"ApiClientResponse","description":"An API client's settings. Contains no secrets."},"ApiClientSigningKeyCreate":{"properties":{"alg":{"type":"string","enum":["hmac-sha256","ed25519"],"title":"Alg","description":"`hmac-sha256`: DayZero generates a shared secret and returns it once. `ed25519`: send your public key in `public_key`."},"kid":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9._-]{1,64}$"},{"type":"null"}],"title":"Kid","description":"Key id sent as X-DZ-Key-Id; generated when omitted."},"public_key":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Public Key","description":"Ed25519 only: the raw 32-byte public key, base64 or base64url."}},"type":"object","required":["alg"],"title":"ApiClientSigningKeyCreate","description":"Add a request-signing key to a client.","example":{"alg":"hmac-sha256","kid":"sk-2026-10"},"examples":[{"alg":"hmac-sha256","kid":"sk-2026-10"}]},"ApiClientSigningKeyCreateResponse":{"properties":{"client":{"$ref":"#/components/schemas/ApiClientResponse"},"signing_key":{"$ref":"#/components/schemas/ApiClientSigningKeyResponse"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret","description":"HMAC keys only: the shared secret. Save it now; it is not shown again."}},"type":"object","required":["client","signing_key"],"title":"ApiClientSigningKeyCreateResponse","description":"A new signing key. ``secret`` is shown once and never again."},"ApiClientSigningKeyResponse":{"properties":{"kid":{"type":"string","title":"Kid"},"alg":{"type":"string","title":"Alg"},"public_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Key","description":"Ed25519 public key (base64); null for HMAC keys"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"retired_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retired At","description":"When the key stops verifying requests"},"status":{"type":"string","enum":["active","retiring","retired"],"title":"Status"}},"type":"object","required":["kid","alg","status"],"title":"ApiClientSigningKeyResponse","description":"A signing key as the owner sees it: never the secret."},"ApiClientSigningKeyRetire":{"properties":{"overlap_hours":{"type":"integer","maximum":168.0,"minimum":0.0,"title":"Overlap Hours","description":"How long the key keeps verifying requests so the partner can roll out its replacement. 0 retires it at once.","default":0}},"type":"object","title":"ApiClientSigningKeyRetire","description":"Retire a signing key, optionally after an overlap.","example":{"overlap_hours":24},"examples":[{"overlap_hours":24}]},"ApiClientUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"scopes":{"anyOf":[{"items":{"type":"string","enum":["api","read_only","credit","credit:read","credit:payments"]},"type":"array","minItems":1},{"type":"null"}],"title":"Scopes"},"allowed_ips":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":32},{"type":"null"}],"title":"Allowed Ips","description":"Send an empty list to allow any IP."},"rate_limit_per_minute":{"anyOf":[{"type":"integer","maximum":6000.0,"minimum":10.0},{"type":"null"}],"title":"Rate Limit Per Minute"},"token_ttl_seconds":{"anyOf":[{"type":"integer","maximum":3600.0,"minimum":60.0},{"type":"null"}],"title":"Token Ttl Seconds"},"require_mtls":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Require Mtls"},"mtls_cert_thumbprints":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":20},{"type":"null"}],"title":"Mtls Cert Thumbprints"},"require_signed_requests":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Require Signed Requests"}},"type":"object","title":"ApiClientUpdate","description":"Change an API client's settings. Only the fields sent are changed.\n\nThe JWK set is replaced with ``PUT /api-clients/{id}/jwks``; signing keys\nhave their own endpoints.","example":{"allowed_ips":["203.0.113.10"],"rate_limit_per_minute":1200},"examples":[{"allowed_ips":["203.0.113.10"],"rate_limit_per_minute":1200}]},"SuccessEnvelope_ApiClientDisableResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApiClientDisableResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApiClientDisableResponse]"},"SuccessEnvelope_ApiClientListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApiClientListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApiClientListResponse]"},"SuccessEnvelope_ApiClientResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApiClientResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApiClientResponse]"},"SuccessEnvelope_ApiClientSigningKeyCreateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/ApiClientSigningKeyCreateResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ApiClientSigningKeyCreateResponse]"},"ErrorResponse":{"title":"ErrorResponse","type":"object","description":"Envelope returned by every non-2xx response. Branch on `code` (stable) rather than `message` (human-readable, may change).","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`."},"message":{"type":"string","description":"Human-readable explanation, safe to show to end users."},"code":{"type":"string","description":"Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`)."},"request_id":{"type":"string","description":"Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied."},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field-level validation messages keyed by field name. Present on 400/422 validation failures only."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}