{"openapi":"3.1.0","info":{"title":"API Gateway","description":"Multi-tenant API Gateway with Kong Konnect integration","version":"1.0.0"},"paths":{"/organizations/me":{"get":{"tags":["organizations"],"summary":"Get My Organization","description":"Get current user's organization summary.\n\nRequires authentication.","operationId":"get_my_organization_organizations_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationResponse"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["organizations"],"summary":"Update My Organization","description":"Update current user's organization details.\n\nOnly OWNER role can update organization.\nClears the is_new_self_serve flag after update.\n\nRequires authentication.","operationId":"update_my_organization_organizations_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/organizations/me/ensure":{"post":{"tags":["organizations"],"summary":"Ensure My Organization","description":"Ensure user has an organization. Creates one if none exists.\n\nThis endpoint is called by the frontend after login for self-serve users.\nIf the user already has an organization, returns it.\nIf Authentik stamped AWS Marketplace attributes on the user at enrollment, creates\nthe Marketplace tenant. Otherwise, creates a new credit organization with the user as OWNER.\n\nRequires authentication.","operationId":"ensure_my_organization_organizations_me_ensure_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/organizations/me/accept-terms":{"post":{"tags":["organizations"],"summary":"Accept Terms Of Use","description":"Accept terms of use for the current user.\n\nRequires authentication.","operationId":"accept_terms_of_use_organizations_me_accept_terms_post","responses":{"204":{"description":"Successful Response"}},"security":[{"HTTPBearer":[]}]}},"/organizations/{organization_id}/members":{"get":{"tags":["organizations"],"summary":"List Organization Members","description":"List all members of an organization.\n\nReturns member details including user information and role.\n\nRequires authentication and membership in the organization.","operationId":"list_organization_members_organizations__organization_id__members_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MemberResponse"},"title":"Response List Organization Members Organizations  Organization Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members/{member_id}":{"delete":{"tags":["organizations"],"summary":"Remove Organization Member","description":"Remove a member from the organization and deactivate them in Authentik.","operationId":"remove_organization_member_organizations__organization_id__members__member_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members/{member_id}/role":{"patch":{"tags":["organizations"],"summary":"Update Member Role","description":"Update a member's role within the organization.\n\nOnly administrators and owners can change roles.\n\nRequires authentication and admin privileges in the organization.","operationId":"update_member_role_organizations__organization_id__members__member_id__role_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/transfer-ownership":{"post":{"tags":["organizations"],"summary":"Transfer Organization Ownership","description":"Hand the organization over to another member.\n\nOnly the current owner can transfer ownership, and the new owner must already be a\nmember of the organization. The outgoing owner keeps the role given by\n``previousOwnerAction``, or leaves the organization when it is ``REMOVE``.\n\nRequires authentication and the OWNER role in the organization.","operationId":"transfer_organization_ownership_organizations__organization_id__transfer_ownership_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferOwnershipRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferOwnershipResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/usage":{"get":{"tags":["organizations"],"summary":"Get Organization Usage","description":"Return monthly usage summaries for the authenticated organization.","operationId":"get_organization_usage_organizations__organization_id__usage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","default":"month","title":"Granularity"}},{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}},{"name":"bucket","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bucket"}},{"name":"models","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Models"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/invitations":{"get":{"tags":["organizations"],"summary":"List Organization Invitations","description":"List invitations for the specified organization.\n\nRequires the requester to belong to the organization.","operationId":"list_organization_invitations_organizations__organization_id__invitations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationInvitationsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["organizations"],"summary":"Create Organization Invitation","description":"Create an invitation scoped explicitly to an organization.","operationId":"create_organization_invitation_organizations__organization_id__invitations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationInvitationCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/invitations/{invitation_id}":{"delete":{"tags":["organizations"],"summary":"Cancel Organization Invitation","description":"Cancel an invitation within the organization scope.","operationId":"cancel_organization_invitation_organizations__organization_id__invitations__invitation_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/invoices":{"get":{"tags":["organizations"],"summary":"List Organization Invoices","description":"List one page of the organization's past invoices (admin/owner only).","operationId":"list_organization_invoices_organizations__organization_id__invoices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start timestamp (timezone-aware ISO 8601), inclusive","title":"From"},"description":"Start timestamp (timezone-aware ISO 8601), inclusive"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End timestamp (timezone-aware ISO 8601), inclusive","title":"To"},"description":"End timestamp (timezone-aware ISO 8601), inclusive"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}},{"name":"startingAfter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor: return the page after this invoice id","title":"Startingafter"},"description":"Cursor: return the page after this invoice id"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/invoices/{invoice_id}/pdf":{"get":{"tags":["organizations"],"summary":"Get Organization Invoice Pdf","description":"Return a short-lived URL to download an invoice PDF (admin/owner only).","operationId":"get_organization_invoice_pdf_organizations__organization_id__invoices__invoice_id__pdf_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePdfResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/organization":{"get":{"tags":["users"],"summary":"Get User Organization","description":"Get organization information for the specified user.","operationId":"get_user_organization_users__user_id__organization_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/organizations":{"get":{"tags":["users"],"summary":"Get User Organizations","description":"Get all organizations for the specified user.\n\nReturns a list of organizations with membership metadata.\n\nRequires authentication. Users can only fetch their own organizations.","operationId":"get_user_organizations_users__user_id__organizations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationResponse"},"title":"Response Get User Organizations Users  User Id  Organizations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invitations/":{"get":{"tags":["invitations"],"summary":"List Invitations","description":"List all invitations for the user's organization.\n\nReturns all invitations (pending, accepted, expired, cancelled).\n\nRequires authentication and membership in an organization.","operationId":"list_invitations_invitations__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/InvitationResponse"},"type":"array","title":"Response List Invitations Invitations  Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["invitations"],"summary":"Create Invitation","description":"Create an invitation to join an organization.\n\nOnly administrators can create invitations.\n\nRequires authentication and administrator role.","operationId":"create_invitation_invitations__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/invitations/{invitation_id}/accept":{"post":{"tags":["invitations"],"summary":"Accept Invitation","description":"Accept an invitation to join an organization.\n\nCreates organization membership for the current user.\n\nRequires authentication. User email must match invitation email.","operationId":"accept_invitation_invitations__invitation_id__accept_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invitations/{invitation_id}":{"delete":{"tags":["invitations"],"summary":"Cancel Invitation","description":"Cancel a pending invitation.\n\nOnly administrators can cancel invitations.\n\nRequires authentication and administrator role.","operationId":"cancel_invitation_invitations__invitation_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","title":"Invitation Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/api-keys":{"post":{"tags":["api-keys"],"summary":"Create Api Key","description":"Create a new API key for the organization.\n\nReturns the API key value - this is the only time it will be exposed.\nStore it securely!\n\nRequires authentication and membership in the organization.","operationId":"create_api_key_organizations__organization_id__api_keys_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyRequestBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAPIKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["api-keys"],"summary":"List Api Keys","description":"List all API keys for the organization.\n\nAPI key values are never returned - only metadata.\n\nRequires authentication and membership in the organization.","operationId":"list_api_keys_organizations__organization_id__api_keys_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/APIKeyStatus"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Api Keys Organizations  Organization Id  Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/api-keys/{api_key_id}/cycle":{"post":{"tags":["api-keys"],"summary":"Cycle Api Key","description":"Cycle (rotate) an API key - generates a new value while preserving metadata.\n\nReturns the new API key value - this is the only time it will be exposed.\nThe old key is immediately revoked.\n\nRequires authentication and membership in the organization.","operationId":"cycle_api_key_organizations__organization_id__api_keys__api_key_id__cycle_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"api_key_id","in":"path","required":true,"schema":{"type":"string","title":"Api Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CycleAPIKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/api-keys/{api_key_id}":{"delete":{"tags":["api-keys"],"summary":"Revoke Api Key","description":"Revoke (delete) an API key.\n\nThe key will be immediately revoked in Kong and marked as inactive.\n\nRequires authentication and membership in the organization.","operationId":"revoke_api_key_organizations__organization_id__api_keys__api_key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"api_key_id","in":"path","required":true,"schema":{"type":"string","title":"Api Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dashboard/summary":{"get":{"tags":["dashboard"],"summary":"Get Dashboard Summary","description":"Return dashboard summary for the authenticated user's organization.","operationId":"get_dashboard_summary_dashboard_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardSummaryResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/setup":{"post":{"tags":["billing"],"summary":"Create Setup Session","description":"Create a Stripe Checkout Session for adding a payment method.\nReturns a URL to redirect the user to Stripe's hosted form.","operationId":"create_setup_session_billing_setup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSessionResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/topup":{"post":{"tags":["billing"],"summary":"Topup Credits","description":"Manually top up credits by charging the saved payment method.\nMinimum amount is 5000 units ($5.00).\n\nIf the card requires authentication (3D Secure), returns a checkout_url\nfor the user to complete payment on-session.","operationId":"topup_credits_billing_topup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/info":{"get":{"tags":["billing"],"summary":"Get Billing Info","description":"Get complete billing information for the dashboard.","operationId":"get_billing_info_billing_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingInfoResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/payment-methods":{"get":{"tags":["billing"],"summary":"List Payment Methods","description":"List saved card payment methods.","operationId":"list_payment_methods_billing_payment_methods_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/payment-methods/{payment_method_id}":{"delete":{"tags":["billing"],"summary":"Delete Payment Method","description":"Remove a saved card payment method.","operationId":"delete_payment_method_billing_payment_methods__payment_method_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"payment_method_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Method Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/payment-methods/{payment_method_id}/default":{"put":{"tags":["billing"],"summary":"Set Default Payment Method","description":"Set the default saved card payment method.","operationId":"set_default_payment_method_billing_payment_methods__payment_method_id__default_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"payment_method_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Method Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/auto-topup/status":{"get":{"tags":["billing"],"summary":"Get Auto Topup Status","description":"Get automatic top-up retry / failure status for the tenant.","operationId":"get_auto_topup_status_billing_auto_topup_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopupStatusResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/auto-topup":{"put":{"tags":["billing"],"summary":"Update Auto Topup","description":"Update auto-topup configuration for the tenant.","operationId":"update_auto_topup_billing_auto_topup_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAutoTopupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/webhooks/stripe":{"post":{"tags":["billing"],"summary":"Stripe Webhook","description":"Handle Stripe webhook events for billing.","operationId":"stripe_webhook_billing_webhooks_stripe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ready":{"get":{"summary":"Readiness Check","operationId":"readiness_check_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"APIKeyStatus":{"type":"string","enum":["ACTIVE","REVOKED"],"title":"APIKeyStatus","description":"Status of an API key."},"AutoTopupConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"threshold_units":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Threshold Units"},"amount_units":{"anyOf":[{"type":"integer","minimum":5000.0},{"type":"null"}],"title":"Amount Units"},"maximum_monthly_topup_units":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Maximum Monthly Topup Units"}},"type":"object","required":["enabled"],"title":"AutoTopupConfig","description":"Auto-topup configuration."},"AutoTopupStatusResponse":{"properties":{"failing":{"type":"boolean","title":"Failing"},"disabled_for_failure":{"type":"boolean","title":"Disabled For Failure"},"last_failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Failure Reason"},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Attempt At"}},"type":"object","required":["failing","disabled_for_failure","last_failure_reason","next_attempt_at"],"title":"AutoTopupStatusResponse","description":"Transient automatic top-up retry / failure status."},"BillingInfoResponse":{"properties":{"billing_type":{"$ref":"#/components/schemas/BillingType"},"tenant_status":{"$ref":"#/components/schemas/TenantStatus"},"is_suspended":{"type":"boolean","title":"Is Suspended"},"is_pending_activation":{"type":"boolean","title":"Is Pending Activation"},"has_payment_method":{"type":"boolean","title":"Has Payment Method"},"payment_method":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethodInfo"},{"type":"null"}]},"balance_units":{"type":"integer","title":"Balance Units"},"auto_topup":{"$ref":"#/components/schemas/AutoTopupConfig"},"topups_this_month_units":{"type":"integer","title":"Topups This Month Units"},"auto_topups_this_month_units":{"type":"integer","title":"Auto Topups This Month Units"},"remaining_topup_capacity_units":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Remaining Topup Capacity Units"},"welcome_credit_eligible":{"type":"boolean","title":"Welcome Credit Eligible","default":false}},"type":"object","required":["billing_type","tenant_status","is_suspended","is_pending_activation","has_payment_method","payment_method","balance_units","auto_topup","topups_this_month_units","auto_topups_this_month_units","remaining_topup_capacity_units"],"title":"BillingInfoResponse","description":"Complete billing information for the frontend."},"BillingType":{"type":"string","enum":["usage","credit","aws_marketplace_usage"],"title":"BillingType","description":"Billing mode for a tenant."},"CreateAPIKeyRequestBody":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name for the API key"}},"type":"object","required":["name"],"title":"CreateAPIKeyRequestBody","description":"Request body for creating an API key."},"CreateAPIKeyResponse":{"properties":{"api_key_id":{"type":"string","title":"Api Key Id"},"name":{"type":"string","title":"Name"},"tenant_id":{"type":"string","title":"Tenant Id"},"api_key":{"type":"string","title":"Api Key"},"fingerprint":{"type":"string","title":"Fingerprint"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["api_key_id","name","tenant_id","api_key","fingerprint","status","created_at"],"title":"CreateAPIKeyResponse","description":"Response containing the created API key information."},"CreateInvitationRequest":{"properties":{"email":{"type":"string","minLength":1,"title":"Email","description":"Email address of person to invite"}},"type":"object","required":["email"],"title":"CreateInvitationRequest","description":"Request to create an invitation."},"CycleAPIKeyResponse":{"properties":{"api_key_id":{"type":"string","title":"Api Key Id"},"name":{"type":"string","title":"Name"},"tenant_id":{"type":"string","title":"Tenant Id"},"api_key":{"type":"string","title":"Api Key"},"fingerprint":{"type":"string","title":"Fingerprint"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["api_key_id","name","tenant_id","api_key","fingerprint","status","created_at"],"title":"CycleAPIKeyResponse","description":"Response containing the cycled API key information."},"DashboardSummaryResponse":{"properties":{"organizationId":{"type":"string","title":"Organizationid"},"organizationName":{"type":"string","title":"Organizationname"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"userFirstName":{"type":"string","title":"Userfirstname"},"invitesPending":{"type":"integer","title":"Invitespending"},"hasAnyUsage":{"type":"boolean","title":"Hasanyusage"},"usageSeries":{"items":{"$ref":"#/components/schemas/DashboardUsagePoint"},"type":"array","title":"Usageseries"}},"type":"object","required":["organizationId","organizationName","createdAt","userFirstName","invitesPending","hasAnyUsage"],"title":"DashboardSummaryResponse","description":"Dashboard summary payload consumed by the backoffice UI."},"DashboardUsagePoint":{"properties":{"ts":{"type":"string","format":"date-time","title":"Ts","description":"Bucket timestamp (UTC)"},"count":{"type":"integer","title":"Count","description":"Aggregated request count for the bucket"}},"type":"object","required":["ts","count"],"title":"DashboardUsagePoint","description":"Point used to render the dashboard usage sparkline."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvitationResponse":{"properties":{"invitationId":{"type":"string","title":"Invitationid","description":"Invitation ID"},"organizationId":{"type":"string","title":"Organizationid","description":"Organization ID"},"email":{"type":"string","title":"Email","description":"Invitee email address"},"invitedBy":{"type":"string","title":"Invitedby","description":"User ID of inviter"},"createdAt":{"type":"string","format":"date-time","title":"Createdat","description":"Timestamp when invitation was created"},"status":{"type":"string","title":"Status","description":"Invitation status"},"immediateAdd":{"type":"boolean","title":"Immediateadd","description":"Whether the user was added to the organization immediately (existing user)","default":false}},"type":"object","required":["invitationId","organizationId","email","invitedBy","createdAt","status"],"title":"InvitationResponse","description":"Response schema for invitation data."},"InvoiceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InvoiceResponse"},"type":"array","title":"Items"},"hasMore":{"type":"boolean","title":"Hasmore"},"limit":{"type":"integer","title":"Limit"},"currentInvoiceStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currentinvoicestatus","description":"Usage Current Invoice state: accruing | awaiting_payment | settled. Null for credit / AWS Marketplace / no invoice to show."},"currentInvoiceAmountCents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Currentinvoiceamountcents","description":"Amount for the Current Invoice summary (cents)."},"currentInvoiceCurrency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currentinvoicecurrency","description":"Currency for currentInvoiceAmountCents when present."},"currentInvoicePeriodStart":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Currentinvoiceperiodstart","description":"Period/invoice date used for the Current Invoice subtitle."}},"type":"object","required":["items","hasMore","limit"],"title":"InvoiceListResponse","description":"One page of invoices from cursor pagination."},"InvoicePdfResponse":{"properties":{"pdfUrl":{"type":"string","title":"Pdfurl"}},"type":"object","required":["pdfUrl"],"title":"InvoicePdfResponse","description":"Response with a short-lived URL to download an invoice PDF."},"InvoiceResponse":{"properties":{"id":{"type":"string","title":"Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"created":{"type":"string","format":"date-time","title":"Created"},"amountCents":{"type":"integer","title":"Amountcents"},"currency":{"type":"string","title":"Currency"},"status":{"type":"string","title":"Status"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"hostedInvoiceUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hostedinvoiceurl"}},"type":"object","required":["id","number","created","amountCents","currency","status","description","hostedInvoiceUrl"],"title":"InvoiceResponse","description":"A single invoice for the frontend. Amount is in the currency's smallest unit (cents)."},"MemberResponse":{"properties":{"userId":{"type":"string","title":"Userid","description":"User ID"},"organizationId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organizationid","description":"Organization ID"},"email":{"type":"string","title":"Email","description":"User email"},"name":{"type":"string","title":"Name","description":"User name"},"role":{"type":"string","title":"Role","description":"Member role (ADMINISTRATOR or MEMBER)"},"joinedAt":{"type":"string","format":"date-time","title":"Joinedat","description":"Timestamp when member joined"}},"type":"object","required":["userId","email","name","role","joinedAt"],"title":"MemberResponse","description":"Response schema for organization member data."},"OrganizationInvitationCreateRequest":{"properties":{"email":{"type":"string","minLength":1,"title":"Email","description":"Email address to invite"},"invitedBy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitedby","description":"Optional inviter ID from client (ignored by backend)"}},"type":"object","required":["email"],"title":"OrganizationInvitationCreateRequest","description":"Request to create an organization-scoped invitation."},"OrganizationInvitationsResponse":{"properties":{"invitations":{"items":{"$ref":"#/components/schemas/InvitationResponse"},"type":"array","title":"Invitations"}},"type":"object","required":["invitations"],"title":"OrganizationInvitationsResponse","description":"Wrapper response for organization invitation listings."},"OrganizationResponse":{"properties":{"organizationId":{"type":"string","title":"Organizationid","description":"Organization ID"},"name":{"type":"string","title":"Name","description":"Organization name"},"status":{"$ref":"#/components/schemas/TenantStatus","description":"Organization status"},"billingType":{"$ref":"#/components/schemas/BillingType","description":"Organization billing type"},"createdAt":{"type":"string","format":"date-time","title":"Createdat","description":"Organization creation timestamp"},"memberCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Membercount","description":"Number of members in the organization"},"currentUserRole":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currentuserrole","description":"Role of the requesting user within the organization"},"termsOfUseAccepted":{"type":"boolean","title":"Termsofuseaccepted","description":"Whether the user has accepted the terms of use","default":false},"dpaAccepted":{"type":"boolean","title":"Dpaaccepted","description":"Whether the user has accepted the Data Processing Agreement","default":false},"isNewSelfServe":{"type":"boolean","title":"Isnewselfserve","description":"True when org was just auto-created for self-serve user (show welcome modal)","default":false}},"type":"object","required":["organizationId","name","status","billingType","createdAt"],"title":"OrganizationResponse","description":"Response schema for organization data."},"PaymentMethodInfo":{"properties":{"last4":{"type":"string","title":"Last4"},"brand":{"type":"string","title":"Brand"},"exp_month":{"type":"integer","title":"Exp Month"},"exp_year":{"type":"integer","title":"Exp Year"}},"type":"object","required":["last4","brand","exp_month","exp_year"],"title":"PaymentMethodInfo","description":"Payment method details from the payment provider."},"PaymentMethodsResponse":{"properties":{"payment_methods":{"items":{"$ref":"#/components/schemas/StoredPaymentMethodResponse"},"type":"array","title":"Payment Methods"}},"type":"object","required":["payment_methods"],"title":"PaymentMethodsResponse","description":"List of saved payment methods."},"SetupSessionResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"}},"type":"object","required":["checkout_url"],"title":"SetupSessionResponse","description":"Response with Stripe Checkout URL."},"StoredPaymentMethodResponse":{"properties":{"id":{"type":"string","title":"Id"},"brand":{"type":"string","title":"Brand"},"last4":{"type":"string","title":"Last4"},"exp_month":{"type":"integer","title":"Exp Month"},"exp_year":{"type":"integer","title":"Exp Year"},"is_default":{"type":"boolean","title":"Is Default"}},"type":"object","required":["id","brand","last4","exp_month","exp_year","is_default"],"title":"StoredPaymentMethodResponse","description":"A saved card payment method."},"TenantStatus":{"type":"string","enum":["ACTIVE","AWS_PENDING_ACTIVATION","SUSPENDED","DELETED"],"title":"TenantStatus","description":"Status of a tenant account."},"TopupRequest":{"properties":{"amount_units":{"type":"integer","minimum":5000.0,"title":"Amount Units","description":"Amount in fixed credit units (1 credit unit = $0.001)"}},"type":"object","required":["amount_units"],"title":"TopupRequest","description":"Request to top up credits."},"TopupResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"new_balance_units":{"type":"integer","title":"New Balance Units"},"transaction_id":{"type":"string","title":"Transaction Id"},"requires_action":{"type":"boolean","title":"Requires Action","default":false},"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url"}},"type":"object","required":["success","new_balance_units","transaction_id"],"title":"TopupResponse","description":"Response after top-up attempt."},"TransferOwnershipRequest":{"properties":{"newOwnerUserId":{"type":"string","minLength":1,"title":"Newowneruserid","description":"User ID of the existing member who becomes the new owner"},"previousOwnerAction":{"type":"string","enum":["ADMINISTRATOR","MEMBER","REMOVE"],"title":"Previousowneraction","description":"What happens to the outgoing owner: keep them as ADMINISTRATOR or MEMBER, or REMOVE them from the organization","default":"ADMINISTRATOR"}},"type":"object","required":["newOwnerUserId"],"title":"TransferOwnershipRequest","description":"Request to hand the organization over to another member."},"TransferOwnershipResponse":{"properties":{"organizationId":{"type":"string","title":"Organizationid","description":"Organization ID"},"newOwnerUserId":{"type":"string","title":"Newowneruserid","description":"User ID of the new owner"},"previousOwnerUserId":{"type":"string","title":"Previousowneruserid","description":"User ID of the previous owner"},"previousOwnerRole":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previousownerrole","description":"Role kept by the previous owner, or null if they were removed from the organization"}},"type":"object","required":["organizationId","newOwnerUserId","previousOwnerUserId"],"title":"TransferOwnershipResponse","description":"Result of an ownership transfer."},"UpdateAutoTopupRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"threshold_units":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Threshold Units"},"amount_units":{"anyOf":[{"type":"integer","minimum":5000.0},{"type":"null"}],"title":"Amount Units"},"maximum_monthly_topup_units":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Maximum Monthly Topup Units"}},"type":"object","required":["enabled"],"title":"UpdateAutoTopupRequest","description":"Request to update auto-topup settings."},"UpdateMemberRoleRequest":{"properties":{"role":{"type":"string","title":"Role","description":"New role for the member (ADMINISTRATOR or MEMBER)"}},"type":"object","required":["role"],"title":"UpdateMemberRoleRequest","description":"Request to update a member's role within an organization."},"UpdateOrganizationRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"New name for the organization"}},"type":"object","title":"UpdateOrganizationRequest","description":"Request to update organization details."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}