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

# Claim queued writes

> Claims up to 100 queued writes under a lease. When the queue is empty, the claim waits up to waitSeconds for an item. A connection holds a limited number of waiting claims; a claim beyond that limit answers 429 too_many_claims.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/writeback/claims
openapi: 3.1.0
info:
  title: Elastly API
  version: '2026-11-01'
servers:
  - url: https://api.elastly.ai
security: []
paths:
  /v1/writeback/claims:
    post:
      summary: Claim queued writes
      description: >-
        Claims up to 100 queued writes under a lease. When the queue is empty,
        the claim waits up to waitSeconds for an item. A connection holds a
        limited number of waiting claims; a claim beyond that limit answers 429
        too_many_claims.
      operationId: claimWriteback
      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:
                maxItems:
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 100
                waitSeconds:
                  type: integer
                  minimum: 0
                  maximum: 20
                  default: 20
                leaseSeconds:
                  type: integer
                  minimum: 30
                  maximum: 43200
                  default: 300
              additionalProperties: false
      responses:
        '200':
          description: Claim queued writes
          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:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/WritebackItem'
                required:
                  - items
                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, writeback_unavailable,
            write_access_revoked
          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'
        '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, too_many_claims
          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, writeback_paused, 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:
    WritebackItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        version:
          type: integer
          exclusiveMinimum: 0
        receipt:
          type: string
          format: uuid
        key:
          type: string
          minLength: 1
          maxLength: 512
        attempt:
          type: integer
          minimum: 1
          maximum: 10
        claimedAt:
          type: string
          format: date-time
        leaseExpiresAt:
          type: string
          format: date-time
        priceList:
          type: object
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            currency:
              type: string
          required:
            - id
            - name
            - currency
          additionalProperties: false
        product:
          type: object
          properties:
            id:
              type: string
              format: uuid
            sku:
              type: string
            externalKey:
              type:
                - string
                - 'null'
          required:
            - id
            - sku
            - externalKey
          additionalProperties: false
        unit:
          type: string
        price:
          type: string
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
        previousPrice:
          type:
            - string
            - 'null'
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
        currency:
          type: string
        versionId:
          type: string
          format: uuid
        validFrom:
          type:
            - string
            - 'null'
          format: date-time
        decisionId:
          type:
            - string
            - 'null'
          format: uuid
      required:
        - id
        - version
        - receipt
        - key
        - attempt
        - claimedAt
        - leaseExpiresAt
        - priceList
        - product
        - unit
        - price
        - previousPrice
        - currency
        - versionId
        - validFrom
        - decisionId
      additionalProperties: false
    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.