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

# Create or upsert a customer

> Ingest an individual customer. The record is created with
`kyc_status = NOT_STARTED` and `added_via = INTEGRATION`. **No KYC is
triggered and no credits are charged** — your back-office team
triggers verification from inside Instant Compliance.

### Designated services

Pass `designatedServices` to record the *specific* designated
service(s) you provide to this customer, using the stable catalog
codes documented on the `DesignatedServices` schema (e.g.
`PRO-FORMATION`, `RE-BROKER`) and served by
`GET /designated-services`. This does everything the in-app
"Designated services" editor does:

* `isDesignatedService` is **derived** from the list (non-empty →
  `true`, empty → `false`) — don't send the boolean alongside the
  list unless they agree, or the request is rejected with `422`.
* The customer's risk rating is recomputed immediately, so the
  service's risk tier flows into the *High-risk designated service*
  factor.
* The AML/CTF client classification is derived (new client /
  pre-commencement full CDD / monitoring-only).
* An empty array is an explicit "no designated services" — on
  creation the record lands with `kyc_status = NOT_REQUIRED`.
* On an idempotent upsert (see below) the list **replaces** the
  customer's existing designated-service set.

Unknown or non-designated codes are rejected with
`422 validation_failed` — nothing is silently dropped.

Without `designatedServices`, the legacy `risk.isDesignatedService`
boolean behaves as before: it sets the flag only, and your
back-office team picks the specific services in-app.

### Idempotency

* If `external_id` is supplied and already exists in your
  organisation, the existing record is **updated** and the response
  is **200 OK**.
* If `email` **and** `fullName` (case-insensitive) match an existing
  record (and the existing record has no conflicting `external_id`),
  the record is updated and returned with **200 OK**. Email alone is
  not treated as unique — family members may share one address.
* Otherwise a new record is created and returned with **201 Created**.

Include an `Idempotency-Key` header to make network retries safe for
24 hours.


Ingest an individual customer. The record lands in your organisation
tagged `INTEGRATION` with `kyc_status = NOT_STARTED`. **No KYC is
triggered. No credits are charged.** Your back-office team completes
the risk questions in-app and starts verification when ready.

## Idempotent upsert behaviour

| Input                     | Match found?                                                               | Result                 | Status         |
| ------------------------- | -------------------------------------------------------------------------- | ---------------------- | -------------- |
| `externalId` supplied     | Yes (same org)                                                             | Update existing record | `200 OK`       |
| `externalId` supplied     | No, but `email` matches an existing record with no `externalId`            | Adopt + update         | `200 OK`       |
| `externalId` supplied     | No, but `email` matches an existing record with a *different* `externalId` | Reject                 | `409 conflict` |
| `externalId` not supplied | `email` matches an existing record                                         | Update existing record | `200 OK`       |
| Neither matches           | —                                                                          | Create new             | `201 Created`  |

This lets a Zapier "Create / Update Customer" action send the same
event repeatedly without creating duplicates.

## Retry safety

Pass `Idempotency-Key` (a UUID or any string ≤ 255 chars). Repeated
calls with the same key within 24 hours replay the original response.
See [Idempotency](/concepts/idempotency).


## OpenAPI

````yaml POST /customers
openapi: 3.1.0
info:
  title: Instant Compliance API
  version: 1.0.0
  summary: External integration API for Instant Compliance.
  description: |
    The Instant Compliance v1 API lets your systems push customers into
    Instant Compliance and pull their verification / AML status back out.
    Designed for server-to-server use (CRMs, Zapier, internal back-office
    tools).

    **Base URL:** `https://app.instantcompliance.ai/api/v1`

    **Authentication:** Bearer API key — `Authorization: Bearer ic_live_…`
    Issue keys from **Settings → Developers** in your Instant Compliance
    organisation.

    **Scope:** individual customers (`INDIVIDUAL` and `SOLE_TRADER`, KYC)
    live on `/customers`; entity customers (companies, trusts,
    partnerships, SMSFs — KYB) live on `/entities`.
  contact:
    name: Instant Compliance Support
    email: support@instantcompliance.ai
    url: https://instantcompliance.ai
  license:
    name: Proprietary
servers:
  - url: https://app.instantcompliance.ai/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: |
      Create, read, and update individual customer records ingested through
      the external API.
  - name: Entities
    description: |
      Create, read, and update entity customer records (companies, trusts,
      partnerships, SMSFs). Entities verify via KYB instead of KYC; the API
      ingests the record and reports status — verification is started by
      your back-office team in-app.
  - name: Designated services
    description: |
      Read-only catalog of the designated-service codes accepted when
      creating customers.
  - name: Groups
    description: |
      Create group workspaces (multi-party deals/matters — e.g. one per
      property for real-estate integrators) and discover the group
      templates available to your organisation. Requires the Groups
      feature to be enabled for your organisation.
