Documenting Data API v2 errors

I think it would be helpful if the community could contribute known error objects being returned for Data API v2 while Webflow catches up on documentation.

I need these, even if I don’t generate them, to implement proper error handling for an integration I work on.

I have a few to contribute:

When attempting to update - patch - an item live that currently has status "isArchived": true a 409 is returned with the following message:

{
   "message": "Conflict: Conflict with server data: Live PATCH updates can't be applied to items that have never been published",
   "code": "conflict",
   "externalReference": null,
   "details": []
}

Another type of 409 occurs if the user makes any changes to the CMS collection structure. To generate the below error I simply changed a field to be required and saved the CMS Collection without publishing.

Then - again for me on live patch - I got the 409:

{
   "message": "Conflict: The collection structure changed since the last publish",
   "code": "conflict",
   "externalReference": null,
   "details": []
}

When I attempt to access a CMS Item via Item Id which no longer exists (user deleted the item manually from CMS), I get a 404 not found but the code is not item_not_found but is resource_not_found

{
    "message": "Requested resource not found",
    "code": "resource_not_found",
    "externalReference": null,
    "details": []
}

I am going to try to capture a schema error later and add it!

I would appreciate any contributions!

1 Like

Really appreciate you raising these @JessicaMG! We’re currently improving the way our Live endpoints return these types of errors, so that you run into 409s less often when CMS items may be out of sync between staging/production domains.

We’ll also take a look at the docs for potentially fixing the 404 you ran into with resource_not_found.

Also thank you for your interest in helping contribute to docs! We do publish our OpenAPI spec publicly here so if you do notice any details missing and you’d like to contribute, feel free to raise an Issue on that Github Repo, or a PR. Note though that because it is essentially a mirror of our internal source of truth OpenAPI spec, we can’t merge the PR directly, but can take those suggestions and apply it upstream separately.

1 Like

Thanks for the link to the OpenAPI spec

I know docs often end up low priority - I could afford to write a lot more help articles for our users :sweat_smile:

Error returned if using endpoint to get collection by collection_id (& collection no longer exists)

{
   "message": "Requested resource not found: Collection not found for the given ID",
   "code":"resource_not_found",
   "externalReference":null,
   "details":[]
}

Error returned if using endpoint to get item via both collection_id and item_id and collection no longer exists (or collection_id is just wrong)

{
   "message": "Requested resource not found: The collection cannot be found",
   "code":"resource_not_found",
   "externalReference":null,
   "details":[]
}

Hello,
I can’t find any proper subject or anyone facing my issue, this seems to be most related one :

I’m having an issue on my application with one of my users.

While fetching his live collections items from the endpoint “collections/[collection_id]/items/live” I have an error, here is the full response :

Response {

  [Symbol(realm)]: { settingsObject: {} },

  [Symbol(state)]: {

    aborted: false,

    rangeRequested: false,

    timingAllowPassed: false,

    requestIncludesCredentials: false,

    type: 'default',

    status: 409,

    timingInfo: null,

    cacheState: '',

    statusText: 'Conflict',

    headersList: HeadersList {

      cookies: null,

      [Symbol(headers map)]: [Map],

      [Symbol(headers map sorted)]: null

    },

    urlList: [],

    body: { stream: undefined, source: null, length: null }

  },

  [Symbol(headers)]: HeadersList {

    cookies: null,

    [Symbol(headers map)]: Map(9) {

      'connection' => [Object],

      'content-length' => [Object],

      'content-type' => [Object],

      'date' => [Object],

      'etag' => [Object],

      'retry-after' => [Object],

      'x-ratelimit-limit' => [Object],

      'x-ratelimit-remaining' => [Object],

      'x-response-time' => [Object]

    },

    [Symbol(headers map sorted)]: null

  }

}

So a 409 error apparently, with an error object like this :

 {
  message: 'Conflict: Conflict with server data: The site is not published.',
  code: 'conflict',
  externalReference: null,
  details: []
}

While the site is actually published, I tried to look after more infos and test it again from the documentation playground with the same endpoint and same token / collectionID .

This time I received a 404 with that object :

{
  "message": "Requested resource not found: The collection cannot be found",
  "code": "resource_not_found",
  "externalReference": null,
  "details": []
}

Once again, the collection is actually live on my user website, so it should definitely exist…

I’m pretty confused with all that, I didn’t find any information about the 409 error on this endpoint.

Am I missing something ?

Franck