Delete a document
Delete the selected Space item. Read and preserve any content you need before calling this endpoint.
{
"title": "Delete a document",
"description": "",
"method": "DELETE",
"baseUrl": "https://app.docuwriter.ai",
"endpoint": "/api/spaces/{space}/documents/{spaceMenuItem}",
"headers": [
{
"key": "Authorization",
"value": "Bearer YOUR_API_TOKEN",
"type": "string",
"required": true
},
{
"key": "Accept",
"value": "application/json",
"type": "string",
"required": true
}
],
"queryParams": [],
"pathParams": [
{
"key": "space",
"value": "Numeric Space ID.",
"type": "integer",
"required": true
},
{
"key": "spaceMenuItem",
"value": "Numeric document/menu-item ID belonging to the Space.",
"type": "integer",
"required": true
}
],
"bodyType": "none",
"requestBody": "",
"formData": [],
"rawBody": "",
"responses": {
"200": {
"description": "HTTP 200: success: true, message, and data.deleted_document_id, data.deleted_document_name, and data.space_id. This endpoint returns JSON rather than HTTP 204. Illustrative JSON example; sample values are fictional. Some optional or additional resource fields may be omitted.",
"body": "{\n \"success\": true,\n \"data\": {\n \"deleted_document_id\": 456,\n \"deleted_document_name\": \"Payment lifecycle\",\n \"space_id\": 123\n },\n \"message\": \"Document 'Payment lifecycle' deleted successfully\"\n}"
},
"401": {
"description": "Missing or invalid account API token.Missing or invalid account API token. Example JSON response.",
"body": "{\n \"message\": \"Unauthenticated.\"\n}"
}
}
}
Usage notes
- Requires Space management access.
- 404 if the item belongs to another Space; 403 without permission.
- There is no restore endpoint in this reference.
- Avoid blindly retrying a delete after an uncertain response: re-list first.
Updated