[Flex] Delete Asset from Segment
Deletes a specific asset file from a segment in a Flex document. The asset is permanently removed from the document's reference material folder.
URL
(DELETE) /api/apps/wbflex/documents/{id}/assets/{segmentid}
PARAMETERS
Parameter | Type | Required | Description |
---|---|---|---|
id (URL) | string | Mandatory | The unique Flex document identifier |
segmentid (URL) | int | Mandatory | The unique segment identifier containing the asset to delete |
filename (Query) | string | Optional | The name of the asset file to delete. If not provided, all assets in the segment are deleted |
locale (Query) | string | Optional | Language code if the asset is associated with a specific language |
relativePath (Query) | string | Optional | Relative path within the segment's asset folder. If provided, takes precedence over path in filename |
ACCESS RIGHTS
The user must have access rights to the Flex document with delete permissions. The system checks document-level permissions to ensure the user can delete assets from the specified document.
EXAMPLE REQUEST
Delete specific asset:
curl --location --request DELETE '{{URL}}/api/apps/wbflex/documents/19914/assets/27667833?filename=pexels-gons2.jpg' \
--header 'X-Auth-Token: {{AUTH_TOKEN}}' \
--header 'X-Auth-AccountId: {{ACCOUNT_ID}}' \
--header 'Content-Type: application/json'
Delete all assets in segment:
curl --location --request DELETE '{{URL}}/api/apps/wbflex/documents/19914/assets/27667833' \
--header 'X-Auth-Token: {{AUTH_TOKEN}}' \
--header 'X-Auth-AccountId: {{ACCOUNT_ID}}'
RESULTS
The response returns an HTTP status code without a response body:
Status Code | Description |
---|---|
200 OK | Asset(s) successfully deleted |
Response Body: Empty
USAGE NOTES
The asset is permanently deleted and cannot be recovered
The filename parameter must match exactly the stored filename
If locale is specified, only the asset in that language-specific subfolder is deleted
If the asset doesn't exist, the operation still returns 200 OK (idempotent behavior)
All references to the deleted asset (such as cached download URLs) become invalid
File Path Handling: The system supports two ways to specify file paths:
Use the relativePath parameter to specify the folder structure
Include the path directly in the filename (e.g., "subfolder/image.jpg")
If both are provided, relativePath takes precedence
Path separators should be URL-encoded in query parameters
ENDPOINT VARIATIONS
The same endpoint supports two deletion modes based on the presence of the filename parameter:
Parameters | Action |
---|---|
No filename parameter | Delete all assets from the segment |
With filename parameter (+ optional locale/relativePath) | Delete specific asset from the segment |
Delete All Assets from Segment
When deleting all assets:
All assets in the segment are permanently deleted and cannot be recovered
This includes assets in all locales (language-specific subfolders)
The entire asset folder structure for the segment is removed
If no assets exist in the segment, the operation still returns 200 OK (idempotent behavior)
All references to the deleted assets become invalid
This operation is irreversible - use with caution