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

# Get a queued statement

> Required scope: `statements:read`.

The status of a queued statement and, once `status` is `completed`, its result (the same keys as the synchronous answer of `POST /v1/statements/extract`). Only your own workspace's statements are visible. An expired result answers 410 `statement_expired`. A job refused for a non-specimen file in the Sandbox carries `error_code: sandbox_specimen_required` with `error_message` and `error_message_fr`.



## OpenAPI

````yaml /openapi.json get /v1/statements/{statement_id}
openapi: 3.1.0
info:
  title: Sahl Partner API
  version: 0.2.0
  description: >-
    Server-to-server API for lenders and banks: document reading, verification,
    risk assessment, eID checks, Moroccan company (KYB) onboarding, bank
    statements, document requests, webhooks, registry checks, cases, scoring,
    KYC policy, webhook deliveries and bank connections. Authenticate with
    `Authorization: Bearer <API key>`. Paths are relative to the server URL. New
    workspaces start in sandbox.
servers:
  - url: https://app.sahlfinancial.com/api
    description: Single API host. Send environment=sandbox (the default) for test data.
security:
  - bearerAuth: []
tags:
  - name: KYC
    description: Read documents, verify a profile, assess risk, start an eID check.
  - name: Bank connections (Growth)
    description: >-
      Growth plan, switched on per workspace by Sahl. Sandbox simulation today;
      production answers 409 until a bank data provider is live.
  - name: KYB
    description: >-
      Moroccan company file: read the Modèle J, the IF attestation and the
      manager's CIN, check an ICE. Every plan.
  - name: Statements
    description: Read a bank statement line by line and reconcile it. Every plan.
  - name: Webhooks
    description: >-
      Manage webhook endpoints with an API key (scope `webhooks:manage`). Every
      plan.
  - name: Document requests
    description: >-
      Ask an applicant for documents through a link or an embedded page, and
      follow the request.
  - name: Sandbox
    description: 'The specimen gallery: the only documents a new workspace''s Sandbox reads.'
  - name: Registry
    description: >-
      Check a SIREN, a VAT number, a LEI, an IBAN, a Moroccan RIB or ICE. Scope
      `registry:read`.
  - name: Cases
    description: >-
      Read the cases your calls filed, their documents and the fields read.
      Scope `cases:read`.
  - name: Scoring
    description: >-
      Read, re-run or simulate a case's credit score. Scopes `scoring:read`,
      `scoring:write`.
  - name: Policy
    description: >-
      Read and save the KYC policy your `/v1/kyc/*` calls run under. Scopes
      `policy:read`, `policy:write`.
  - name: Webhook deliveries
    description: >-
      See what was sent to your endpoints and send a delivery again. Scope
      `webhooks:manage`.
  - name: Account
    description: The calling key, its usage, its recent calls and the error catalogue.
