openapi: 3.1.0
info:
  title: e-Próspera API
  version: 1.0.0
  description: |-
    Public API for Próspera's resident registry, legal-entity
    incorporation, OAuth identity, and agent-delegated workflows.

    This document is generated from the runtime zod schemas of each
    route handler. Update the schema, regenerate, and the docs follow.
  contact:
    url: https://docs.eprospera.com/
servers:
  - url: https://portal.eprospera.com
    description: Production
  - url: https://staging-portal.eprospera.com
    description: Staging
tags:
  - name: Verification
  - name: Legal entities
  - name: Legal-entity applications
  - name: Partner residency applications
  - name: Authenticated person
  - name: Consented legal entities
  - name: Referrals
  - name: Visitor passes
  - name: OAuth 2.0 / OpenID Connect
  - name: Deprecated aliases
components:
  securitySchemes:
    standardApiKey:
      type: http
      scheme: bearer
      bearerFormat: sk-...
      description: "Personal standard API key. Send it as `Authorization: Bearer sk-...` and never delegate it."
    agentKey:
      type: http
      scheme: bearer
      bearerFormat: ak-...
      description: Scope-checked Agent Key. See https://docs.eprospera.com/agent-keys.
    partnerKey:
      type: http
      scheme: bearer
      bearerFormat: pk-...
      description: Partner Key for one approved Partner Integration. Keys are lifecycle- and scope-checked, and cross-integration resources are hidden.
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://portal.eprospera.com/api/oauth/authorize
          tokenUrl: https://portal.eprospera.com/api/oauth/token
          refreshUrl: https://portal.eprospera.com/api/oauth/token
          scopes:
            openid: OpenID Connect authentication.
            profile: Read name and profile picture claims.
            email: Read email claims.
            offline_access: Issue a refresh token.
            eprospera:person.details.read: Read personal details.
            eprospera:person.residency.read: Read residency status.
            eprospera:person.id_verification.read: Read ID-verification artifacts.
            eprospera:entity.read: Read legal-entity details for consented entities.
            eprospera:entity.documents.read: Read legal-entity documents for consented entities.
    oauthClient:
      type: http
      scheme: basic
      description: OAuth client credentials using HTTP Basic. The OAuth endpoints also accept client credentials in the form body where documented.
  schemas:
    ErrorEnvelope:
      type: object
      properties:
        error:
          type: string
        error_description:
          type: string
        details:
          type: array
          items: {}
      required:
        - error
      description: Common error envelope. `error` is always present on a non-2xx response; `error_description` and `details` are optional.
    VerifyRpnResponse:
      type: object
      properties:
        result:
          type: string
          enum:
            - found_legal_entity
            - found_natural_person
            - not_found
        active:
          type: boolean
          description: Whether the resident has an active residency.
      required:
        - result
        - active
    VerifyRpnRequest:
      type: object
      properties:
        rpn:
          type: string
          pattern: ^[89]\d{13}$
          example: "80000000000012"
      required:
        - rpn
    SearchLegalEntitiesResponse:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              name:
                type: string
              extension:
                type: string
              residentPermitNumber:
                type:
                  - string
                  - "null"
                pattern: ^[89]\d{13}$
                description: 14-digit Resident Permit Number.
            required:
              - id
              - name
              - extension
              - residentPermitNumber
      required:
        - results
    SearchLegalEntitiesRequest:
      type: object
      properties:
        query:
          type: string
          minLength: 1
          maxLength: 100
      required:
        - query
    LegalEntity:
      type: object
      properties:
        id:
          type: string
          format: uuid
        optionId:
          type: string
        type:
          type: string
        name:
          type: string
        extension:
          type: string
        nameStartsWithExtension:
          type: boolean
        formationDate:
          type:
            - string
            - "null"
          format: date-time
        registrationDate:
          type:
            - string
            - "null"
          format: date-time
        dissolutionDate:
          type:
            - string
            - "null"
          format: date-time
        residentPermitNumber:
          type:
            - string
            - "null"
          pattern: ^[89]\d{13}$
          description: 14-digit Resident Permit Number.
        principalOfficeAddress:
          $ref: "#/components/schemas/Address"
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - optionId
        - type
        - name
        - extension
        - nameStartsWithExtension
        - residentPermitNumber
    Address:
      type:
        - object
        - "null"
      properties:
        line1:
          type: string
        line2:
          type:
            - string
            - "null"
        city:
          type: string
        state:
          type:
            - string
            - "null"
        postalCode:
          type: string
        country:
          type: string
      required:
        - line1
        - city
        - postalCode
        - country
    Document:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        slug:
          type:
            - string
            - "null"
        version:
          type:
            - string
            - "null"
        fileUrl:
          type:
            - string
            - "null"
          format: uri
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - fileUrl
    LegalEntityApplication:
      type: object
      properties:
        id:
          type: string
          format: uuid
        statusId:
          type: string
          enum:
            - Draft
            - Pending Review
            - Approved
            - Rejected
        applicationData: {}
        applicationVersion:
          type: string
        submittedAt:
          type:
            - string
            - "null"
          format: date-time
        createdAt:
          type: string
          format: date-time
        approvedAt:
          type:
            - string
            - "null"
          format: date-time
        rejectedAt:
          type:
            - string
            - "null"
          format: date-time
        legalEntityId:
          type:
            - string
            - "null"
          format: uuid
      required:
        - id
        - statusId
        - applicationVersion
        - submittedAt
        - createdAt
        - approvedAt
        - rejectedAt
        - legalEntityId
    CreateLegalEntityApplicationResponse:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/LegalEntityApplication"
        nextSteps:
          type: object
          properties:
            signature:
              type:
                - string
                - "null"
              format: uri
          required:
            - signature
      required:
        - data
        - nextSteps
    CreateLegalEntityApplicationRequest:
      type: object
      properties:
        applicationData:
          type: object
          properties:
            residencyType:
              type: string
              enum:
                - e-Resident
                - Resident
            entityType:
              type: string
              enum:
                - llc
            name:
              type: string
              minLength: 1
            extension:
              type: string
              enum:
                - LLC
                - L.L.C.
                - Limited Liability Company
                - S. de R.L.
                - SRL
                - Limited Company
                - L.C.
                - LC
                - Limited Liability Co.
                - Limited Co.
                - Ltd. Co.
            principalOffice:
              $ref: "#/components/schemas/Address"
            contactEmail:
              type: string
              format: email
            registeredAgentProvider:
              type:
                - string
                - "null"
              enum:
                - prospera_employment_solutions
            registeredAgentDetails:
              type:
                - object
                - "null"
              properties:
                attn:
                  type: string
                residentPermitNumber:
                  type: string
                  pattern: ^[89]\d{13}$
                  description: 14-digit Resident Permit Number.
                officeAddress:
                  $ref: "#/components/schemas/Address"
                mailingAddress:
                  $ref: "#/components/schemas/Address"
              required:
                - attn
                - residentPermitNumber
                - officeAddress
                - mailingAddress
            analytics:
              type: object
              additionalProperties:
                type: string
          required:
            - residencyType
            - entityType
            - name
            - extension
            - principalOffice
            - contactEmail
            - registeredAgentProvider
            - registeredAgentDetails
        referralCode:
          type: string
        redirectUrl:
          type: string
          format: uri
      required:
        - applicationData
    PaymentResponse:
      type: object
      properties:
        data:
          type: object
          additionalProperties: {}
        success:
          type: boolean
        message:
          type: string
      additionalProperties: {}
    VoucherPaymentRequest:
      type: object
      properties:
        voucherCode:
          type: string
          minLength: 1
      required:
        - voucherCode
    CheckoutResponse:
      type: object
      properties:
        data:
          type:
            - object
            - "null"
          additionalProperties: {}
        invoiceId:
          type: string
          format: uuid
      required:
        - data
        - invoiceId
    CheckoutRequest:
      type: object
      properties:
        paymentProvider:
          type: string
        paymentMethod:
          type: object
          additionalProperties: {}
        email:
          type:
            - string
            - "null"
          format: email
        redirectUrl:
          type: string
          format: uri
      required:
        - redirectUrl
    PartnerResidencyApplication:
      type: object
      properties:
        id:
          type: string
          format: uuid
        version:
          type: integer
          exclusiveMinimum: 0
        statusId:
          type: string
        applicationVersion:
          type: string
        submittedAt:
          type:
            - string
            - "null"
          format: date-time
        createdAt:
          type: string
          format: date-time
        approvedAt:
          type:
            - string
            - "null"
          format: date-time
        rejectedAt:
          type:
            - string
            - "null"
          format: date-time
        residentPermitNumber:
          type:
            - string
            - "null"
          pattern: ^[89]\d{13}$
          description: 14-digit Resident Permit Number.
        referralCode:
          type:
            - string
            - "null"
        applicationData:
          type: object
          properties:
            residencyType:
              type:
                - string
                - "null"
              enum:
                - limited_e_resident
                - e_resident
                - resident_annual
                - null
            aoc:
              type: object
              properties:
                aocId:
                  type:
                    - string
                    - "null"
                signed:
                  type: boolean
                signedByName:
                  type:
                    - string
                    - "null"
                signedAt:
                  type:
                    - string
                    - "null"
                  format: date-time
                agentAuthorized:
                  type: boolean
              required:
                - aocId
                - signed
                - signedByName
                - signedAt
                - agentAuthorized
            personalDetails:
              type:
                - object
                - "null"
              properties:
                givenName:
                  type: string
                surname:
                  type: string
                email:
                  type: string
                  format: email
                dateOfBirth:
                  type: string
                sex:
                  type: string
                countryOfBirth:
                  type:
                    - string
                    - "null"
                  minLength: 2
                  maxLength: 2
                citizenships:
                  type: array
                  items:
                    type: string
                    minLength: 2
                    maxLength: 2
                alternateNamesAttestation:
                  type: boolean
                alternateNames:
                  type:
                    - string
                    - "null"
                criminalBackgroundAttestation:
                  type: boolean
                proofOfAddressUploadId:
                  type:
                    - string
                    - "null"
                  format: uuid
                address:
                  type: object
                  properties:
                    line1:
                      type:
                        - string
                        - "null"
                    line2:
                      type:
                        - string
                        - "null"
                    city:
                      type:
                        - string
                        - "null"
                    state:
                      type:
                        - string
                        - "null"
                    postalCode:
                      type:
                        - string
                        - "null"
                    country:
                      type:
                        - string
                        - "null"
                      minLength: 2
                      maxLength: 2
                  required:
                    - line1
                    - line2
                    - city
                    - state
                    - postalCode
                    - country
                phoneNumber:
                  type:
                    - string
                    - "null"
              required:
                - givenName
                - surname
                - email
                - dateOfBirth
                - sex
                - countryOfBirth
                - citizenships
                - alternateNamesAttestation
                - alternateNames
                - criminalBackgroundAttestation
                - proofOfAddressUploadId
                - address
                - phoneNumber
            information:
              type: object
              properties:
                residencyReason:
                  type:
                    - string
                    - "null"
                referralSource:
                  type:
                    - string
                    - "null"
              required:
                - residencyReason
                - referralSource
          required:
            - residencyType
            - aoc
            - personalDetails
            - information
        applicantPortalAccess:
          type: object
          properties:
            email:
              type:
                - string
                - "null"
              format: email
            hasLoggedIn:
              type: boolean
            lastLogin:
              type:
                - string
                - "null"
              format: date-time
            claimLinkSent:
              type: boolean
            claimLinkSentAt:
              type:
                - string
                - "null"
              format: date-time
          required:
            - email
            - hasLoggedIn
            - lastLogin
            - claimLinkSent
            - claimLinkSentAt
        nextSteps:
          type: object
          properties:
            agreementUrl:
              type:
                - string
                - "null"
              format: uri
            proofOfAddressRequired:
              type: boolean
            paymentRequired:
              type: boolean
            verificationRequired:
              type: boolean
            verificationInstructions:
              type:
                - string
                - "null"
            submitReady:
              type: boolean
          required:
            - agreementUrl
            - proofOfAddressRequired
            - paymentRequired
            - verificationRequired
            - verificationInstructions
            - submitReady
      required:
        - id
        - version
        - statusId
        - applicationVersion
        - submittedAt
        - createdAt
        - approvedAt
        - rejectedAt
        - residentPermitNumber
        - referralCode
        - applicationData
        - applicantPortalAccess
        - nextSteps
    CreatePartnerResidencyApplicationRequest:
      type: object
      properties:
        applicationData:
          type: object
          properties:
            residencyType:
              type: string
              enum:
                - limited_e_resident
                - e_resident
                - resident_annual
            personalDetails:
              type: object
              properties:
                givenName:
                  type: string
                  minLength: 1
                surname:
                  type: string
                  minLength: 1
                email:
                  type: string
                  format: email
                dateOfBirth:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                sex:
                  type: string
                  enum:
                    - male
                    - female
                countryOfBirth:
                  type: string
                  pattern: ^[A-Z]{2}$
                citizenships:
                  type: array
                  items:
                    type: string
                    pattern: ^[A-Z]{2}$
                  minItems: 1
                alternateNamesAttestation:
                  type: boolean
                alternateNames:
                  type:
                    - string
                    - "null"
                criminalBackgroundAttestation:
                  type: boolean
                proofOfAddressUploadId:
                  type: string
                  format: uuid
                proofOfAddressSwornStatement:
                  type: object
                  properties:
                    agreed:
                      type: boolean
                      enum:
                        - true
                    signature:
                      type: string
                    locale:
                      type: string
                      enum:
                        - en
                        - es
                  required:
                    - agreed
                    - signature
                address:
                  allOf:
                    - $ref: "#/components/schemas/Address"
                    - type: object
                      properties:
                        country:
                          type: string
                          pattern: ^[A-Z]{2}$
                phoneNumber:
                  type: string
                  pattern: ^\+[1-9]\d{7,14}$
              required:
                - givenName
                - surname
                - email
                - dateOfBirth
                - sex
                - countryOfBirth
                - citizenships
                - alternateNamesAttestation
                - criminalBackgroundAttestation
                - address
                - phoneNumber
            information:
              type: object
              properties:
                residencyReason:
                  type:
                    - string
                    - "null"
                referralSource:
                  type:
                    - string
                    - "null"
          required:
            - residencyType
            - personalDetails
        referralCode:
          type: string
          minLength: 1
        redirectUrl:
          type: string
          format: uri
      required:
        - applicationData
    UpdatePartnerResidencyApplicationRequest:
      type: object
      properties:
        expectedVersion:
          type: integer
          exclusiveMinimum: 0
        applicationData:
          type: object
          properties:
            residencyType:
              type: string
              enum:
                - limited_e_resident
                - e_resident
                - resident_annual
            personalDetails:
              type: object
              properties:
                givenName:
                  type: string
                  minLength: 1
                surname:
                  type: string
                  minLength: 1
                email:
                  type: string
                  format: email
                dateOfBirth:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                sex:
                  type: string
                  enum:
                    - male
                    - female
                countryOfBirth:
                  type: string
                  pattern: ^[A-Z]{2}$
                citizenships:
                  type: array
                  items:
                    type: string
                    pattern: ^[A-Z]{2}$
                  minItems: 1
                alternateNamesAttestation:
                  type: boolean
                alternateNames:
                  type:
                    - string
                    - "null"
                criminalBackgroundAttestation:
                  type: boolean
                proofOfAddressUploadId:
                  type: string
                  format: uuid
                proofOfAddressSwornStatement:
                  type: object
                  properties:
                    agreed:
                      type: boolean
                      enum:
                        - true
                    signature:
                      type: string
                    locale:
                      type: string
                      enum:
                        - en
                        - es
                  required:
                    - agreed
                    - signature
                address:
                  allOf:
                    - $ref: "#/components/schemas/Address"
                    - type: object
                      properties:
                        country:
                          type: string
                          pattern: ^[A-Z]{2}$
                phoneNumber:
                  type: string
                  pattern: ^\+[1-9]\d{7,14}$
              required:
                - givenName
                - surname
                - email
                - dateOfBirth
                - sex
                - countryOfBirth
                - citizenships
                - alternateNamesAttestation
                - criminalBackgroundAttestation
                - address
                - phoneNumber
            information:
              type: object
              properties:
                residencyReason:
                  type:
                    - string
                    - "null"
                referralSource:
                  type:
                    - string
                    - "null"
          required:
            - residencyType
            - personalDetails
        referralCode:
          type: string
          minLength: 1
        redirectUrl:
          type: string
          format: uri
      required:
        - expectedVersion
        - applicationData
    PartnerCheckoutRequest:
      type: object
      properties:
        paymentProvider:
          type: string
          enum:
            - stripe
            - stripe-crypto
            - blink
            - blink-onchain
            - lnbits
            - solana-pay-ptc
        paymentMethod:
          type: object
          additionalProperties: {}
        email:
          type:
            - string
            - "null"
          format: email
        redirectUrl:
          type: string
          format: uri
      required:
        - redirectUrl
    PartnerVoucherRequest:
      type: object
      properties:
        voucherCode:
          type: string
          minLength: 1
      required:
        - voucherCode
    NaturalPerson:
      type:
        - object
        - "null"
      properties:
        givenName:
          type: string
        surname:
          type: string
        name:
          type: string
        residentPermitNumber:
          type:
            - string
            - "null"
          pattern: ^[89]\d{13}$
          description: 14-digit Resident Permit Number.
        countryOfBirth:
          type:
            - string
            - "null"
        citizenships:
          type: array
          items:
            type: string
        dateOfBirth:
          type:
            - string
            - "null"
          format: date-time
        sex:
          type:
            - string
            - "null"
          enum:
            - M
            - F
            - null
        address:
          type:
            - object
            - "null"
          properties:
            country:
              type: string
            line1:
              type: string
            line2:
              type:
                - string
                - "null"
            city:
              type: string
            state:
              type:
                - string
                - "null"
            postalCode:
              type: string
          required:
            - country
            - line1
            - line2
            - city
            - state
            - postalCode
        phoneNumber:
          type:
            - string
            - "null"
      required:
        - givenName
        - surname
        - name
        - residentPermitNumber
        - countryOfBirth
        - citizenships
        - dateOfBirth
        - sex
        - address
        - phoneNumber
    IdVerification:
      type: object
      properties:
        id:
          type:
            - string
            - "null"
          format: uuid
        type:
          type:
            - string
            - "null"
          enum:
            - veriff
        documentType:
          type:
            - string
            - "null"
          enum:
            - passport
            - national_id
            - drivers_license
            - residence_permit
            - visa
            - other
            - null
        date:
          type:
            - string
            - "null"
          format: date-time
        status:
          type:
            - string
            - "null"
          enum:
            - approved
        documents:
          type: object
          properties:
            documentFront:
              type:
                - string
                - "null"
              format: uri
            documentBack:
              type:
                - string
                - "null"
              format: uri
            face:
              type:
                - string
                - "null"
              format: uri
          required:
            - documentFront
            - documentBack
            - face
      required:
        - id
        - type
        - documentType
        - date
        - status
        - documents
    Residency:
      type: object
      properties:
        wasEverResident:
          type: boolean
        activeResidency:
          type:
            - object
            - "null"
          properties:
            effectiveDate:
              type: string
              format: date-time
            terminationDate:
              type:
                - string
                - "null"
              format: date-time
            residencyType:
              type: string
              enum:
                - Limited e-Resident
                - e-Resident
                - Resident
            version:
              type: string
          required:
            - effectiveDate
            - terminationDate
            - residencyType
            - version
      required:
        - wasEverResident
        - activeResidency
    TaxSubject:
      type: object
      properties:
        type:
          type: string
          enum:
            - natural_person
            - legal_entity
        id:
          type: string
          format: uuid
        name:
          type: string
        residentPermitNumber:
          type:
            - string
            - "null"
          pattern: ^[89]\d{13}$
          description: 14-digit Resident Permit Number.
      required:
        - type
        - id
        - name
        - residentPermitNumber
    TaxFiling:
      type: object
      properties:
        id:
          type: string
          format: uuid
        subject:
          $ref: "#/components/schemas/TaxSubject"
        type:
          type: string
          enum:
            - income
            - vat
        period:
          type: object
          properties:
            year:
              type: integer
            quarter:
              type:
                - integer
                - "null"
              minimum: 1
              maximum: 4
          required:
            - year
            - quarter
        submittedAt:
          type: string
          format: date-time
        amended:
          type: boolean
        currency:
          type: string
          enum:
            - usd
            - btc
        accountingMethod:
          type:
            - string
            - "null"
        reported:
          type: object
          properties:
            grossIncome:
              type:
                - string
                - "null"
            taxCredit:
              type:
                - string
                - "null"
            taxWithheld:
              type:
                - string
                - "null"
          required:
            - grossIncome
            - taxCredit
            - taxWithheld
        usdEquivalent:
          type:
            - object
            - "null"
          properties:
            grossIncome:
              type:
                - string
                - "null"
            taxCredit:
              type:
                - string
                - "null"
            taxWithheld:
              type:
                - string
                - "null"
          required:
            - grossIncome
            - taxCredit
            - taxWithheld
        taxLiability:
          type:
            - string
            - "null"
        exchangeRate:
          type:
            - object
            - "null"
          properties:
            btcUsdRate:
              type:
                - string
                - "null"
            capturedAt:
              type:
                - string
                - "null"
              format: date-time
            source:
              type:
                - string
                - "null"
          required:
            - btcUsdRate
            - capturedAt
            - source
        invoice:
          type:
            - object
            - "null"
          properties:
            id:
              type: string
              format: uuid
            status:
              type: string
          required:
            - id
            - status
        availableDocuments:
          type: array
          items:
            type: string
            enum:
              - assessment
              - return
      required:
        - id
        - subject
        - type
        - period
        - submittedAt
        - amended
        - currency
        - accountingMethod
        - reported
        - usdEquivalent
        - taxLiability
        - exchangeRate
        - invoice
        - availableDocuments
    ReferralListResponse:
      type: object
      properties:
        code:
          type: string
        naturalPersons:
          type: array
          items:
            type: object
            properties:
              fullName:
                type:
                  - string
                  - "null"
              referredAt:
                type: string
                format: date-time
            required:
              - fullName
              - referredAt
        legalEntities:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              rpn:
                type: string
                pattern: ^[89]\d{13}$
                description: 14-digit Resident Permit Number.
              referredAt:
                type:
                  - string
                  - "null"
                format: date-time
            required:
              - name
              - rpn
              - referredAt
      required:
        - code
        - naturalPersons
        - legalEntities
    CreateVisitorPassResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: object
          properties:
            ok:
              type: boolean
              enum:
                - true
          required:
            - ok
      required:
        - success
        - data
    CreateVisitorPassRequest:
      type: object
      properties:
        firstName:
          type: string
          minLength: 1
        lastName:
          type: string
          minLength: 1
        dateOfBirth:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
        email:
          type: string
          maxLength: 320
          format: email
        signature:
          type: string
          minLength: 1
        consentToBackgroundCheck:
          type: boolean
        referralSource:
          type: string
          minLength: 1
      required:
        - firstName
        - lastName
        - dateOfBirth
        - email
        - signature
        - consentToBackgroundCheck
        - referralSource
    OpenidConfiguration:
      type: object
      properties:
        issuer:
          type: string
          format: uri
        authorization_endpoint:
          type: string
          format: uri
        device_authorization_endpoint:
          type: string
          format: uri
        token_endpoint:
          type: string
          format: uri
        userinfo_endpoint:
          type: string
          format: uri
        jwks_uri:
          type: string
          format: uri
        registration_endpoint:
          type: string
          format: uri
        revocation_endpoint:
          type: string
          format: uri
        introspection_endpoint:
          type: string
          format: uri
        scopes_supported:
          type: array
          items:
            type: string
        response_types_supported:
          type: array
          items:
            type: string
        grant_types_supported:
          type: array
          items:
            type: string
        subject_types_supported:
          type: array
          items:
            type: string
        id_token_signing_alg_values_supported:
          type: array
          items:
            type: string
        token_endpoint_auth_methods_supported:
          type: array
          items:
            type: string
        claims_supported:
          type: array
          items:
            type: string
        code_challenge_methods_supported:
          type: array
          items:
            type: string
        service_documentation:
          type: string
          format: uri
      required:
        - issuer
        - authorization_endpoint
        - device_authorization_endpoint
        - token_endpoint
        - userinfo_endpoint
        - jwks_uri
        - revocation_endpoint
        - introspection_endpoint
        - scopes_supported
        - response_types_supported
        - grant_types_supported
        - subject_types_supported
        - id_token_signing_alg_values_supported
        - token_endpoint_auth_methods_supported
        - claims_supported
        - code_challenge_methods_supported
        - service_documentation
      additionalProperties: {}
    JsonWebKeySet:
      type: object
      properties:
        keys:
          type: array
          items:
            type: object
            properties:
              kty:
                type: string
              use:
                type: string
              kid:
                type: string
              alg:
                type: string
              n:
                type: string
              e:
                type: string
            required:
              - kty
              - kid
            additionalProperties: {}
      required:
        - keys
    OAuthDeviceAuthorizationResponse:
      type: object
      properties:
        device_code:
          type: string
        user_code:
          type: string
        verification_uri:
          type: string
          format: uri
        verification_uri_complete:
          type: string
          format: uri
        expires_in:
          type: integer
          exclusiveMinimum: 0
        interval:
          type: integer
          exclusiveMinimum: 0
      required:
        - device_code
        - user_code
        - verification_uri
        - verification_uri_complete
        - expires_in
        - interval
    OAuthTokenResponse:
      type: object
      properties:
        access_token:
          type: string
        token_type:
          type: string
          enum:
            - Bearer
        expires_in:
          type: integer
          exclusiveMinimum: 0
        refresh_token:
          type: string
        id_token:
          type: string
        scope:
          type: string
      required:
        - access_token
        - token_type
        - expires_in
    OAuthTokenRequest:
      oneOf:
        - type: object
          properties:
            grant_type:
              type: string
              enum:
                - authorization_code
            code:
              type: string
            redirect_uri:
              type: string
              format: uri
            code_verifier:
              type: string
            client_id:
              type: string
              description: Required with client_secret_post; omit when using HTTP Basic.
            client_secret:
              type: string
              description: Required with client_secret_post; omit when using HTTP Basic.
          required:
            - grant_type
            - code
            - redirect_uri
        - type: object
          properties:
            grant_type:
              type: string
              enum:
                - refresh_token
            refresh_token:
              type: string
            scope:
              type: string
            client_id:
              type: string
              description: Required with client_secret_post; omit when using HTTP Basic.
            client_secret:
              type: string
              description: Required with client_secret_post; omit when using HTTP Basic.
          required:
            - grant_type
            - refresh_token
        - type: object
          properties:
            grant_type:
              type: string
              enum:
                - urn:ietf:params:oauth:grant-type:device_code
            device_code:
              type: string
            client_id:
              type: string
              description: Public client identifier; no client secret is sent.
          required:
            - grant_type
            - device_code
            - client_id
    OAuthUserinfo:
      type: object
      properties:
        sub:
          type: string
        name:
          type: string
        given_name:
          type: string
        family_name:
          type: string
        picture:
          type: string
          format: uri
        email:
          type: string
          format: email
        email_verified:
          type: boolean
      required:
        - sub
      additionalProperties: {}
    OAuthIntrospectionResponse:
      type: object
      properties:
        active:
          type: boolean
        scope:
          type: string
        client_id:
          type: string
        username:
          type: string
        token_type:
          type: string
        exp:
          type: integer
        iat:
          type: integer
        sub:
          type: string
        aud:
          anyOf:
            - type: string
            - type: array
              items:
                type: string
        iss:
          type: string
      required:
        - active
      additionalProperties: {}
    LegacyCouponPaymentRequest:
      type: object
      properties:
        couponCode:
          type: string
          minLength: 1
      required:
        - couponCode
  parameters: {}