paths:
  /customers:
    post:
      tags:
        - Customers
      summary: Create or upsert a customer
      description: |
        Ingest an individual customer. The record is created with
        `kyc_status = NOT_STARTED` and `added_via = INTEGRATION`. **No KYC is
        triggered and no credits are charged** — your back-office team
        triggers verification from inside Instant Compliance.

        ### Designated services

        Pass `designatedServices` to record the *specific* designated
        service(s) you provide to this customer, using the stable catalog
        codes documented on the `DesignatedServices` schema (e.g.
        `PRO-FORMATION`, `RE-BROKER`) and served by
        `GET /designated-services`. This does everything the in-app
        "Designated services" editor does:

        * `isDesignatedService` is **derived** from the list (non-empty →
          `true`, empty → `false`) — don't send the boolean alongside the
          list unless they agree, or the request is rejected with `422`.
        * The customer's risk rating is recomputed immediately, so the
          service's risk tier flows into the *High-risk designated service*
          factor.
        * The AML/CTF client classification is derived (new client /
          pre-commencement full CDD / monitoring-only).
        * An empty array is an explicit "no designated services" — on
          creation the record lands with `kyc_status = NOT_REQUIRED`.
        * On an idempotent upsert (see below) the list **replaces** the
          customer's existing designated-service set.

        Unknown or non-designated codes are rejected with
        `422 validation_failed` — nothing is silently dropped.

        Without `designatedServices`, the legacy `risk.isDesignatedService`
        boolean behaves as before: it sets the flag only, and your
        back-office team picks the specific services in-app.

        ### Idempotency

        * If `external_id` is supplied and already exists in your
          organisation, the existing record is **updated** and the response
          is **200 OK**.
        * If `email` **and** `fullName` (case-insensitive) match an existing
          record (and the existing record has no conflicting `external_id`),
          the record is updated and returned with **200 OK**. Email alone is
          not treated as unique — family members may share one address.
        * Otherwise a new record is created and returned with **201 Created**.

        Include an `Idempotency-Key` header to make network retries safe for
        24 hours.
      operationId: createCustomer
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerRequest'
            examples:
              minimal:
                summary: Minimum required fields
                value:
                  externalId: crm-7741
                  fullName: Jane Doe
                  email: jane@example.com
              withRisk:
                summary: With optional risk pre-answers
                value:
                  externalId: crm-7741
                  type: INDIVIDUAL
                  fullName: Jane Doe
                  email: jane@example.com
                  phone: '+61400000000'
                  risk:
                    isNewCustomer: true
                    isDesignatedService: true
                    handlesCashOrCrypto: false
              withDesignatedServices:
                summary: With specific designated services
                value:
                  externalId: crm-7741
                  type: INDIVIDUAL
                  fullName: Jane Doe
                  email: jane@example.com
                  risk:
                    isNewCustomer: false
                  designatedServices:
                    - PRO-FORMATION
                    - PRO-CLIENT-MONEY
              noDesignatedServices:
                summary: Explicitly not a designated-service customer
                value:
                  externalId: crm-7742
                  fullName: John Roe
                  email: john@example.com
                  designatedServices: []
      responses:
        '200':
          description: Existing customer updated (idempotent upsert).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '201':
          description: New customer created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ForbiddenScope'
        '409':
          description: Name + email belong to a different customer record.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/RateLimited'
      x-codeSamples:
        - lang: curl
          source: |
            curl -X POST https://app.instantcompliance.ai/api/v1/customers \
              -H "Authorization: Bearer ic_live_..." \
              -H "Content-Type: application/json" \
              -H "Idempotency-Key: $(uuidgen)" \
              -d '{
                "externalId": "crm-7741",
                "fullName": "Jane Doe",
                "email": "jane@example.com"
              }'
        - lang: javascript
          source: |
            await fetch('https://app.instantcompliance.ai/api/v1/customers', {
              method: 'POST',
              headers: {
                'Authorization': `Bearer ${process.env.IC_API_KEY}`,
                'Content-Type': 'application/json',
                'Idempotency-Key': crypto.randomUUID()
              },
              body: JSON.stringify({
                externalId: 'crm-7741',
                fullName: 'Jane Doe',
                email: 'jane@example.com'
              })
            });
        - lang: python
          source: |
            import os, uuid, requests
            requests.post(
              'https://app.instantcompliance.ai/api/v1/customers',
              headers={
                'Authorization': f"Bearer {os.environ['IC_API_KEY']}",
                'Idempotency-Key': str(uuid.uuid4())
              },
              json={
                'externalId': 'crm-7741',
                'fullName': 'Jane Doe',
                'email': 'jane@example.com'
              }
            )
