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

# Create or update customers and tiers



## OpenAPI

````yaml /api-reference/openapi.json put /v1/customers
openapi: 3.1.0
info:
  title: Elastly API
  version: '2026-11-01'
servers:
  - url: https://api.elastly.ai
security: []
paths:
  /v1/customers:
    put:
      summary: Create or update customers and tiers
      operationId: upsertCustomers
      parameters:
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
          required: false
          name: Elastly-Version
          in: header
        - schema:
            type: string
            pattern: ^[\x21-\x7e]{1,255}$
          required: true
          name: Idempotency-Key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                records:
                  type: array
                  items:
                    type: object
                    properties:
                      externalKey:
                        type: string
                        minLength: 1
                        maxLength: 255
                      sequence:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      updatedAt:
                        type: string
                        format: date-time
                      deleted:
                        type: boolean
                      fields:
                        type: object
                        properties:
                          accountNumber:
                            type: string
                            minLength: 1
                            maxLength: 1000
                          name:
                            type: string
                            minLength: 1
                            maxLength: 1000
                          currency:
                            type: string
                            pattern: ^[A-Z]{3}$
                          segment:
                            type: string
                            minLength: 1
                            maxLength: 1000
                          terms:
                            type: string
                            minLength: 1
                            maxLength: 1000
                          country:
                            type: string
                            pattern: ^[A-Z]{2}$
                          shipCountry:
                            type: string
                            pattern: ^[A-Z]{2}$
                          creditLimit:
                            type: string
                            pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
                          territory:
                            type: string
                            minLength: 1
                            maxLength: 1000
                          groups:
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 255
                            maxItems: 100
                          inactive:
                            type: boolean
                        required:
                          - accountNumber
                          - currency
                        additionalProperties: false
                    required:
                      - externalKey
                    additionalProperties: false
                  minItems: 1
                  maxItems: 100
              required:
                - records
              additionalProperties: false
      responses:
        '202':
          description: Create or update customers and tiers
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
            Idempotent-Replayed:
              description: >-
                Present and true when the response replays an earlier request
                with the same idempotency key
              schema:
                type: string
                enum:
                  - 'true'
          content:
            application/json:
              schema:
                type: object
                properties:
                  importId:
                    type: string
                    format: uuid
                  records:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                          minimum: 0
                        externalKey:
                          type:
                            - string
                            - 'null'
                        state:
                          type: string
                          enum:
                            - accepted
                            - failed
                            - stale
                        errors:
                          type: array
                          items:
                            type: object
                            properties:
                              field:
                                type:
                                  - string
                                  - 'null'
                              code:
                                type: string
                                minLength: 1
                              message:
                                type: string
                                minLength: 1
                            required:
                              - field
                              - code
                              - message
                            additionalProperties: false
                        notices:
                          type: array
                          items:
                            type: object
                            properties:
                              field:
                                type:
                                  - string
                                  - 'null'
                              code:
                                type: string
                                minLength: 1
                              message:
                                type: string
                                minLength: 1
                            required:
                              - field
                              - code
                              - message
                            additionalProperties: false
                      required:
                        - index
                        - externalKey
                        - state
                      additionalProperties: false
                required:
                  - importId
                  - records
                additionalProperties: false
        '400':
          description: >-
            unsupported_api_version, invalid_request, idempotency_key_required,
            invalid_idempotency_key
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: unauthenticated
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: >-
            insufficient_scope, plan_required, workspace_read_only,
            workspace_locked, workspace_purging
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: connection_unavailable, idempotency_request_in_progress
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '413':
          description: invalid_request
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: idempotency_key_reused
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: rate_limited
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '503':
          description: service_unavailable, connection_unavailable
          headers:
            Elastly-Version:
              description: The API version that served the response
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying the request
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - apiKey: []
components:
  schemas:
    ApiError:
      type: object
      properties:
        error:
          type: string
          enum:
            - invalid_request
            - unauthenticated
            - access_denied
            - rate_limited
            - plan_required
            - workspace_read_only
            - workspace_locked
            - workspace_purging
            - service_unavailable
            - insufficient_scope
            - not_found
            - idempotency_key_reused
            - idempotency_key_required
            - invalid_idempotency_key
            - idempotency_request_in_progress
            - unsupported_api_version
            - invalid_cursor
            - quote_ref_customer_mismatch
            - channel_publishing
            - connection_unavailable
            - import_not_found
            - import_state_conflict
            - file_too_large
            - unsupported_format
            - writeback_unavailable
            - write_access_revoked
            - writeback_paused
            - too_many_claims
            - quote_not_found
        requestId:
          type: string
      required:
        - error
        - requestId
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

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