AEM Folders API returns HTTP 200 instead of HTTP 409 for existing folders
Adobe Experience Manager as a Cloud Service (AEMaaCS) Folders API returns HTTP 200 OK when a folder creation request targets an existing folder. A recent change provides the conflict details in the response payload instead of returning HTTP 409 Conflict, which can affect integrations that rely only on the HTTP status code. To resolve the issue, evaluate the errors array in the response payload and treat conflict entries as failed folder creation operations.
Description description
Environment
Adobe Experience Manager as a Cloud Service (AEMaaCS), all versions
Issue/Symptoms
-
When you use the AEM Folders API to create a folder that already exists, the API returns an HTTP 200 OK status code.
-
The response payload contains a conflict error instead of returning an HTTP 409 Conflict status code as previously documented.
-
Example endpoint:
POST /adobe/folders -
Sample request: Send a
POSTrequest to/adobe/folderswith a JSON body that specifies the folder path and title. -
Sample actual response:
code language-none { "operation": "adobe.folders.createFolders", "status": 200, "description": "Created folders", "data": { "values": { "successes": [ ] } }, "errors": [ { "type": "https://api.adobeaemcloud.com/adobe/meta/errors/conflict", "title": "Conflict", "detail": "An entity already exists at /content/dam/example/path/to/folder" } ] , "warnings": [ ] }
Root cause
A recent change in the Folders API behavior returns HTTP 200 OK for folder creation conflicts and provides the conflict details in the response payload instead of returning an HTTP 409 Conflict status code. This change might not yet appear in the public documentation.
Resolution resolution
Follow the steps below to resolve the issue:
- Review the latest Folders API documentation for updates about conflict handling.
- Update the integration logic to evaluate both the HTTP status code and the response payload when determining the result of a folder creation request.
- Check the
errorsarray in the response payload for entries withtypeset tohttps://api.adobeaemcloud.com/adobe/meta/errors/conflict. - If the response contains this entry, treat the operation as a conflict regardless of the HTTP status code.
- If the workflow requires strict HTTP status code handling, implement additional logic to parse the response body for error details.
- Monitor the API documentation and release notes for updates or changes to the contract for conflict responses.
- Attempt to create a folder that already exists. Confirm that the response payload contains a conflict error in the
errorsarray, even when the HTTP status code is 200.