Archive API docs
    Jump to

    Narrow by kind with a prefix — q: queries, m: mutations, t: types, g: guides, f: fields and arguments.

    Errors

    Check the HTTP status, then the top-level errors array, then mutation userErrors. HTTP 200 alone does not mean an operation succeeded.

    Identifying the error level

    1. HTTP status is not 200: HTTP error. Check authentication, request headers, and rate limits. For these failures, the body usually contains a string under errors. Rate-limit responses can use an array instead; see the status table below.

    json
    { "errors": "<message>" }
    400 Bad Request 3 lines
    {
      "errors": "WORKSPACE-ID header is required"
    }

    2. HTTP status is 200 and the body has an errors array: GraphQL error. The document may have failed parsing or validation, or a field may have failed during execution. Each entry has a message and a machine-readable extensions.code. When present, locations and path identify the affected part of the query. This example passes a Creator View’s ID to items, which accepts only content views and collections:

    200 OK 24 lines
    {
      "errors": [
        {
          "message": "Preset \"8d6ddb76-8b81-5725-a762-2d2e18432dcf\" is not valid for this resolver (its accessor is \"crm_creators\"; allowed: [\"media_deck\", \"collections\"]).",
          "extensions": {
            "code": "WRONG_VIEW_TYPE_FOR_ITEMS",
            "allowedAccessors": [
              "media_deck",
              "collections"
            ]
          },
          "locations": [
            {
              "line": 2,
              "column": 3
            }
          ],
          "path": [
            "items"
          ]
        }
      ],
      "data": null
    }

    Match on extensions.code (WRONG_VIEW_TYPE_FOR_ITEMS in this example) rather than on the message text, which can change. One code can cover several messages: items returns WRONG_VIEW_TYPE_FOR_ITEMS for a preset of the wrong type and, with a “not found” message, for a preset that doesn’t exist in the workspace.

    A response can carry both data and errors: when a dependency is temporarily unavailable, the parts that could be resolved are still returned alongside a coded error for the parts that could not. Read errors even when data is populated.

    3. HTTP status is 200 with data and no top-level errors: inspect the operation result. For mutations, select and check userErrors before treating the request as successful. An empty array means the mutation reported no business validation errors. For asynchronous operations, also check the returned operation’s status before assuming the work is complete.

    200 OK 12 lines
    {
      "data": {
        "createCollection": {
          "collection": {
            "id": "17ccdf4e-19d2-5b30-9787-d4f0886ddf29",
            "name": "Holiday Favorites",
            "itemCount": 0
          },
          "userErrors": []
        }
      }
    }

    The userErrors pattern

    Mutations return business validation failures in userErrors, with HTTP 200 and data. GraphQL input validation can still fail before the mutation runs. Each UserError has the shape:

    graphql
    type UserError {
      field: [String!]
      message: String!
    }

    Always inspect userErrors on a mutation response before treating it as a success. field points at the offending input path; message is human-readable.

    HTTP status reference

    StatusBody shapeCause
    200data (+ optional errors[])Success, or a GraphQL field error / mutation userErrors
    400{"errors":"WORKSPACE-ID header is required"}Missing WORKSPACE-ID on a workspace-scoped operation
    400{"errors":"The request body is not valid UTF-8 encoded JSON"}The body could not be parsed as JSON. Fix the request; retrying it unchanged fails again
    401{"errors":"Missing or invalid authentication token"}Missing, invalid, or replaced token
    401{"errors":"Account is disabled"}Paused token. Re-enable it before use
    404{"errors":"WORKSPACE-ID must be the workspace UUID shown in the app's API settings; numeric workspace ids are not accepted"}WORKSPACE-ID is not a UUID, for example a numeric workspace ID. Send the workspace’s id from workspaces
    404{"errors":"Shop not found"}Unknown workspace, or one your token can’t access
    405{"errors":"Method not allowed. …"} with Allow: POSTThe request used GET, PUT, PATCH or DELETE. Send GraphQL requests as POST
    429{"errors":[{"message":"Rate limit exceeded…","extensions":{"code":"RATE_LIMIT_EXCEEDED"}}]}Request rate limit or weighted cost budget used up for now. Honor Retry-After
    5xxtypically {"errors":"<message>"}Infrastructure failure. Most server-side errors arrive as HTTP 200 instead; see the codes below

    Server-side errors arrive as HTTP 200

    A server-side failure can return HTTP 200 with a GraphQL error. Use extensions.code to decide what to do:

    extensions.codeMeaning
    QUERY_TIMEOUTThe query was canceled by the database statement timeout. Narrow the time range or the page size, then retry
    INTERNAL_SERVER_ERRORUnexpected server-side failure. Retry with backoff; contact support if it persists
    SERVICE_UNAVAILABLEA dependency is temporarily unavailable. The data that could be resolved is still returned; retry later for the rest

    Error codes

    For server-side codes, follow the retry guidance above. The client-error codes below require a change to the request before retrying:

    extensions.codeMeaning
    BAD_REQUESTSend one runnable operation. Check query, avoid batched request arrays, and set a valid operationName for multi-operation documents
    PERSISTED_QUERY_NOT_SUPPORTEDThe request sent only a persisted-query hash. Send the full document in query. Apollo Client’s persisted-queries link falls back to the full query on this code
    GRAPHQL_PARSE_FAILEDThe document has a syntax error. locations points at it
    GRAPHQL_VALIDATION_FAILEDThe document is deeper than the 10-level limit. Other schema-validation failures carry a more specific code, such as undefinedField, missingRequiredArguments or argumentLiteralsIncompatible
    INVALID_INPUTFix the input identified by the message. For variable type errors, inspect extensions.problems. Common causes are listed below
    QUERY_TOO_COMPLEXThe request exceeds your plan’s per-request limit or the fixed cost ceiling. Select fewer root fields, reduce page sizes, or split the request. Retrying unchanged will fail
    NOT_FOUNDThe id you asked for doesn’t exist in this workspace. An id that belongs to another workspace reports the same way
    FILTER_NOT_AVAILABLEThe Archive app does not offer this filter, condition or sort key to the workspace. extensions.filter names it; send the request without it
    FIELD_NOT_AVAILABLEThe Archive app hides this whole surface from the workspace, for example Competitor Insights in App Review mode. extensions.field names the field (mediaContents.competitorBrandItemIds for that argument). Changing the request does not help

    Common causes of INVALID_INPUT:

    • A variable does not match its declared GraphQL type.
    • An argument is outside its allowed range, such as first above the field’s maximum.
    • A range has from later than to.
    • An after cursor is invalid for the query.
    • Arguments conflict with each other.
    • An argument or variable contains the NUL character (U+0000). The message identifies its location.
    • A superSearch image or text cannot be processed for similarity search.

    For the unknown-workspace case:

    404 Not Found 3 lines
    {
      "errors": "Shop not found"
    }

    See the Rate limits guide for 429 handling and the Authentication guide for 401 handling.