> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onswitch.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# AML histories

> Returns paginated previous AML lookup history.



## OpenAPI

````yaml /openapi.json get /compliance/aml/history
openapi: 3.0.3
info:
  title: Receive stablecoin. Get fiat in seconds.
  description: Stablecoin collection and settlement layer.
  version: 1.0.0
  contact:
    name: Switch Labs
    email: contact@onswitch.xyz
  license:
    name: Proprietary
  x-tagGroups:
    - name: Institution
      tags:
        - Institution
    - name: Miscellaneous
      tags:
        - Miscellaneous
    - name: History
      tags:
        - History
    - name: Payment
      tags:
        - Payment
    - name: Webhook
      tags:
        - Webhook
    - name: Offramp
      tags:
        - Offramp
    - name: Onramp
      tags:
        - Onramp
    - name: Swap
      tags:
        - Swap
    - name: Developer
      tags:
        - Developer
    - name: Wallet
      tags:
        - Wallet
    - name: Compliance
      tags:
        - Compliance
servers:
  - url: https://api.onswitch.xyz
    description: Production server
security: []
tags:
  - name: Institution
    description: Institution discovery and bank or payment-rail lookup
  - name: Miscellaneous
    description: Requirements, coverage, assets, confirmation, and transaction status
  - name: History
    description: Payment history and summaries for the partner's account
  - name: Payment
    description: Saved payment beneficiaries, payment confirmation, and status
  - name: Webhook
    description: Webhook delivery history and callback resend
  - name: Offramp
    description: Offramp transaction endpoints for converting stablecoins to local currency
  - name: Onramp
    description: Onramp transaction endpoints for converting local currency to stablecoins
  - name: Swap
    description: Swap endpoints for exchanging between different stablecoin assets
  - name: Developer
    description: Developer fee balance and withdrawal
  - name: Wallet
    description: >-
      Wallet endpoints for creating and managing chain abstracted stablecoin
      wallets
  - name: Compliance
    description: AML compliance screening for PEP, sanctions, and other regulatory reasons
paths:
  /compliance/aml/history:
    get:
      tags:
        - Compliance
      summary: AML histories
      description: Returns paginated previous AML lookup history.
      operationId: getComplianceAMLHistory
      parameters:
        - name: status
          in: query
          required: false
          description: Filter by status
          schema:
            $ref: '#/components/schemas/ComplianceStatus'
        - name: category
          in: query
          required: false
          description: Filter by category
          schema:
            $ref: '#/components/schemas/ComplianceAMLCategory'
        - name: search
          in: query
          required: false
          description: Filter by reference
          schema:
            type: string
            maxLength: 200
        - name: start_date
          in: query
          required: false
          description: Filter by start date e.g 2026-01-01
          schema:
            type: string
        - name: end_date
          in: query
          required: false
          description: Filter by end date e.g 2026-01-01
          schema:
            type: string
        - name: page
          in: query
          required: false
          description: Results page number. Default 1.
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: limit
          in: query
          required: false
          description: Results per page. Default 10, maximum 100.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
      responses:
        '200':
          description: AML lookup history retrieved successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - timestamp
                  - data
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  timestamp:
                    type: string
                    format: date-time
                  data:
                    $ref: '#/components/schemas/ComplianceHistoryPage'
              example:
                success: true
                message: AML lookup history fetched successfully
                timestamp: '2026-05-13T22:06:37.088Z'
                data:
                  data:
                    - status: REJECTED
                      reference: 18a51cca-ed07-4a74-b1b7-03cceab33e23
                      details:
                        subject:
                          type: INDIVIDUAL
                          country: NG
                          name: tinubu bola
                          is_sandbox: false
                        matches:
                          - certainty: 92
                            name: Bola Ahmed Tinubu
                            flags:
                              - PEP
                            last_updated: '2024-10-11T12:50:30'
                          - certainty: 83
                            name: Bola Ahmed Tinubu Gcfr
                            flags:
                              - PEP
                            last_updated: '2026-04-26T13:01:02'
                      created_at: '2026-05-13T21:44:33.170Z'
                      updated_at: '2026-05-13T21:44:33.170Z'
                  page: 1
                  limit: 10
                  total: 1
                  pages: 1
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - ServiceKey: []
components:
  schemas:
    ComplianceStatus:
      type: string
      enum:
        - PENDING
        - REJECTED
        - APPROVED
        - REVIEW
    ComplianceAMLCategory:
      type: string
      enum:
        - INDIVIDUAL
        - BUSINESS
        - CRYPTO_WALLET
    ComplianceHistoryPage:
      type: object
      required:
        - data
        - page
        - limit
        - total
        - pages
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ComplianceHistoryItem'
        page:
          type: integer
        limit:
          type: integer
        total:
          type: integer
        pages:
          type: integer
    ComplianceHistoryItem:
      type: object
      additionalProperties: true
      properties:
        type:
          $ref: '#/components/schemas/ComplianceType'
        category:
          $ref: '#/components/schemas/ComplianceCategory'
        status:
          $ref: '#/components/schemas/ComplianceStatus'
        reference:
          type: string
        payload:
          type: object
          nullable: true
          additionalProperties: true
        details:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ComplianceLookupDetails'
        meta:
          type: object
          nullable: true
          additionalProperties: true
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
    ComplianceType:
      type: string
      enum:
        - KYC
        - KYB
        - AML
    ComplianceCategory:
      type: string
      enum:
        - INDIVIDUAL
        - BUSINESS
        - CRYPTO_WALLET
        - IDENTITY
    ComplianceLookupDetails:
      type: object
      additionalProperties: true
      properties:
        subject:
          $ref: '#/components/schemas/ComplianceAmlSubjectEcho'
        matches:
          type: array
          items:
            $ref: '#/components/schemas/ComplianceSanctionsMatchItem'
    ComplianceAmlSubjectEcho:
      type: object
      additionalProperties: true
      properties:
        type:
          $ref: '#/components/schemas/ComplianceAMLCategory'
        name:
          type: string
        country:
          type: string
        wallet_address:
          type: string
        is_sandbox:
          type: boolean
        date_of_birth:
          type: string
        date_of_incorporation:
          type: string
        registration_number:
          type: string
    ComplianceSanctionsMatchItem:
      type: object
      additionalProperties: true
      properties:
        certainty:
          type: integer
          minimum: 0
          maximum: 100
        name:
          type: string
          nullable: true
        flags:
          type: array
          items:
            type: string
        last_updated:
          type: string
          nullable: true
  responses:
    BadRequest:
      description: Bad request - Invalid input parameters or validation error
      content:
        application/json:
          schema:
            type: object
            required:
              - success
              - message
              - timestamp
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
                description: Error message describing what went wrong
              timestamp:
                type: string
                format: date-time
              data:
                description: Additional error details
                nullable: true
          example:
            success: false
            message: amount must be greater than 0 for the selected corridor
            timestamp: '2026-04-18T14:22:08.631Z'
            data: null
  securitySchemes:
    ServiceKey:
      type: apiKey
      in: header
      name: x-service-key
      description: Service key for API authentication

````