components:
  parameters:
    IdempotencyKey:
      in: header
      name: Idempotency-Key
      required: false
      schema:
        type: string
        maxLength: 255
      description: |
        Caller-supplied unique key for safe retries. Repeat the same key
        within 24 hours and we replay the original response instead of
        repeating the side effect. Reusing the key with a *different*
        request body returns **409 idempotency_conflict**.
  schemas:
    CreateCustomerRequest:
      type: object
      required:
        - fullName
        - email
      additionalProperties: false
      properties:
        externalId:
          type: string
          maxLength: 255
          description: >-
            Your CRM identifier. Strongly recommended for idempotent upsert +
            round-tripping.
        type:
          $ref: '#/components/schemas/CustomerType'
        fullName:
          type: string
          minLength: 1
          maxLength: 255
        email:
          type: string
          format: email
          maxLength: 255
        phone:
          type: string
          maxLength: 32
          nullable: true
        risk:
          $ref: '#/components/schemas/RiskAnswers'
        designatedServices:
          $ref: '#/components/schemas/DesignatedServices'
    Customer:
      type: object
      required:
        - id
        - type
        - full_name
        - kyc_status
        - aml
        - added_via
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: Instant Compliance customer UUID.
        external_id:
          type: string
          nullable: true
        type:
          $ref: '#/components/schemas/CustomerType'
        full_name:
          type: string
        email:
          type: string
          format: email
          nullable: true
        kyc_status:
          $ref: '#/components/schemas/KycStatus'
        kyc_started_at:
          type: string
          format: date-time
          nullable: true
        kyc_completed_at:
          type: string
          format: date-time
          nullable: true
        identity:
          $ref: '#/components/schemas/Identity'
        aml:
          $ref: '#/components/schemas/AmlBlock'
        added_via:
          $ref: '#/components/schemas/AddedVia'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      example:
        id: 550e8400-e29b-41d4-a716-446655440000
        external_id: crm-7741
        type: INDIVIDUAL
        full_name: Jane Doe
        email: jane@example.com
        kyc_status: VERIFIED
        kyc_started_at: '2026-06-23T01:00:00Z'
        kyc_completed_at: '2026-06-23T01:12:00Z'
        identity:
          verified_legal_name: JANE DOE
          verified_country: AUS
        aml:
          status: CLEAR
          screened_at: '2026-06-23T01:12:00Z'
          last_reviewed_at: null
          flags:
            pep: false
            sanctions: false
            adverse_media: false
            terrorism: false
        added_via: INTEGRATION
        created_at: '2026-06-22T22:14:00Z'
        updated_at: '2026-06-23T01:12:05Z'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden_scope
                - not_found
                - validation_failed
                - conflict
                - insufficient_credits
                - rate_limited
                - idempotency_conflict
                - feature_disabled
                - internal
            message:
              type: string
            details:
              type: object
              additionalProperties: true
    CustomerType:
      type: string
      enum:
        - INDIVIDUAL
        - SOLE_TRADER
      description: |
        Individual customer types — `/customers` only ingests these.
        Entity customers (companies, trusts, partnerships, SMSFs) live on
        `/entities` with their own `EntityType`.
    RiskAnswers:
      type: object
      description: |
        Optional risk pre-answers. Your back-office team will complete the
        full risk assessment in-app before triggering KYC; these values
        seed it.
      additionalProperties: false
      properties:
        isNewCustomer:
          type: boolean
          description: New relationship vs an existing client of yours.
        isDesignatedService:
          type: boolean
          description: |
            Whether you provide a designated service to this customer.
            Prefer `designatedServices` (the specific service codes) — when
            that list is present this flag is derived from it, and sending a
            contradictory value is rejected with `422`.
        handlesCashOrCrypto:
          type: boolean
          description: Whether the engagement handles physical cash or cryptocurrency.
    DesignatedServices:
      type: array
      maxItems: 64
      items:
        type: string
        maxLength: 64
      description: >
        The specific designated service(s) provided to the customer, as

        stable catalog codes. An empty array is an explicit "no designated

        services". Unknown or non-designated codes are rejected with

        `422 validation_failed`.


        The catalog is also available programmatically via

        `GET /designated-services`.


        **Professional services**


        | Code | Service |

        |------|---------|

        | `PRO-FORMATION` | Company or trust formation |

        | `PRO-PURCHASE-SALE` | Company or trust purchase/sale |

        | `PRO-RESTRUCTURE` | Business restructuring services |

        | `PRO-REAL-ESTATE` | Real estate professional services (conveyancing /
        legal) |

        | `PRO-CLIENT-MONEY` | Client money/assets management (incl. securities
        & virtual assets) |

        | `PRO-FINANCING` | Business financing arrangement services |

        | `PRO-SHELF` | Shelf company sales |

        | `PRO-NOMINEE` | Nominee director or shareholder services |

        | `PRO-REGISTERED-OFFICE` | Registered office address services |


        **Real estate**


        | Code | Service |

        |------|---------|

        | `RE-BROKER` | Real estate agency (brokering sales) |

        | `RE-DEVELOPER` | Property development sales |


        **Financial services**


        | Code | Service |

        |------|---------|

        | `FIN-BANKING` | Banking and deposit services |

        | `FIN-REMITTANCE` | Money transfer and remittance services |

        | `FIN-CRYPTO` | Cryptocurrency exchange services |

        | `FIN-FX` | Foreign currency exchange |

        | `FIN-LOANS` | Loans and financing services |

        | `FIN-INVESTMENT` | Investment and securities services |

        | `FIN-ADVISORY` | Financial advisory services (arranging designated
        services) |

        | `FIN-INSURANCE` | Insurance services (life insurance, sinking funds) |

        | `FIN-SUPER` | Superannuation fund management |

        | `FIN-PENSION` | Pension, annuity, or retirement account services |

        | `FIN-STORED-VALUE` | High-value stored value cards |

        | `FIN-CUSTODIAL` | Custodial and depository services |

        | `FIN-PAYROLL` | Payroll services for other businesses |


        **Other designated services**


        | Code | Service |

        |------|---------|

        | `OTH-BULLION` | Bullion trading (precious metals) |

        | `OTH-GAMBLING` | Gambling services |

        | `OTH-HIGH-VALUE-GOODS` | High-value goods dealing |
      example:
        - PRO-FORMATION
        - PRO-CLIENT-MONEY
    KycStatus:
      type: string
      enum:
        - NOT_STARTED
        - PENDING
        - IN_PROGRESS
        - VERIFIED
        - FAILED
        - NOT_REQUIRED
        - AWAITING_RESUBMISSION
    Identity:
      type: object
      nullable: true
      description: |
        Populated only when `kyc_status = VERIFIED`. Deliberately minimal —
        full date of birth and full address are never exposed.
      properties:
        verified_legal_name:
          type: string
          nullable: true
          description: Legal name extracted from the verified ID document.
        verified_country:
          type: string
          nullable: true
          description: ISO 3166-1 alpha-3 country code.
    AmlBlock:
      type: object
      required:
        - status
        - flags
      properties:
        status:
          $ref: '#/components/schemas/AmlStatus'
        screened_at:
          type: string
          format: date-time
          nullable: true
        last_reviewed_at:
          type: string
          format: date-time
          nullable: true
        flags:
          type: object
          required:
            - pep
            - sanctions
            - adverse_media
            - terrorism
          properties:
            pep:
              type: boolean
            sanctions:
              type: boolean
            adverse_media:
              type: boolean
            terrorism:
              type: boolean
    AddedVia:
      type: string
      description: How the record entered Instant Compliance.
      enum:
        - ADMIN_MANUAL
        - AI_EXTRACTED
        - CONTACT_PORTAL
        - BULK_IMPORT
        - INTEGRATION
        - SYSTEM
    AmlStatus:
      type: string
      enum:
        - NOT_SCREENED
        - IN_PROGRESS
        - CLEAR
        - NEEDS_REVIEW
        - RESOLVED
  responses:
    Unauthorized:
      description: Missing, invalid, expired, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid or revoked API key.
    ForbiddenScope:
      description: API key lacks the required scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: forbidden_scope
              message: This API key does not have the required scope. customers:write
              details:
                required_scope: customers:write
    ValidationFailed:
      description: Request payload failed schema validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: validation_failed
              message: Invalid customer payload.
              details:
                issues:
                  email:
                    - Must be a valid email address.
    RateLimited:
      description: Burst or daily rate limit exceeded for this API key.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Rate limit exceeded. Slow down and retry shortly.
              details:
                limit: 60
                window_seconds: 60
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        Bearer API key issued from **Settings → Developers** in your
        Instant Compliance organisation. Format: `ic_live_…`.

````