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

# Ownership history for one key, addressed by the key

> The same history as the by-assignment route, addressed by the key sent as held, normalized exactly as the lookup normalizes it. It needs no live assignment, so the history of a removed key — the removal included — stays readable. Most recent first. A read: it changes nothing and takes no X-Idempotency. The key travels in the body because it is personal data; a malformed key is refused 422 JDC-0104 with a fixed sentence that never repeats it.



## OpenAPI

````yaml /en/openapi/v3-current/jd-courier.yaml post /v1/ownership/audit/lookup
openapi: 3.1.0
info:
  description: >-
    The JD Courier API. Operators use it to manage the engines, the ownership
    map, the delivery modes and bypass of each rail, the retained messages, the
    SPB send journal and reconciliation. Engines use it to resolve the owner of
    a key, claim their Pix Automático recurrences and declare their Pix
    Automático payment legs.
  title: JD Courier API
  version: v1.0.0
servers: []
security:
  - BearerAuth: []
tags:
  - description: >-
      The engine registry: the cores that consume the JD channel through the
      Courier, each with its participant set
    name: Engines
  - description: 'The ownership map: which engine owns each key. Every change is audited.'
    name: ownership
  - description: >-
      The rails: what each declares about itself, its state per tenant, and the
      bypass declaration
    name: channels
  - description: >-
      The engines' side of the ownership map: resolution for the on-us gate,
      authoritative and never advisory, the claim of a Pix Automático recurrence
      the engine holds, and the declaration of a payment leg it holds.
    name: ownership-query
  - description: >-
      The durable message store: redelivery on demand, without asking the vendor
      again
    name: ledger
  - description: >-
      Count reconciliation per rail: E(m) = C(m) + T(m) + R(m), the sequence
      gaps it saw, and the sends whose return leg never arrived
    name: assurance
  - description: >-
      The SPB send journal: every send, written before it leaves, and the sends
      whose outcome is unknown. A by-hand close records an operator's finding
      and never resends.
    name: send-journal
  - description: >-
      Per-(tenant, channel) state an operator acts on: lifting a durable channel
      halt
    name: channel-leases
  - description: >-
      Messages the Courier holds because no engine could receive them. A routing
      or delivery retention leaves by itself once its cause lifts, or when an
      operator asks for its routing decision to be run again.
    name: retained
paths:
  /v1/ownership/audit/lookup:
    post:
      tags:
        - ownership
      summary: Ownership history for one key, addressed by the key
      description: >-
        The same history as the by-assignment route, addressed by the key sent
        as held, normalized exactly as the lookup normalizes it. It needs no
        live assignment, so the history of a removed key — the removal included
        — stays readable. Most recent first. A read: it changes nothing and
        takes no X-Idempotency. The key travels in the body because it is
        personal data; a malformed key is refused 422 JDC-0104 with a fixed
        sentence that never repeats it.
      operationId: lookupOwnershipAudit
      parameters:
        - description: Page, 1-based.
          explode: false
          in: query
          name: page
          schema:
            default: 1
            description: Page, 1-based.
            format: int64
            minimum: 1
            type: integer
        - description: Items per page.
          explode: false
          in: query
          name: limit
          schema:
            default: 50
            description: Items per page.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OwnershipLookupRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnershipAuditPage'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Forbidden
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Service Unavailable
components:
  schemas:
    OwnershipLookupRequest:
      additionalProperties: false
      properties:
        account:
          description: >-
            ACCOUNT only: the account number, digits with an optional trailing
            check-digit letter.
          maxLength: 256
          type: string
        branch:
          description: >-
            ACCOUNT only: a current account's branch, 1 to 4 digits. Omit it, or
            send it empty, for a payment account, which has none; empty is never
            branch 0.
          maxLength: 256
          type: string
        keyKind:
          description: The kind of key.
          enum:
            - ACCOUNT
            - DOCUMENT
            - PIX_KEY_EMAIL
            - PIX_KEY_PHONE
            - PIX_KEY_RANDOM
            - PAYMENT_ID
            - PIX_RECURRENCE_ID
          type: string
        keyValue:
          description: >-
            The key as the caller holds it, for every kind except ACCOUNT. Do
            not pre-normalize.
          maxLength: 256
          minLength: 1
          type: string
      required:
        - keyKind
      type: object
    OwnershipAuditPage:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/OwnershipAuditEntry'
          type:
            - array
            - 'null'
        limit:
          format: int64
          minimum: 1
          type: integer
        page:
          format: int64
          minimum: 1
          type: integer
      required:
        - items
        - page
        - limit
      type: object
    Detail:
      additionalProperties: true
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    OwnershipAuditEntry:
      additionalProperties: false
      properties:
        actor:
          maxLength: 128
          type: string
        changedAt:
          format: date-time
          type: string
        keyKind:
          enum:
            - ACCOUNT
            - DOCUMENT
            - PIX_KEY_EMAIL
            - PIX_KEY_PHONE
            - PIX_KEY_RANDOM
            - PAYMENT_ID
            - PIX_RECURRENCE_ID
          type: string
        keyValue:
          maxLength: 256
          type: string
        newEngineId:
          description: Null when the assignment was removed.
          type:
            - string
            - 'null'
        previousEngineId:
          description: Null on the first assignment.
          type:
            - string
            - 'null'
        reason:
          maxLength: 512
          type:
            - string
            - 'null'
      required:
        - keyKind
        - keyValue
        - actor
        - changedAt
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.