paths:
  /v1/statements/{statement_id}:
    get:
      tags:
        - Statements
      summary: Get a queued statement
      description: >-
        Required scope: `statements:read`.


        The status of a queued statement and, once `status` is `completed`, its
        result (the same keys as the synchronous answer of `POST
        /v1/statements/extract`). Only your own workspace's statements are
        visible. An expired result answers 410 `statement_expired`. A job
        refused for a non-specimen file in the Sandbox carries `error_code:
        sandbox_specimen_required` with `error_message` and `error_message_fr`.
      operationId: statements_get
      parameters:
        - name: statement_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Statement Id
          description: The `statement_id` returned by `POST /v1/statements/extract` (202).
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatementJob'
              example:
                statement_id: 4d7e1a93-2b6c-4f08-9a15-8c3e5f0b7d21
                status: processing
                environment: sandbox
                reference: client-0001
                pages: 24
                created_at: '2026-11-24T09:00:00+00:00'
                completed_at: null
                expires_at: '2026-12-01T09:00:00+00:00'
                error_code: null
                billing:
                  documents_billed: 3
                  pages: 24
                  environment: sandbox
        '401':
          description: Missing, invalid, revoked or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: Invalid or revoked API key
        '403':
          description: The key lacks the `statements:read` scope (`insufficient_scope`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: API key lacks the statements:read scope
        '404':
          description: Unknown id, or another workspace's statement (`not_found`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail:
                  code: not_found
                  message: No such statement.
        '410':
          description: The result is no longer kept (`statement_expired`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail:
                  code: statement_expired
                  message: This result is no longer kept.
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            Per-key rate limit (`rate_limit_exceeded`, 60 calls a minute by
            default, with `Retry-After`) or the per-IP limit (top-level `code`,
            no `detail`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail:
                  code: rate_limit_exceeded
                  message: More than 60 calls a minute with this API key. Slow down.
                  limit: 60
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFlat'
              example:
                code: internal_error
                message: An unexpected error occurred
                details: null
      security:
        - bearerAuth: []
components:
  schemas:
    StatementJob:
      type: object
      title: StatementJob
      description: >-
        A queued statement. The result keys (`bank`, `transactions`,
        `reconciliation`, ...) are present once `status` is `completed`.
      properties:
        statement_id:
          type: string
          format: uuid
          description: Id of the job.
        status:
          type: string
          enum:
            - queued
            - processing
            - completed
            - failed
          description: >-
            `failed` carries an `error_code` (`processing_failed`, or
            `sandbox_specimen_required` for a non-specimen file in the Sandbox).
        environment:
          type: string
          enum:
            - sandbox
            - production
        reference:
          type:
            - string
            - 'null'
          description: The `reference` you sent.
        pages:
          type:
            - integer
            - 'null'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: After this time the result answers 410.
        error_code:
          type:
            - string
            - 'null'
          description: >-
            Why the job failed; `sandbox_specimen_required` for a non-specimen
            file in the Sandbox.
        error_message:
          type: string
          description: Only with `sandbox_specimen_required`.
        error_message_fr:
          type: string
          description: Only with `sandbox_specimen_required`.
        billing:
          $ref: '#/components/schemas/PartnerBilling'
        bank:
          type:
            - string
            - 'null'
          description: Bank name read from the statement.
        account_holder:
          type:
            - string
            - 'null'
          description: Account holder.
        account_number:
          type:
            - string
            - 'null'
          description: Account number.
        rib:
          type:
            - string
            - 'null'
          description: RIB, when read.
        iban:
          type:
            - string
            - 'null'
          description: IBAN, when read.
        currency:
          type:
            - string
            - 'null'
          description: Currency code.
        period_start:
          type:
            - string
            - 'null'
          description: '`YYYY-MM-DD`.'
        period_end:
          type:
            - string
            - 'null'
          description: '`YYYY-MM-DD`.'
        opening_balance:
          type:
            - number
            - 'null'
        closing_balance:
          type:
            - number
            - 'null'
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/StatementTransaction'
        reconciliation:
          type: object
          description: >-
            Do the rows add up? `passed` is null when the balances were not
            read.
          properties:
            opening_balance:
              type:
                - number
                - 'null'
            movements_total:
              type: number
            expected_closing_balance:
              type:
                - number
                - 'null'
            closing_balance:
              type:
                - number
                - 'null'
            difference:
              type:
                - number
                - 'null'
            passed:
              type:
                - boolean
                - 'null'
            gaps:
              type: array
              items:
                additionalProperties: true
                type: object
              description: Rows where the running balance does not follow.
            totals:
              type: object
              additionalProperties: true
              description: Totals printed on the statement, compared with the rows.
        warnings:
          type: array
          items:
            additionalProperties: true
            type: object
        read:
          type: object
          description: How the statement was read.
          properties:
            pages:
              type: integer
            scanned:
              type: boolean
            source:
              type: string
            model_calls:
              type: integer
      required:
        - statement_id
        - status
        - environment
        - billing
    Error:
      type: object
      title: Error
      description: >-
        FastAPI error body. `detail` is a string, a list (validation 422), or an
        object with `code` and `message` (extra keys possible).
      properties:
        detail:
          oneOf:
            - type: string
            - type: array
              items:
                additionalProperties: true
                type: object
              description: Validation errors (422).
            - type: object
              additionalProperties: true
              properties:
                code:
                  type: string
                message:
                  type: string
      required:
        - detail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorFlat:
      type: object
      title: ErrorFlat
      description: >-
        Body of a rate-limit 429, an unknown route 404 and a 500: `code` and
        `message` at the top level, with no `detail`.
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type:
            - string
            - 'null'
          description: Present on a 500 only; null unless the server runs in debug mode.
      required:
        - code
        - message
    PartnerBilling:
      type: object
      title: PartnerBilling
      description: What this call counted against the workspace.
      properties:
        documents_billed:
          type: integer
          description: Documents counted.
        pages:
          type: integer
          description: 'Statements only: pages read.'
        environment:
          type: string
          enum:
            - sandbox
            - production
      required:
        - documents_billed
        - environment
    StatementTransaction:
      type: object
      title: StatementTransaction
      properties:
        date:
          type:
            - string
            - 'null'
          description: Booking date, `YYYY-MM-DD`.
        value_date:
          type:
            - string
            - 'null'
          description: Value date, `YYYY-MM-DD`.
        label:
          type:
            - string
            - 'null'
          description: Description.
        debit:
          type:
            - number
            - 'null'
        credit:
          type:
            - number
            - 'null'
        amount:
          type: number
          description: credit minus debit.
        balance:
          type:
            - number
            - 'null'
          description: Balance after the line, when the statement prints it.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key created in the console. Scopes: kyc:extract, kyc:verify,
        kyc:eid; kyb:onboard, kyb:ice; statements:read; webhooks:manage;
        requests:read, requests:write; bank:read, bank:write (Growth plan,
        enabled per workspace by Sahl); registry:read; cases:read; scoring:read,
        scoring:write; policy:read, policy:write; usage:read. The Sandbox
        specimen routes, `GET /v1/partner/me` and `GET /v1/partner/errors` need
        any valid key.

````

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