> ## 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.

# Check an ICE

> Required scope: `kyb:ice`.

Checks an ICE's format and its check key, and returns what this workspace's own earlier `/v1/kyb/ma/onboard` calls read for that ICE, if any (`known`). No document is read, no model is called, nothing is billed. No registry is queried: Morocco has no public ICE or RC registry API, so `registry_status` is always `non_verifie_au_registre`. The check key rule is not officially published: a mismatch is advisory only.

Choose the environment with the `X-Sahl-Environment` header or the `environment` field/parameter; the Sandbox is the default. Two values that disagree are refused (422 `environment_conflict`). In Production the workspace must be approved by Sahl (403 `production_api_not_approved` until then), its subscription must be active (403 `production_requires_paid_plan`), and a Free workspace needs a verified work email (403 `work_email_required`). The Sandbox is always open.



## OpenAPI

````yaml /openapi.json post /v1/kyb/ma/ice-check
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/kyb/ma/ice-check:
    post:
      tags:
        - KYB
      summary: Check an ICE
      description: >-
        Required scope: `kyb:ice`.


        Checks an ICE's format and its check key, and returns what this
        workspace's own earlier `/v1/kyb/ma/onboard` calls read for that ICE, if
        any (`known`). No document is read, no model is called, nothing is
        billed. No registry is queried: Morocco has no public ICE or RC registry
        API, so `registry_status` is always `non_verifie_au_registre`. The check
        key rule is not officially published: a mismatch is advisory only.


        Choose the environment with the `X-Sahl-Environment` header or the
        `environment` field/parameter; the Sandbox is the default. Two values
        that disagree are refused (422 `environment_conflict`). In Production
        the workspace must be approved by Sahl (403
        `production_api_not_approved` until then), its subscription must be
        active (403 `production_requires_paid_plan`), and a Free workspace needs
        a verified work email (403 `work_email_required`). The Sandbox is always
        open.
      operationId: kyb_ma_ice_check
      parameters:
        - name: X-Sahl-Environment
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Sahl-Environment
          description: >-
            `sandbox` (default) or `production`. Same meaning as the
            `environment` field or parameter; if both are sent they must agree.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IceCheckIn'
            examples:
              specimen:
                summary: The specimen ICE
                value:
                  ice: '001234567000062'
                  raison_sociale: SPECIMEN SARL
                  reference: company-0001
                  environment: sandbox
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IceCheckResponse'
              example:
                check_id: 5b8a2f10-6c3d-4e91-8d7a-0f4c1e9b2a63
                environment: sandbox
                ice: '001234567000062'
                format_valid: true
                format_message: null
                checksum_ok: true
                checksum_advisory: >-
                  The ICE check key rule is not officially published; a mismatch
                  is never a rejection, but sends an onboarding file to manual
                  review (ice_key_invalid).
                registry_status: non_verifie_au_registre
                registry_note: >-
                  Morocco has no public ICE / RC registry API: this ICE was not
                  verified at OMPIC or the DGI.
                known:
                  raison_sociale: SPECIMEN SARL
                  address: 1 Rue de l'Exemple, Casablanca
                  source: sahl_kyb_reads
                  last_seen_at: '2026-11-24T09:00:00+00:00'
                raison_sociale_agrees: true
        '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 scope (`insufficient_scope`), or a Production call
            from a workspace Sahl has not approved
            (`production_api_not_approved`), without an active subscription
            (`production_requires_paid_plan`), or on the Free plan without a
            verified work email (`work_email_required`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail:
                  code: production_api_not_approved
                  message: >-
                    This workspace is not yet approved for Production API calls.
                    Request production access in Settings → API. Sandbox stays
                    open meanwhile.
        '422':
          description: >-
            `invalid_reference`, `invalid_environment`, `environment_conflict`,
            or a validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail:
                  code: invalid_reference
                  message: 'reference must be 1-64 characters of A-Z a-z 0-9 _ . : -'
        '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:
    IceCheckIn:
      properties:
        ice:
          type: string
          maxLength: 40
          minLength: 1
          title: Ice
          description: The ICE. Spaces, dashes and dots are ignored. Up to 40 characters.
        raison_sociale:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Raison Sociale
          description: >-
            The company name you expect. When this workspace kept a name for the
            ICE, `raison_sociale_agrees` says whether they match.
        reference:
          anyOf:
            - type: string
              maxLength: 64
              minLength: 1
              pattern: ^[A-Za-z0-9_.:-]+$
            - type: 'null'
          title: Reference
          description: 'Your own id, 1 to 64 characters of `A-Z a-z 0-9 _ . : -`.'
        environment:
          anyOf:
            - type: string
              enum:
                - sandbox
                - production
            - type: 'null'
          title: Environment
          description: '`sandbox` (default) or `production`.'
          examples:
            - sandbox
      type: object
      required:
        - ice
      title: IceCheckIn
    IceCheckResponse:
      type: object
      title: IceCheckResponse
      properties:
        check_id:
          type: string
          format: uuid
          description: Id of this check.
        environment:
          type: string
          enum:
            - sandbox
            - production
        ice:
          type: string
          description: >-
            The ICE with spaces, dashes and dots removed; the normalised form
            when its format holds.
        format_valid:
          type: boolean
        format_message:
          type:
            - string
            - 'null'
          description: Why the format is wrong; null when it holds.
        checksum_ok:
          type:
            - boolean
            - 'null'
          description: >-
            Whether the ICE's check key matches. Null when the format is
            invalid. Advisory only.
        checksum_advisory:
          type: string
          description: The fixed note that the check key rule is not officially published.
        registry_status:
          type: string
          enum:
            - non_verifie_au_registre
          description: 'Always this value: no registry is queried.'
        registry_note:
          type: string
          description: The fixed note that Morocco has no public ICE or RC registry API.
        known:
          type:
            - object
            - 'null'
          description: >-
            What this workspace's own earlier KYB reads kept for the ICE; null
            when nothing is kept.
          properties:
            raison_sociale:
              type:
                - string
                - 'null'
            address:
              type:
                - string
                - 'null'
            source:
              type: string
              enum:
                - sahl_kyb_reads
            last_seen_at:
              type:
                - string
                - 'null'
              format: date-time
        raison_sociale_agrees:
          type:
            - boolean
            - 'null'
          description: >-
            Whether the `raison_sociale` you sent agrees with the kept name.
            Null when nothing was compared.
      required:
        - check_id
        - environment
        - ice
        - format_valid
        - registry_status
        - known
    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
    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
  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.