{"openapi":"3.1.0","info":{"title":"Rive Card API","version":"19a0b59","description":"Virtual cards for AI agents. One base URL; the credential decides sandbox vs live (`rk_test_`/`rk_live_` keys or OAuth client-credentials tokens). Conventions: type-prefixed ids, cursor pagination (`limit`, `cursor` → `next_cursor`), `Idempotency-Key` on POST (24 h), one error envelope `{ error: { type, code, message, param?, request_id } }`, `Request-Id` on every response."},"servers":[{"url":"https://api.rivecard.com"}],"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","description":"Secret API key: `Authorization: Bearer rk_test_…` (sandbox) or `rk_live_…`."},"OAuth":{"type":"oauth2","description":"Client credentials: POST /v1/oauth/token with client_id + client_secret → 1 h bearer (`rat_test_…`).","flows":{"clientCredentials":{"tokenUrl":"/v1/oauth/token","scopes":{"api":"Full organization API in the credential’s environment"}}}},"EndUserToken":{"type":"http","scheme":"bearer","description":"End-user connection token from /v1/connect/verify (`act_test_…`, 1 h; refresh with /v1/connect/refresh)."},"Session":{"type":"apiKey","in":"cookie","name":"rc_session","description":"Dashboard session cookie (HttpOnly, set by sign-in). Writes also need `X-CSRF-Token`."}},"schemas":{"Health":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"version":{"type":"string"},"time":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"live_issuers":{"type":"array","items":{"$ref":"#/components/schemas/IssuerName"}}},"required":["status","version","time","live_issuers"]},"IssuerName":{"type":"string","enum":["simulator","lithic","rain","marqeta"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","not_found_error","conflict_error","idempotency_error","rate_limit_error","issuer_error","api_error"]},"code":{"type":"string","example":"parameter_invalid"},"message":{"type":"string"},"param":{"type":"string"},"details":{},"doc_url":{"type":"string"},"request_id":{"type":"string"}},"required":["type","code","message"]}},"required":["error"]},"AuthProviders":{"type":"object","properties":{"object":{"type":"string","enum":["auth_providers"]},"providers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["email_otp","passkey","google","github"]},"enabled":{"type":"boolean"}},"required":["id","enabled"]}}},"required":["object","providers"]},"EmailStartRequest":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"}},"required":["email"]},"LoginResult":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"redirect_to":{"type":"string"},"new_user":{"type":"boolean"}},"required":["session","redirect_to","new_user"]},"Session":{"type":"object","properties":{"object":{"type":"string","enum":["session"]},"id":{"type":"string"},"user":{"$ref":"#/components/schemas/User"},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/Membership"}},"csrf_token":{"type":"string","description":"Send as `X-CSRF-Token` on cookie-authenticated writes."},"auth_method":{"type":"string","enum":["email_otp","passkey"]},"expires_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["object","id","user","memberships","csrf_token","auth_method","expires_at"]},"User":{"type":"object","properties":{"id":{"type":"string","example":"usr_01jd…"},"object":{"type":"string","enum":["user"]},"email":{"type":"string"},"name":{"type":["string","null"]},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","email","name","created_at"]},"Membership":{"type":"object","properties":{"object":{"type":"string","enum":["membership"]},"organization":{"$ref":"#/components/schemas/Organization"},"role":{"$ref":"#/components/schemas/Role"}},"required":["object","organization","role"]},"Organization":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["organization"]},"name":{"type":"string"},"live_enabled":{"type":"boolean","description":"Live mode turns on once an issuer is configured and the org is approved."},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","name","live_enabled","created_at"]},"Role":{"type":"string","enum":["owner","admin","developer","viewer"]},"EmailVerifyRequest":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"code":{"type":"string","pattern":"^\\d{6}$"},"return_to":{"type":"string","maxLength":2048}},"required":["email","code"]},"PasskeyOptions":{"type":"object","properties":{"challenge_id":{"type":"string"},"options":{"type":"object","additionalProperties":{}}},"required":["challenge_id","options"]},"PasskeyVerifyRequest":{"type":"object","properties":{"challenge_id":{"type":"string"},"response":{"type":"object","additionalProperties":{},"description":"The JSON from @simplewebauthn/browser."},"name":{"type":"string","maxLength":100},"return_to":{"type":"string","maxLength":2048}},"required":["challenge_id","response"]},"Passkey":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["passkey"]},"name":{"type":"string"},"device_type":{"type":["string","null"]},"backed_up":{"type":"boolean"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"last_used_at":{"type":["string","null"],"description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","name","device_type","backed_up","created_at","last_used_at"]},"PasskeyList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Passkey"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"MembershipList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Membership"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"CreateOrganizationRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]},"MemberList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Member"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"Member":{"type":"object","properties":{"object":{"type":"string","enum":["member"]},"user":{"$ref":"#/components/schemas/User"},"role":{"$ref":"#/components/schemas/Role"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["object","user","role","created_at"]},"AddMemberRequest":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"role":{"$ref":"#/components/schemas/Role"}},"required":["email","role"]},"UpdateMemberRequest":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/Role"}},"required":["role"]},"ApiKeyList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["api_key"]},"name":{"type":"string"},"environment":{"$ref":"#/components/schemas/Environment"},"prefix":{"type":"string","description":"First characters of the key, for recognition.","example":"rk_test_a1b2"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"last_used_at":{"type":["string","null"],"description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"revoked_at":{"type":["string","null"],"description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","name","environment","prefix","created_at","last_used_at","revoked_at"]},"Environment":{"type":"string","enum":["test","live"],"description":"Sandbox (`test`) or real money (`live`)."},"CreatedApiKey":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["api_key"]},"name":{"type":"string"},"environment":{"$ref":"#/components/schemas/Environment"},"prefix":{"type":"string","description":"First characters of the key, for recognition.","example":"rk_test_a1b2"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"last_used_at":{"type":["string","null"],"description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"revoked_at":{"type":["string","null"],"description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"secret":{"type":"string","description":"The full key. Shown once — store it now."}},"required":["id","object","name","environment","prefix","created_at","last_used_at","revoked_at","secret"]},"CreateApiKeyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"environment":{"$ref":"#/components/schemas/Environment"}},"required":["name"]},"OAuthClientList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/OAuthClient"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"OAuthClient":{"type":"object","properties":{"id":{"type":"string","description":"Also the `client_id`.","example":"oac_01jd…"},"object":{"type":"string","enum":["oauth_client"]},"name":{"type":"string"},"environment":{"$ref":"#/components/schemas/Environment"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"last_used_at":{"type":["string","null"],"description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"revoked_at":{"type":["string","null"],"description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","name","environment","created_at","last_used_at","revoked_at"]},"CreatedOAuthClient":{"type":"object","properties":{"id":{"type":"string","description":"Also the `client_id`.","example":"oac_01jd…"},"object":{"type":"string","enum":["oauth_client"]},"name":{"type":"string"},"environment":{"$ref":"#/components/schemas/Environment"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"last_used_at":{"type":["string","null"],"description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"revoked_at":{"type":["string","null"],"description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"client_id":{"type":"string"},"client_secret":{"type":"string","description":"Shown once — store it now."}},"required":["id","object","name","environment","created_at","last_used_at","revoked_at","client_id","client_secret"]},"CreateOAuthClientRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"environment":{"$ref":"#/components/schemas/Environment"}},"required":["name"]},"OAuthToken":{"type":"object","properties":{"access_token":{"type":"string","example":"rat_test_…"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer"},"scope":{"type":"string","enum":["api"]},"environment":{"$ref":"#/components/schemas/Environment"}},"required":["access_token","token_type","expires_in","scope","environment"]},"OAuthTokenRequest":{"type":"object","properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"client_id":{"type":"string","maxLength":100,"description":"Or use HTTP Basic auth."},"client_secret":{"type":"string","maxLength":200}},"required":["grant_type"]},"ConnectStartRequest":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"}},"required":["email"]},"ConnectTokens":{"type":"object","properties":{"object":{"type":"string","enum":["connection"]},"access_token":{"type":"string","example":"act_test_…","description":"User-scoped bearer token, 1 hour."},"refresh_token":{"type":"string","example":"rct_test_…","description":"Rotating; each use returns a new one (30 days)."},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer"},"user":{"$ref":"#/components/schemas/EndUser"}},"required":["object","access_token","refresh_token","token_type","expires_in","user"]},"EndUser":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["end_user"]},"environment":{"$ref":"#/components/schemas/Environment"},"email":{"type":"string"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","environment","email","created_at"]},"ConnectVerifyRequest":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email"},"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["email","code"]},"ConnectRefreshRequest":{"type":"object","properties":{"refresh_token":{"type":"string","maxLength":200}},"required":["refresh_token"]},"WebhookEndpointList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["webhook_endpoint"]},"url":{"type":"string"},"description":{"type":["string","null"]},"environment":{"$ref":"#/components/schemas/Environment"},"enabled_events":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EventType"},{"type":"string","enum":["*"]}]}},"status":{"type":"string","enum":["enabled","disabled"]},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","url","description","environment","enabled_events","status","created_at"]},"EventType":{"type":"string","enum":["card.created","card.updated","card.frozen","card.unfrozen","card.closed","account_holder.created","account_holder.funded","transaction.created","transaction.approved","transaction.declined","api_key.created","api_key.revoked","webhook_endpoint.test"]},"CreatedWebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["webhook_endpoint"]},"url":{"type":"string"},"description":{"type":["string","null"]},"environment":{"$ref":"#/components/schemas/Environment"},"enabled_events":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EventType"},{"type":"string","enum":["*"]}]}},"status":{"type":"string","enum":["enabled","disabled"]},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"secret":{"type":"string","description":"Signing secret (`whsec_…`). Shown once."}},"required":["id","object","url","description","environment","enabled_events","status","created_at","secret"]},"CreateWebhookEndpointRequest":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"description":{"type":"string","maxLength":200},"enabled_events":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EventType"},{"type":"string","enum":["*"]}]},"minItems":1,"default":["*"]}},"required":["url"]},"UpdateWebhookEndpointRequest":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"description":{"type":["string","null"],"maxLength":200},"enabled_events":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/EventType"},{"type":"string","enum":["*"]}]},"minItems":1},"status":{"type":"string","enum":["enabled","disabled"]}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["event"]},"type":{"$ref":"#/components/schemas/EventType"},"environment":{"$ref":"#/components/schemas/Environment"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"data":{"type":"object","properties":{"object":{"type":"object","additionalProperties":{}}},"required":["object"]}},"required":["id","object","type","environment","created_at","data"]},"WebhookDeliveryList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["webhook_delivery"]},"endpoint_id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"$ref":"#/components/schemas/EventType"},"status":{"type":"string","enum":["pending","succeeded","failed"]},"attempts":{"type":"integer"},"next_attempt_at":{"type":["string","null"],"description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"last_response_status":{"type":["integer","null"]},"last_error":{"type":["string","null"]},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"updated_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","endpoint_id","event_id","event_type","status","attempts","next_attempt_at","last_response_status","last_error","created_at","updated_at"]},"EventList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"AccountHolder":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["account_holder"]},"environment":{"$ref":"#/components/schemas/Environment"},"issuer":{"$ref":"#/components/schemas/IssuerName"},"type":{"type":"string","enum":["individual","business"]},"kyc_status":{"type":"string","enum":["pending","approved","rejected","needs_review"]},"display_name":{"type":"string"},"email":{"type":["string","null"]},"external_id":{"type":["string","null"],"description":"Your id for this person or company."},"metadata":{"$ref":"#/components/schemas/Metadata"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","environment","issuer","type","kyc_status","display_name","email","external_id","metadata","created_at"]},"Metadata":{"type":"object","additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string key/value pairs for your own use."},"CreateAccountHolderRequest":{"type":"object","properties":{"type":{"type":"string","enum":["individual","business"],"default":"individual"},"display_name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","maxLength":254,"format":"email"},"external_id":{"type":"string","maxLength":200},"metadata":{"$ref":"#/components/schemas/Metadata"},"kyc":{"type":"object","additionalProperties":{},"description":"KYC/KYB payload passed straight to the issuer; never stored by Rive Card."}},"required":["display_name"]},"AccountHolderList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/AccountHolder"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"Balance":{"type":"object","properties":{"object":{"type":"string","enum":["balance"]},"account_holder_id":{"type":"string"},"currency":{"type":"string","enum":["usd"]},"available":{"type":"integer","description":"Minor units (cents)."},"pending":{"type":"integer"}},"required":["object","account_holder_id","currency","available","pending"]},"FundRequest":{"type":"object","properties":{"amount":{"type":"integer","minimum":1,"maximum":1000000},"currency":{"type":"string","enum":["usd"],"default":"usd"}},"required":["amount"]},"Card":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["card"]},"environment":{"$ref":"#/components/schemas/Environment"},"issuer":{"$ref":"#/components/schemas/IssuerName"},"account_holder_id":{"type":"string"},"type":{"type":"string","enum":["single_use","multi_use"]},"status":{"type":"string","enum":["active","frozen","closed"]},"brand":{"type":"string"},"last4":{"type":"string"},"exp_month":{"type":"integer"},"exp_year":{"type":"integer"},"nickname":{"type":["string","null"]},"controls":{"$ref":"#/components/schemas/CardControls"},"metadata":{"$ref":"#/components/schemas/Metadata"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"updated_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","environment","issuer","account_holder_id","type","status","brand","last4","exp_month","exp_year","nickname","controls","metadata","created_at","updated_at"]},"CardControls":{"type":"object","properties":{"spend_limits":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"integer","minimum":0},"interval":{"type":"string","enum":["per_transaction","daily","weekly","monthly","lifetime"]}},"required":["amount","interval"]},"maxItems":5,"default":[],"description":"Amounts in cents."},"max_transactions":{"type":["integer","null"],"minimum":1,"default":null},"allowed_mccs":{"type":"array","items":{"type":"string","pattern":"^\\d{4}$"},"maxItems":200,"default":[]},"blocked_mccs":{"type":"array","items":{"type":"string","pattern":"^\\d{4}$"},"maxItems":200,"default":[]},"allowed_merchants":{"type":"array","items":{"type":"string","maxLength":100},"maxItems":200,"default":[],"description":"Merchant ids or descriptors (case-insensitive)."},"blocked_merchants":{"type":"array","items":{"type":"string","maxLength":100},"maxItems":200,"default":[]},"expires_at":{"type":["string","null"],"default":null,"description":"Card stops authorizing after this time.","example":"2026-11-20T12:00:00.000Z"}}},"CreateCardRequest":{"type":"object","properties":{"account_holder_id":{"type":"string"},"type":{"type":"string","enum":["single_use","multi_use"],"default":"multi_use"},"nickname":{"type":"string","maxLength":100},"controls":{"type":"object","properties":{"spend_limits":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"integer","minimum":0},"interval":{"type":"string","enum":["per_transaction","daily","weekly","monthly","lifetime"]}},"required":["amount","interval"]},"maxItems":5,"default":[],"description":"Amounts in cents."},"max_transactions":{"type":["integer","null"],"minimum":1,"default":null},"allowed_mccs":{"type":"array","items":{"type":"string","pattern":"^\\d{4}$"},"maxItems":200,"default":[]},"blocked_mccs":{"type":"array","items":{"type":"string","pattern":"^\\d{4}$"},"maxItems":200,"default":[]},"allowed_merchants":{"type":"array","items":{"type":"string","maxLength":100},"maxItems":200,"default":[],"description":"Merchant ids or descriptors (case-insensitive)."},"blocked_merchants":{"type":"array","items":{"type":"string","maxLength":100},"maxItems":200,"default":[]},"expires_at":{"type":["string","null"],"default":null,"description":"Card stops authorizing after this time.","example":"2026-11-20T12:00:00.000Z"}}},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["account_holder_id"]},"CardList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Card"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"UpdateCardRequest":{"type":"object","properties":{"nickname":{"type":["string","null"],"maxLength":100},"controls":{"type":"object","properties":{"spend_limits":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"integer","minimum":0},"interval":{"type":"string","enum":["per_transaction","daily","weekly","monthly","lifetime"]}},"required":["amount","interval"]},"maxItems":5,"default":[],"description":"Amounts in cents."},"max_transactions":{"type":["integer","null"],"minimum":1,"default":null},"allowed_mccs":{"type":"array","items":{"type":"string","pattern":"^\\d{4}$"},"maxItems":200,"default":[]},"blocked_mccs":{"type":"array","items":{"type":"string","pattern":"^\\d{4}$"},"maxItems":200,"default":[]},"allowed_merchants":{"type":"array","items":{"type":"string","maxLength":100},"maxItems":200,"default":[],"description":"Merchant ids or descriptors (case-insensitive)."},"blocked_merchants":{"type":"array","items":{"type":"string","maxLength":100},"maxItems":200,"default":[]},"expires_at":{"type":["string","null"],"default":null,"description":"Card stops authorizing after this time.","example":"2026-11-20T12:00:00.000Z"}}},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"CardDisplay":{"oneOf":[{"type":"object","properties":{"object":{"type":"string","enum":["card_display"]},"type":{"type":"string","enum":["issuer_hosted"]},"url":{"type":"string","description":"Short-lived issuer-hosted iframe URL. The PAN never transits Rive Card."},"expires_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["object","type","url","expires_at"]},{"type":"object","properties":{"object":{"type":"string","enum":["card_display"]},"type":{"type":"string","enum":["test_card"]},"number":{"type":"string","description":"Simulator test number — not a real card. Test mode only."},"cvc":{"type":"string"},"exp_month":{"type":"integer"},"exp_year":{"type":"integer"},"expires_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["object","type","number","cvc","exp_month","exp_year","expires_at"]}]},"TransactionList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"Transaction":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["transaction"]},"environment":{"$ref":"#/components/schemas/Environment"},"card_id":{"type":"string"},"account_holder_id":{"type":"string"},"amount":{"type":"integer","description":"Cents."},"currency":{"type":"string","enum":["usd"]},"merchant":{"$ref":"#/components/schemas/Merchant"},"status":{"type":"string","enum":["approved","declined"]},"decline_reason":{"$ref":"#/components/schemas/DeclineReason"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"}},"required":["id","object","environment","card_id","account_holder_id","amount","currency","merchant","status","decline_reason","created_at"]},"Merchant":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"mcc":{"type":"string","pattern":"^\\d{4}$"},"id":{"type":"string","maxLength":100},"city":{"type":"string","maxLength":100},"country":{"type":"string","minLength":2,"maxLength":2}},"required":["name","mcc"]},"DeclineReason":{"type":["string","null"],"enum":["card_frozen","card_closed","card_expired","insufficient_funds","spend_limit_exceeded","transaction_count_exceeded","mcc_not_allowed","mcc_blocked","merchant_not_allowed","merchant_blocked","single_use_already_used","account_holder_not_approved","issuer_declined",null]},"SimulateAuthorizationRequest":{"type":"object","properties":{"card_id":{"type":"string"},"amount":{"type":"integer","minimum":1,"maximum":100000000},"merchant":{"$ref":"#/components/schemas/Merchant"}},"required":["card_id","amount","merchant"]},"AuditEventList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]},"AuditEvent":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["audit_event"]},"sequence":{"type":"integer"},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"organization_id":{"type":["string","null"]},"environment":{"allOf":[{"$ref":"#/components/schemas/Environment"},{"type":["string","null"]}]},"actor":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"id":{"type":["string","null"]}},"required":["type","id"]},"action":{"type":"string","example":"card.created"},"entity":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":["string","null"]}},"required":["type","id"]},"before":{},"after":{},"request_id":{"type":["string","null"]},"hash":{"type":"string"},"prev_hash":{"type":"string"}},"required":["id","object","sequence","created_at","organization_id","environment","actor","action","entity","request_id","hash","prev_hash"]},"ActorType":{"type":"string","enum":["user","api_key","system","webhook"]}},"parameters":{}},"paths":{"/v1/health":{"get":{"operationId":"health","summary":"Liveness + database check","tags":["System"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/providers":{"get":{"operationId":"listAuthProviders","summary":"Sign-in methods available on auth.rivecard.com","description":"Google and GitHub are reserved slots, disabled until configured.","tags":["Authentication"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthProviders"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/email/start":{"post":{"operationId":"startEmailLogin","summary":"Email a one-time sign-in code","description":"Always returns 202 (does not reveal whether the email has an account). Rate limited per IP and per email.","tags":["Authentication"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailStartRequest"}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["email_challenge"]},"expires_in":{"type":"number"}},"required":["object","expires_in"]}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/email/verify":{"post":{"operationId":"verifyEmailLogin","summary":"Exchange the emailed code for a session","description":"Creates the account (and a personal organization) on first sign-in. Sets the `rc_session` cookie.","tags":["Authentication"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailVerifyRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResult"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/passkeys/login/options":{"post":{"operationId":"passkeyLoginOptions","summary":"Start passkey sign-in (discoverable credentials)","tags":["Authentication"],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyOptions"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/passkeys/login/verify":{"post":{"operationId":"passkeyLoginVerify","summary":"Finish passkey sign-in","tags":["Authentication"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyVerifyRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResult"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/passkeys/register/options":{"post":{"operationId":"passkeyRegisterOptions","summary":"Start adding a passkey to your account","tags":["Authentication"],"security":[{"Session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyOptions"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/passkeys/register/verify":{"post":{"operationId":"passkeyRegisterVerify","summary":"Finish adding a passkey","tags":["Authentication"],"security":[{"Session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyVerifyRequest"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Passkey"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/passkeys":{"get":{"operationId":"listPasskeys","summary":"List your passkeys","tags":["Authentication"],"security":[{"Session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/passkeys/{id}":{"delete":{"operationId":"deletePasskey","summary":"Remove a passkey","tags":["Authentication"],"security":[{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"No content"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/session":{"get":{"operationId":"getSession","summary":"The current dashboard session (user, memberships, CSRF token)","tags":["Authentication"],"security":[{"Session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/logout":{"post":{"operationId":"logout","summary":"Sign out this session","tags":["Authentication"],"security":[{"Session":[]}],"responses":{"204":{"description":"No content"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/logout_all":{"post":{"operationId":"logoutEverywhere","summary":"Sign out everywhere (revoke all of your sessions)","tags":["Authentication"],"security":[{"Session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["sessions_revoked"]},"revoked":{"type":"integer"}},"required":["object","revoked"]}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations":{"get":{"operationId":"listMyOrganizations","summary":"Organizations you belong to","tags":["Organizations"],"security":[{"Session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createOrganization","summary":"Create an organization (you become owner)","tags":["Organizations"],"security":[{"Session":[]}],"parameters":[{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrganizationRequest"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization":{"get":{"operationId":"getOrganization","summary":"The organization the credential belongs to","tags":["Organizations"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["organization"]},"name":{"type":"string"},"live_enabled":{"type":"boolean","description":"Live mode turns on once an issuer is configured and the org is approved."},"created_at":{"type":"string","description":"ISO-8601 UTC timestamp","example":"2026-11-20T12:00:00.000Z"},"environment":{"type":"string","enum":["test","live"]},"credential":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"}},"required":["type","id"]}},"required":["id","object","name","live_enabled","created_at","environment","credential"]}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/members":{"get":{"operationId":"listMembers","summary":"Members of the organization","tags":["Team"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"addMember","summary":"Add a member by email (creates the user if needed; they sign in with a code)","tags":["Team"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMemberRequest"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/members/{id}":{"patch":{"operationId":"updateMember","summary":"Change a member’s role","tags":["Team"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"removeMember","summary":"Remove a member","tags":["Team"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"204":{"description":"No content"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/api_keys":{"get":{"operationId":"listApiKeys","summary":"List API keys (secrets are never returned again)","tags":["API keys"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Page size (1–100, default 20)."},"required":false,"description":"Page size (1–100, default 20).","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createApiKey","summary":"Create an API key (`rk_test_…` / `rk_live_…`) — the secret is shown once","tags":["API keys"],"security":[{"Session":[]}],"parameters":[{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKey"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/api_keys/{id}/revoke":{"post":{"operationId":"revokeApiKey","summary":"Revoke an API key immediately","tags":["API keys"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth_clients":{"get":{"operationId":"listOAuthClients","summary":"List OAuth clients (client-credentials apps)","tags":["OAuth"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Page size (1–100, default 20)."},"required":false,"description":"Page size (1–100, default 20).","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createOAuthClient","summary":"Create an OAuth client — `client_secret` is shown once","tags":["OAuth"],"security":[{"Session":[]}],"parameters":[{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOAuthClientRequest"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedOAuthClient"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth_clients/{id}/revoke":{"post":{"operationId":"revokeOAuthClient","summary":"Revoke an OAuth client and all its access tokens","tags":["OAuth"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClient"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/token":{"post":{"operationId":"createOAuthToken","summary":"Client-credentials grant → 1 h bearer token","description":"Send `client_id` + `client_secret` in the JSON body or as HTTP Basic auth. The credential decides sandbox vs live; the host is the same.","tags":["OAuth"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthToken"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connect/start":{"post":{"operationId":"connectStart","summary":"Email an end user a one-time code to connect them to your organization","description":"Test mode sends no email; the code is always `111111`.","tags":["Connect"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectStartRequest"}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["connect_challenge"]},"expires_in":{"type":"number"}},"required":["object","expires_in"]}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connect/verify":{"post":{"operationId":"connectVerify","summary":"Exchange the end user’s code for user-scoped tokens","tags":["Connect"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectVerifyRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectTokens"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connect/refresh":{"post":{"operationId":"connectRefresh","summary":"Rotate an end user’s tokens (refresh tokens are single-use)","description":"Re-using a spent refresh token revokes the whole token family.","tags":["Connect"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectRefreshRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectTokens"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/connect/me":{"get":{"operationId":"connectMe","summary":"The end user an `act_…` token belongs to","tags":["Connect"],"security":[{"EndUserToken":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndUser"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook_endpoints":{"get":{"operationId":"listWebhookEndpoints","summary":"List webhook endpoints","tags":["Webhooks"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Page size (1–100, default 20)."},"required":false,"description":"Page size (1–100, default 20).","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createWebhookEndpoint","summary":"Create a webhook endpoint — the signing secret is shown once","description":"Deliveries are signed: `Rive-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>`. Failed deliveries retry 5 times (1m, 5m, 30m, 1h, 6h).","tags":["Webhooks"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointRequest"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedWebhookEndpoint"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook_endpoints/{id}":{"get":{"operationId":"getWebhookEndpoint","summary":"Retrieve a webhook endpoint","tags":["Webhooks"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateWebhookEndpoint","summary":"Update a webhook endpoint","tags":["Webhooks"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookEndpointRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteWebhookEndpoint","summary":"Delete a webhook endpoint","tags":["Webhooks"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"204":{"description":"No content"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook_endpoints/{id}/test":{"post":{"operationId":"sendTestWebhook","summary":"Send a `webhook_endpoint.test` event to this endpoint","tags":["Webhooks"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook_deliveries":{"get":{"operationId":"listWebhookDeliveries","summary":"Delivery log (newest first)","tags":["Webhooks"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Page size (1–100, default 20)."},"required":false,"description":"Page size (1–100, default 20).","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"endpoint_id","in":"query"},{"schema":{"type":"string","enum":["pending","succeeded","failed"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events":{"get":{"operationId":"listEvents","summary":"Events (newest first)","tags":["Events"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Page size (1–100, default 20)."},"required":false,"description":"Page size (1–100, default 20).","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"},{"schema":{"type":"string","maxLength":100},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/{id}":{"get":{"operationId":"getEvent","summary":"Retrieve an event","tags":["Events"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account_holders":{"post":{"operationId":"createAccountHolder","summary":"Create an account holder (the card’s legal owner) and start KYC/KYB with the issuer","description":"The `kyc` payload is passed to the issuer and never stored by Rive Card. In test mode the simulator approves instantly (names containing \"reject\"/\"review\" exercise other outcomes).","tags":["Account holders"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountHolderRequest"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountHolder"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listAccountHolders","summary":"List account holders","tags":["Account holders"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Page size (1–100, default 20)."},"required":false,"description":"Page size (1–100, default 20).","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountHolderList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account_holders/{id}":{"get":{"operationId":"getAccountHolder","summary":"Retrieve an account holder","tags":["Account holders"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountHolder"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account_holders/{id}/balance":{"get":{"operationId":"getBalance","summary":"Available balance (held by the issuer / sponsor bank, never by Rive Card)","tags":["Funding"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account_holders/{id}/fund":{"post":{"operationId":"fundAccountHolder","summary":"Move funds to an account holder (simulator: instant test money)","tags":["Funding"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cards":{"post":{"operationId":"createCard","summary":"Issue a virtual card with spending controls","description":"Controls are enforced in real time at authorization (before the network approves) on issuers with a decision hook, and pushed to the issuer natively where supported.","tags":["Cards"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCardRequest"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listCards","summary":"List cards","tags":["Cards"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Page size (1–100, default 20)."},"required":false,"description":"Page size (1–100, default 20).","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"account_holder_id","in":"query"},{"schema":{"type":"string","enum":["active","frozen","closed"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cards/{id}":{"get":{"operationId":"getCard","summary":"Retrieve a card (never includes the card number)","tags":["Cards"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateCard","summary":"Update nickname, metadata or controls (amount limits, tx count, MCC/merchant lists, expiry)","tags":["Cards"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCardRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cards/{id}/freeze":{"post":{"operationId":"freezeCard","summary":"Freeze a card (declines everything until unfrozen)","tags":["Cards"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cards/{id}/unfreeze":{"post":{"operationId":"unfreezeCard","summary":"Unfreeze a card","tags":["Cards"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cards/{id}/close":{"post":{"operationId":"closeCard","summary":"Close a card permanently","tags":["Cards"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Card"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cards/{id}/display":{"post":{"operationId":"createCardDisplay","summary":"Get a short-lived secure display for the card details","description":"Live mode returns an issuer-hosted iframe URL — the card number never passes through Rive Card. Test mode (simulator) returns a fake `4242…` test number. Every call is audited.","tags":["Cards"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardDisplay"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/transactions":{"get":{"operationId":"listTransactions","summary":"List authorizations (approved and declined)","tags":["Transactions"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Page size (1–100, default 20)."},"required":false,"description":"Page size (1–100, default 20).","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"card_id","in":"query"},{"schema":{"type":"string","enum":["approved","declined"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/transactions/{id}":{"get":{"operationId":"getTransaction","summary":"Retrieve a transaction","tags":["Transactions"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/simulate/authorizations":{"post":{"operationId":"simulateAuthorization","summary":"Test mode: run a card authorization through the real-time decision engine","description":"Returns the resulting transaction (approved, or declined with `decline_reason`).","tags":["Simulator"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"string","maxLength":255,"description":"Retry-safe key; replays the stored response for 24 h."},"required":false,"description":"Retry-safe key; replays the stored response for 24 h.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateAuthorizationRequest"}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/audit_events":{"get":{"operationId":"listAuditEvents","summary":"Tamper-evident audit trail for the organization (owner/admin)","description":"Append-only and hash-chained: `hash = sha256(prev_hash || canonical(row))`. Sensitive fields are redacted before they are written.","tags":["Audit"],"security":[{"ApiKey":[]},{"OAuth":[]},{"Session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Page size (1–100, default 20)."},"required":false,"description":"Page size (1–100, default 20).","name":"limit","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Opaque cursor from a previous page’s `next_cursor`."},"required":false,"description":"Opaque cursor from a previous page’s `next_cursor`.","name":"cursor","in":"query"},{"schema":{"type":"string","maxLength":100},"required":false,"name":"action","in":"query"},{"schema":{"type":"string","maxLength":100},"required":false,"name":"entity_id","in":"query"},{"schema":{"type":"string","description":"Organization id (session auth only; API keys imply it)."},"required":false,"description":"Organization id (session auth only; API keys imply it).","name":"Rive-Organization","in":"header"},{"schema":{"type":"string","enum":["test","live"],"description":"Session auth only; default `test`."},"required":false,"description":"Session auth only; default `test`.","name":"Rive-Environment","in":"header"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}