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

# Recover the original organization-scoped attempt

> Recover an accepted publishing submission after a timeout or lost response. Send the original Idempotency-Key header; keys are scoped to your workspace across organization API keys. Returns the current original task, including failed or canceled attempts, without creating or charging another task. Returns 404 task_not_found if no attempt is found, or 503 result_unavailable if the accepted attempt cannot currently be read. Preserve the original key and request body when retrying.

TikTok Shop only. The key creator must remain a workspace member with current account access. Read requests: 120/minute/workspace; writes: 30/minute/workspace (configurable). Media preparation and new submissions require Pro or higher. Video submission uses your API wallet; photos, reads, media preparation and cancellation are free. See https://www.creatok.ai/app/api-platform/pricing for current prices. Accepted tasks continue after plan downgrade. Unknown results are not automatically resent or refunded.



## OpenAPI

````yaml /api-reference/openapi.json get /publishing/tasks/by-idempotency-key
openapi: 3.1.0
info:
  title: CreatOK API
  version: 1.3.0
  description: >-
    Asynchronous media generation and TikTok Shop publishing API. Authenticate
    with a Bearer organization API key (cok_). Personal CLI/MCP keys are not
    accepted. Resource responses are returned directly, without a code/data
    envelope. Each response includes X-Request-Id.
servers:
  - url: https://api.creatok.ai/v1
security: []
paths:
  /publishing/tasks/by-idempotency-key:
    get:
      summary: Recover the original organization-scoped attempt
      description: >-
        Recover an accepted publishing submission after a timeout or lost
        response. Send the original Idempotency-Key header; keys are scoped to
        your workspace across organization API keys. Returns the current
        original task, including failed or canceled attempts, without creating
        or charging another task. Returns 404 task_not_found if no attempt is
        found, or 503 result_unavailable if the accepted attempt cannot
        currently be read. Preserve the original key and request body when
        retrying.


        TikTok Shop only. The key creator must remain a workspace member with
        current account access. Read requests: 120/minute/workspace; writes:
        30/minute/workspace (configurable). Media preparation and new
        submissions require Pro or higher. Video submission uses your API
        wallet; photos, reads, media preparation and cancellation are free. See
        https://www.creatok.ai/app/api-platform/pricing for current prices.
        Accepted tasks continue after plan downgrade. Unknown results are not
        automatically resent or refunded.
      operationId: recoverPublishingTask
      parameters:
        - name: Idempotency-Key
          in: header
          schema:
            type: string
            minLength: 1
            maxLength: 255
          required: true
      responses:
        '200':
          description: Result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishingTask'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              description: Polling suggestion for nonterminal tasks
              schema:
                type: integer
        '400':
          description: >-
            Request error. Recover ambiguous accepted requests using the
            original idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: integer
        '401':
          description: >-
            Request error. Recover ambiguous accepted requests using the
            original idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: integer
        '402':
          description: >-
            Request error. Recover ambiguous accepted requests using the
            original idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: integer
        '403':
          description: >-
            Request error. Recover ambiguous accepted requests using the
            original idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: integer
        '404':
          description: >-
            Request error. Recover ambiguous accepted requests using the
            original idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: integer
        '409':
          description: >-
            Request error. Recover ambiguous accepted requests using the
            original idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: integer
        '429':
          description: >-
            Request error. Recover ambiguous accepted requests using the
            original idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: integer
        '500':
          description: >-
            Request error. Recover ambiguous accepted requests using the
            original idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: integer
        '502':
          description: >-
            Request error. Recover ambiguous accepted requests using the
            original idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: integer
        '503':
          description: >-
            Request error. Recover ambiguous accepted requests using the
            original idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: integer
      security:
        - ApiKey: []
components:
  schemas:
    PublishingTask:
      type: object
      required:
        - task_id
        - publish_job_id
        - kind
        - connection_uid
        - client_source
        - status
        - created_at
        - cost
      properties:
        task_id:
          type: string
        publish_job_id:
          type:
            - string
            - 'null'
        kind:
          enum:
            - tiktok_shop_video
            - tiktok_shop_photo
        connection_uid:
          type: string
        client_source:
          type:
            - string
            - 'null'
        status:
          enum:
            - queued
            - scheduled
            - running
            - succeeded
            - failed
            - unknown
            - canceled
        raw_status:
          type: string
        created_at:
          type: integer
        schedule_time:
          type:
            - integer
            - 'null'
        completed_at:
          type:
            - integer
            - 'null'
        result:
          type: object
          properties:
            content_ids:
              type: array
              items:
                type: string
            content_urls:
              type: array
              items:
                type: string
        error:
          type:
            - object
            - 'null'
        cost:
          type: object
          required:
            - amount_usd
            - refunded_usd
          properties:
            amount_usd:
              type: string
              description: Booked charges in USD, with six decimal places.
            refunded_usd:
              type: string
              description: Booked refunds in USD, with six decimal places.
    Error:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
            code:
              type: string
            message:
              type: string
            param:
              type: string
            request_id:
              type: string
          required:
            - type
            - code
            - message
            - request_id
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: CreatOK organization API key

````

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