paths:
  /api/v1/verify_rpn:
    post:
      operationId: verifyRpn
      tags:
        - Verification
      summary: Verify whether an RPN exists and is active
      description: |-
        Look up a Resident Permit Number and report whether it belongs to a
        legal entity, a natural person, or is unknown — and whether the
        resident currently has an active residency.

        Rate-limited to 5,000 requests per 24 hours and 50 per minute, per
        API key. Exceeding either bound returns `429`.

        Accepts standard API keys (`sk-`) and Agent Keys (`ak-`) holding the
        `agent:verify_rpn` scope.
      security:
        - standardApiKey: []
        - agentKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VerifyRpnRequest"
      responses:
        "200":
          description: Lookup result.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VerifyRpnResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-verify-rpn
      x-sidebar-title: Verify RPN
  /api/v1/registries/legal_entities/search:
    post:
      operationId: searchLegalEntities
      tags:
        - Legal entities
      summary: Search the legal-entity registry
      description: Performs a case-insensitive name search and partial RPN match. Accepts standard and appropriately scoped Agent Keys.
      security:
        - standardApiKey: []
        - agentKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchLegalEntitiesRequest"
      responses:
        "200":
          description: Matching legal entities.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchLegalEntitiesResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-search-entities
      x-sidebar-title: Search registry
  /api/v1/legal_entities/{id}:
    get:
      operationId: getLegalEntity
      tags:
        - Legal entities
      summary: Get a legal entity
      security:
        - standardApiKey: []
        - agentKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
      responses:
        "200":
          description: Legal-entity record.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/LegalEntity"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: get-legal-entities-id
      x-sidebar-title: Get by ID
  /api/v1/legal_entities/{id}/documents:
    get:
      operationId: getLegalEntityDocuments
      tags:
        - Legal entities
      summary: List documents for a legal entity
      security:
        - standardApiKey: []
        - agentKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
      responses:
        "200":
          description: Documents for the legal entity.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Document"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: get-legal-entities-id-documents
      x-sidebar-title: Get documents
  /api/v1/legal_entity_applications:
    get:
      operationId: listLegalEntityApplications
      tags:
        - Legal-entity applications
      summary: List legal-entity applications
      security:
        - standardApiKey: []
        - agentKey: []
      responses:
        "200":
          description: Applications visible to the caller.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/LegalEntityApplication"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: get-legal-entity-applications
      x-sidebar-title: List
    post:
      operationId: createLegalEntityApplication
      tags:
        - Legal-entity applications
      summary: Create a legal-entity application
      security:
        - standardApiKey: []
        - agentKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateLegalEntityApplicationRequest"
      responses:
        "200":
          description: Created application and next steps.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateLegalEntityApplicationResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-legal-entity-applications
      x-sidebar-title: Create
  /api/v1/legal_entity_applications/{id}:
    get:
      operationId: getLegalEntityApplication
      tags:
        - Legal-entity applications
      summary: Get a legal-entity application
      security:
        - standardApiKey: []
        - agentKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
      responses:
        "200":
          description: Application record.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/LegalEntityApplication"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: get-legal-entity-applications-id
      x-sidebar-title: Get
  /api/v1/legal_entity_applications/{id}/pay/voucher:
    post:
      operationId: payLegalEntityApplicationWithVoucher
      tags:
        - Legal-entity applications
      summary: Pay a legal-entity application with a voucher
      security:
        - standardApiKey: []
        - agentKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VoucherPaymentRequest"
      responses:
        "200":
          description: Voucher applied.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-legal-entity-applications-id-pay-voucher
      x-sidebar-title: Pay with voucher
  /api/v1/legal_entity_applications/{id}/checkout_session:
    post:
      operationId: createLegalEntityApplicationCheckout
      tags:
        - Legal-entity applications
      summary: Create a hosted checkout session
      security:
        - standardApiKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CheckoutRequest"
      responses:
        "200":
          description: Checkout session.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CheckoutResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-legal-entity-applications-id-checkout-session
      x-sidebar-title: Hosted checkout
  /api/v1/partner/residency_applications:
    get:
      operationId: listPartnerResidencyApplications
      tags:
        - Partner residency applications
      summary: List partner residency applications
      security:
        - partnerKey: []
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            example: 50
          required: false
          name: limit
          in: query
        - schema:
            type: string
            format: uuid
          required: false
          name: cursor
          in: query
      responses:
        "200":
          description: Applications owned by this Partner Integration.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/PartnerResidencyApplication"
                  pagination:
                    type: object
                    properties:
                      limit:
                        type: integer
                        minimum: 1
                        maximum: 100
                      nextCursor:
                        type:
                          - string
                          - "null"
                        format: uuid
                    required:
                      - limit
                      - nextCursor
                required:
                  - data
                  - pagination
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Partner API rate limit exceeded.
          headers:
            Retry-After:
              required: true
              description: Seconds until the partner client should retry.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: get-residency-applications
      x-sidebar-title: List applications
    post:
      operationId: createPartnerResidencyApplication
      tags:
        - Partner residency applications
      summary: Create a partner residency application
      security:
        - partnerKey: []
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Makes retried partner write requests safe.
          required: false
          description: Makes retried partner write requests safe.
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreatePartnerResidencyApplicationRequest"
      responses:
        "200":
          description: Application created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PartnerResidencyApplication"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Partner API rate limit exceeded.
          headers:
            Retry-After:
              required: true
              description: Seconds until the partner client should retry.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-residency-applications
      x-sidebar-title: Create application
  /api/v1/partner/residency_applications/{id}:
    get:
      operationId: getPartnerResidencyApplication
      tags:
        - Partner residency applications
      summary: Get a partner residency application
      security:
        - partnerKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
      responses:
        "200":
          description: Application record.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PartnerResidencyApplication"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Partner API rate limit exceeded.
          headers:
            Retry-After:
              required: true
              description: Seconds until the partner client should retry.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: get-residency-applications-id
      x-sidebar-title: Get application
    patch:
      operationId: updatePartnerResidencyApplication
      tags:
        - Partner residency applications
      summary: Update a draft partner residency application
      security:
        - partnerKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            description: Makes retried partner write requests safe.
          required: false
          description: Makes retried partner write requests safe.
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdatePartnerResidencyApplicationRequest"
      responses:
        "200":
          description: Updated application.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PartnerResidencyApplication"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Partner API rate limit exceeded.
          headers:
            Retry-After:
              required: true
              description: Seconds until the partner client should retry.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: patch-residency-applications-id
      x-sidebar-title: Update application
  /api/v1/uploads/proof_of_address:
    post:
      operationId: uploadProofOfAddress
      tags:
        - Partner residency applications
      summary: Upload proof of address
      security:
        - partnerKey: []
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Makes retried partner write requests safe.
          required: false
          description: Makes retried partner write requests safe.
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                applicationId:
                  type: string
                  format: uuid
                file:
                  type: string
                  format: binary
              required:
                - applicationId
                - file
      responses:
        "200":
          description: Upload metadata.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      applicationId:
                        type: string
                        format: uuid
                      contentType:
                        type: string
                      size:
                        type: integer
                        minimum: 0
                    required:
                      - id
                      - applicationId
                      - contentType
                      - size
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Partner API rate limit exceeded.
          headers:
            Retry-After:
              required: true
              description: Seconds until the partner client should retry.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-uploads-proof-of-address
      x-sidebar-title: Upload proof of address
  /api/v1/uploads/proof_of_address/{id}:
    get:
      operationId: downloadProofOfAddress
      tags:
        - Partner residency applications
      summary: Download proof of address
      security:
        - partnerKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
      responses:
        "200":
          description: Proof-of-address file returned through an authenticated endpoint.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Partner API rate limit exceeded.
          headers:
            Retry-After:
              required: true
              description: Seconds until the partner client should retry.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: get-uploads-proof-of-address-id
      x-sidebar-title: Download proof of address
  /api/v1/partner/residency_applications/{id}/checkout_session:
    post:
      operationId: createPartnerResidencyApplicationCheckout
      tags:
        - Partner residency applications
      summary: Create a partner hosted-checkout session
      security:
        - partnerKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            description: Makes retried partner write requests safe.
          required: false
          description: Makes retried partner write requests safe.
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PartnerCheckoutRequest"
      responses:
        "200":
          description: Checkout session.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CheckoutResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Partner API rate limit exceeded.
          headers:
            Retry-After:
              required: true
              description: Seconds until the partner client should retry.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-residency-applications-id-checkout-session
      x-sidebar-title: Hosted checkout
  /api/v1/partner/residency_applications/{id}/pay/voucher:
    post:
      operationId: payPartnerResidencyApplicationWithVoucher
      tags:
        - Partner residency applications
      summary: Pay a partner application with a voucher
      security:
        - partnerKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            description: Makes retried partner write requests safe.
          required: false
          description: Makes retried partner write requests safe.
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PartnerVoucherRequest"
      responses:
        "200":
          description: Voucher applied.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Partner API rate limit exceeded.
          headers:
            Retry-After:
              required: true
              description: Seconds until the partner client should retry.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-residency-applications-id-pay-voucher
      x-sidebar-title: Pay with voucher
  /api/v1/partner/residency_applications/{id}/submit:
    post:
      operationId: submitPartnerResidencyApplication
      tags:
        - Partner residency applications
      summary: Submit a partner residency application
      security:
        - partnerKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            description: Makes retried partner write requests safe.
          required: false
          description: Makes retried partner write requests safe.
          name: Idempotency-Key
          in: header
      responses:
        "200":
          description: Submitted application.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/PartnerResidencyApplication"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Partner API rate limit exceeded.
          headers:
            Retry-After:
              required: true
              description: Seconds until the partner client should retry.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-residency-applications-id-submit
      x-sidebar-title: Submit application
  /api/v1/me/natural-person:
    get:
      operationId: getNaturalPerson
      tags:
        - Authenticated person
      summary: Get the authenticated natural person
      security:
        - oauth2:
            - eprospera:person.details.read
        - agentKey: []
      responses:
        "200":
          description: Natural-person details.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NaturalPerson"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-get-natural-person
      x-sidebar-title: Natural person
  /api/v1/me/natural-person/id-verification:
    get:
      operationId: getNaturalPersonIdVerification
      tags:
        - Authenticated person
      summary: Get ID-verification artifacts
      security:
        - oauth2:
            - eprospera:person.id_verification.read
        - agentKey: []
      responses:
        "200":
          description: ID-verification details and signed artifact URLs.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IdVerification"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-get-id-verification
      x-sidebar-title: ID verification
  /api/v1/me/natural-person/residency:
    get:
      operationId: getNaturalPersonResidency
      tags:
        - Authenticated person
      summary: Get natural-person residency status
      security:
        - oauth2:
            - eprospera:person.residency.read
        - agentKey: []
      responses:
        "200":
          description: Residency status.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Residency"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-get-natural-person-residency
      x-sidebar-title: Residency
  /api/v1/me/legal-entities:
    get:
      operationId: listConsentedLegalEntities
      tags:
        - Consented legal entities
      summary: List consented legal entities
      security:
        - oauth2:
            - eprospera:entity.read
      responses:
        "200":
          description: Consented entities.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/LegalEntity"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-get-legal-entities
      x-sidebar-title: Legal entities
  /api/v1/me/legal-entities/{id}:
    get:
      operationId: getConsentedLegalEntity
      tags:
        - Consented legal entities
      summary: Get a consented legal entity
      security:
        - oauth2:
            - eprospera:entity.read
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
      responses:
        "200":
          description: Consented legal entity.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/LegalEntity"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-get-legal-entities-id
      x-sidebar-title: Legal entity by ID
  /api/v1/me/legal-entities/{id}/documents:
    get:
      operationId: getConsentedLegalEntityDocuments
      tags:
        - Consented legal entities
      summary: List documents for a consented legal entity
      security:
        - oauth2:
            - eprospera:entity.documents.read
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
      responses:
        "200":
          description: Documents for the entity.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Document"
                required:
                  - data
                description: Successful response.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-get-legal-entities-id-documents
      x-sidebar-title: Legal entity documents
  /api/v1/me/tax/summary:
    get:
      operationId: getTaxSummary
      tags:
        - Taxes
      summary: Get tax obligations and lump-sum election status
      security:
        - oauth2:
            - eprospera:person.tax.read
        - oauth2:
            - eprospera:entity.tax.read
      parameters:
        - schema:
            anyOf:
              - type: string
                enum:
                  - personal
              - type: string
                format: uuid
          required: false
          name: subject
          in: query
      responses:
        "200":
          description: Authorized tax subjects and obligations.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      subjects:
                        type: array
                        items:
                          type: object
                          properties:
                            subject:
                              $ref: "#/components/schemas/TaxSubject"
                            obligations:
                              type: array
                              items:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - income
                                      - vat
                                  period:
                                    type: object
                                    properties:
                                      year:
                                        type: integer
                                      quarter:
                                        type:
                                          - integer
                                          - "null"
                                        minimum: 1
                                        maximum: 4
                                    required:
                                      - year
                                      - quarter
                                  dueDate:
                                    type: string
                                    format: date-time
                                  status:
                                    type: string
                                    enum:
                                      - open
                                      - overdue
                                  filingId:
                                    type:
                                      - string
                                      - "null"
                                    format: uuid
                                required:
                                  - type
                                  - period
                                  - dueDate
                                  - status
                                  - filingId
                            lumpSumElections:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    format: uuid
                                  taxYear:
                                    type:
                                      - integer
                                      - "null"
                                  effectiveDate:
                                    type: string
                                    format: date-time
                                  terminationDate:
                                    type:
                                      - string
                                      - "null"
                                    format: date-time
                                  status:
                                    type: string
                                    enum:
                                      - active
                                      - expired
                                required:
                                  - id
                                  - taxYear
                                  - effectiveDate
                                  - terminationDate
                                  - status
                          required:
                            - subject
                            - obligations
                            - lumpSumElections
                    required:
                      - subjects
                required:
                  - data
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-get-tax-summary
      x-sidebar-title: Tax status
  /api/v1/me/tax/filings:
    get:
      operationId: listTaxFilings
      tags:
        - Taxes
      summary: List submitted tax filings
      security:
        - oauth2:
            - eprospera:person.tax.read
        - oauth2:
            - eprospera:entity.tax.read
      parameters:
        - schema:
            anyOf:
              - type: string
                enum:
                  - personal
              - type: string
                format: uuid
          required: false
          name: subject
          in: query
        - schema:
            type: string
            enum:
              - income
              - vat
          required: false
          name: type
          in: query
        - schema:
            type: integer
            minimum: 2020
            maximum: 9999
          required: false
          name: year
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          required: false
          name: limit
          in: query
        - schema:
            type: string
          required: false
          name: cursor
          in: query
      responses:
        "200":
          description: Cursor-paginated submitted tax filings.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/TaxFiling"
                  meta:
                    type: object
                    properties:
                      nextCursor:
                        type:
                          - string
                          - "null"
                    required:
                      - nextCursor
                required:
                  - data
                  - meta
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-list-tax-filings
      x-sidebar-title: List tax filings
  /api/v1/me/tax/filings/{filingId}:
    get:
      operationId: getTaxFiling
      tags:
        - Taxes
      summary: Get a submitted tax filing
      security:
        - oauth2:
            - eprospera:person.tax.read
        - oauth2:
            - eprospera:entity.tax.read
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: filingId
          in: path
      responses:
        "200":
          description: Submitted tax filing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: "#/components/schemas/TaxFiling"
                required:
                  - data
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-get-tax-filing
      x-sidebar-title: Get tax filing
  /api/v1/me/tax/filings/{filingId}/documents/{document}:
    get:
      operationId: downloadTaxDocument
      tags:
        - Taxes
      summary: Download a tax assessment or filed income return
      security:
        - oauth2:
            - eprospera:person.tax.read
        - oauth2:
            - eprospera:entity.tax.read
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: filingId
          in: path
        - schema:
            type: string
            enum:
              - assessment
              - return
          required: true
          name: document
          in: path
        - schema:
            type: integer
            minimum: 1
            maximum: 5
          required: false
          name: history_years
          in: query
      responses:
        "200":
          description: PDF tax document.
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-download-tax-document
      x-sidebar-title: Download tax document
  /api/v1/referral-codes/{code}/referrals:
    get:
      operationId: listReferralCodeReferrals
      tags:
        - Referrals
      summary: List referrals for a referral code
      security:
        - standardApiKey: []
      parameters:
        - schema:
            type: string
            example: CATALYST2026
          required: true
          name: code
          in: path
      responses:
        "200":
          description: Paginated referrals.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReferralListResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: get-referral-codes-code-referrals
      x-sidebar-title: List referrals
  /api/v1/visitor_pass_applications:
    post:
      operationId: createVisitorPassApplication
      tags:
        - Visitor passes
      summary: Create a public Visitor Pass application
      description: This endpoint is intentionally unauthenticated. The applicant must provide consent and a signature.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateVisitorPassRequest"
      responses:
        "200":
          description: Visitor Pass application accepted.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateVisitorPassResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-visitor-pass-applications
      x-sidebar-title: Create visitor pass
  /.well-known/openid-configuration:
    get:
      operationId: getOpenidConfiguration
      tags:
        - OAuth 2.0 / OpenID Connect
      summary: Get OpenID Provider metadata
      security: []
      responses:
        "200":
          description: OpenID Provider metadata.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenidConfiguration"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-openid-configuration
      x-sidebar-title: OpenID configuration
  /api/oauth/.well-known/jwks.json:
    get:
      operationId: getOauthJwks
      tags:
        - OAuth 2.0 / OpenID Connect
      summary: Get OAuth signing keys
      security: []
      responses:
        "200":
          description: JSON Web Key Set.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/JsonWebKeySet"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-jwks
      x-sidebar-title: JWKS
  /api/oauth/authorize:
    get:
      operationId: oauthAuthorize
      tags:
        - OAuth 2.0 / OpenID Connect
      summary: Start the OAuth authorization-code flow
      security: []
      parameters:
        - schema:
            type: string
            enum:
              - code
          required: true
          name: response_type
          in: query
        - schema:
            type: string
          required: true
          name: client_id
          in: query
        - schema:
            type: string
            format: uri
          required: true
          name: redirect_uri
          in: query
        - schema:
            type: string
          required: true
          name: scope
          in: query
        - schema:
            type: string
          required: true
          name: state
          in: query
        - schema:
            type: string
          required: false
          name: code_challenge
          in: query
        - schema:
            type: string
            enum:
              - S256
          required: false
          name: code_challenge_method
          in: query
        - schema:
            type: string
          required: false
          name: nonce
          in: query
        - schema:
            type: string
            enum:
              - query
              - fragment
              - form_post
          required: false
          name: response_mode
          in: query
        - schema:
            type: string
          required: false
          name: prompt
          in: query
        - schema:
            type: integer
            minimum: 0
          required: false
          name: max_age
          in: query
        - schema:
            type: string
          required: false
          name: login_hint
          in: query
      responses:
        "200":
          description: HTML auto-submit response for response_mode=form_post.
          content:
            text/html:
              schema:
                type: string
        "303":
          description: Redirect to the exact registered client redirect URI.
          headers:
            Location:
              required: true
              description: The exact registered client redirect URI.
              schema:
                type: string
                format: uri
        "307":
          description: Internal redirect to portal login or consent.
          headers:
            Location:
              required: true
              description: The portal login or consent URL.
              schema:
                type: string
                format: uri
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-authorize
      x-sidebar-title: Authorize
  /api/oauth/device_authorization:
    post:
      operationId: oauthDeviceAuthorization
      tags:
        - OAuth 2.0 / OpenID Connect
      summary: Start an OAuth device authorization
      security: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                client_id:
                  type: string
                scope:
                  type: string
              required:
                - client_id
                - scope
      responses:
        "200":
          description: Device and user codes for browser authorization.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OAuthDeviceAuthorizationResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-device-authorization
      x-sidebar-title: Device authorization
  /api/oauth/token:
    post:
      operationId: oauthToken
      tags:
        - OAuth 2.0 / OpenID Connect
      summary: Exchange an authorization code, device code, or refresh token
      description: Use HTTP Basic client authentication when possible. client_secret_post remains supported for compatibility. Public device clients send client_id without a secret. Repeated parameters and multiple client authentication methods are rejected.
      security:
        - oauthClient: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/OAuthTokenRequest"
      responses:
        "200":
          description: OAuth tokens.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OAuthTokenResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-token
      x-sidebar-title: Token
  /api/oauth/userinfo:
    get:
      operationId: oauthUserinfo
      tags:
        - OAuth 2.0 / OpenID Connect
      summary: Get OpenID Connect user claims
      security:
        - oauth2:
            - openid
      responses:
        "200":
          description: Claims authorized by the access token.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OAuthUserinfo"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          headers:
            WWW-Authenticate:
              required: true
              description: Bearer challenge identifying a missing, expired, revoked, or otherwise invalid access token.
              schema:
                type: string
                example: Bearer error="invalid_token"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          headers:
            WWW-Authenticate:
              required: true
              description: Bearer challenge identifying the scope required to call UserInfo.
              schema:
                type: string
                example: Bearer error="insufficient_scope", scope="openid"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-userinfo
      x-sidebar-title: Userinfo
    post:
      operationId: oauthUserinfoPost
      tags:
        - OAuth 2.0 / OpenID Connect
      summary: Get OpenID Connect user claims
      description: POST variant of the OpenID Connect UserInfo endpoint.
      security:
        - oauth2:
            - openid
      responses:
        "200":
          description: Claims authorized by the access token.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OAuthUserinfo"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          headers:
            WWW-Authenticate:
              required: true
              description: Bearer challenge identifying a missing, expired, revoked, or otherwise invalid access token.
              schema:
                type: string
                example: Bearer error="invalid_token"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          headers:
            WWW-Authenticate:
              required: true
              description: Bearer challenge identifying the scope required to call UserInfo.
              schema:
                type: string
                example: Bearer error="insufficient_scope", scope="openid"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-userinfo-post
      x-sidebar-title: Userinfo (POST)
  /api/oauth/revoke:
    post:
      operationId: oauthRevoke
      tags:
        - OAuth 2.0 / OpenID Connect
      summary: Revoke an OAuth token
      security:
        - oauthClient: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                token:
                  type: string
                token_type_hint:
                  type: string
                client_id:
                  type: string
                  description: Required with client_secret_post; omit when using HTTP Basic.
                client_secret:
                  type: string
                  description: Required with client_secret_post; omit when using HTTP Basic.
              required:
                - token
      responses:
        "200":
          description: Token revoked, or already inactive.
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-revoke
      x-sidebar-title: Revoke
  /api/oauth/introspect:
    post:
      operationId: oauthIntrospect
      tags:
        - OAuth 2.0 / OpenID Connect
      summary: Introspect an OAuth token
      security:
        - oauthClient: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                token:
                  type: string
                token_type_hint:
                  type: string
                client_id:
                  type: string
                  description: Required with client_secret_post; omit when using HTTP Basic.
                client_secret:
                  type: string
                  description: Required with client_secret_post; omit when using HTTP Basic.
              required:
                - token
      responses:
        "200":
          description: Token activity and metadata.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OAuthIntrospectionResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-introspect
      x-sidebar-title: Introspect
  /api/v1/legal_entity_applications/{id}/pay/coupon:
    post:
      operationId: payLegalEntityApplicationWithCoupon
      tags:
        - Deprecated aliases
      summary: Deprecated legal-entity coupon-payment alias
      description: Use `/api/v1/legal_entity_applications/{id}/pay/voucher` with `voucherCode` instead.
      deprecated: true
      security:
        - standardApiKey: []
        - agentKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegacyCouponPaymentRequest"
      responses:
        "200":
          description: Coupon alias accepted.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-legal-entity-applications-id-pay-coupon
      x-sidebar-title: Legal-entity coupon alias
  /api/v1/partner/residency_applications/{id}/pay/coupon:
    post:
      operationId: payPartnerResidencyApplicationWithCoupon
      tags:
        - Deprecated aliases
      summary: Deprecated partner coupon-payment alias
      description: Use `/api/v1/partner/residency_applications/{id}/pay/voucher` with `voucherCode` instead.
      deprecated: true
      security:
        - partnerKey: []
      parameters:
        - schema:
            type: string
            format: uuid
            example: 4e368230-84e3-4cb8-9225-a6d972e425fc
          required: true
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            description: Makes retried partner write requests safe.
          required: false
          description: Makes retried partner write requests safe.
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LegacyCouponPaymentRequest"
      responses:
        "200":
          description: Coupon alias accepted.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentResponse"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Partner API rate limit exceeded.
          headers:
            Retry-After:
              required: true
              description: Seconds until the partner client should retry.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: post-residency-applications-id-pay-coupon
      x-sidebar-title: Partner coupon alias
  /api/v1/me/natural-person/id_verification:
    get:
      operationId: getNaturalPersonIdVerificationLegacy
      tags:
        - Deprecated aliases
      summary: Deprecated ID-verification underscore alias
      description: Use `/api/v1/me/natural-person/id-verification` instead.
      deprecated: true
      security:
        - oauth2:
            - eprospera:person.id_verification.read
        - agentKey: []
      responses:
        "200":
          description: ID-verification details and signed artifact URLs.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IdVerification"
        "400":
          description: Validation error or precondition failure.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid credential.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Credential lacks the required scope (Agent Key) or insufficient OAuth scope.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "404":
          description: Resource does not exist or is invisible to the caller. The two are intentionally indistinguishable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "409":
          description: Conflicting state (e.g. legal-entity name already taken).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "429":
          description: Rate limit exceeded. No `Retry-After` header is currently emitted; back off exponentially.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-get-id-verification-legacy
      x-sidebar-title: ID verification underscore alias
  /api/oauth/.well-known/openid-configuration:
    get:
      operationId: getOpenidConfigurationLegacy
      tags:
        - Deprecated aliases
      summary: Deprecated OpenID-configuration alias
      description: Use `/.well-known/openid-configuration` instead.
      deprecated: true
      security: []
      responses:
        "200":
          description: OpenID Provider metadata.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenidConfiguration"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-openid-configuration-legacy
      x-sidebar-title: OpenID configuration alias
  /.well-known/jwks.json:
    get:
      operationId: getOauthJwksLegacy
      tags:
        - Deprecated aliases
      summary: Deprecated root JWKS alias
      description: Use `/api/oauth/.well-known/jwks.json` instead.
      deprecated: true
      security: []
      responses:
        "200":
          description: JSON Web Key Set.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/JsonWebKeySet"
        "500":
          description: Server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
      x-docs-slug: oauth-jwks-legacy
      x-sidebar-title: JWKS root alias
webhooks: {}
