Deletes one or more documents from a record.
POSThttps://secure-api.setshape.com/api/delete/lead/documents/{crmid}
Replace
{crmid} with your CRM ID, the Shape system ID that belongs to your API key. Send the standard headers on every request: Authorization: YOUR_API_AUTHORIZATION_KEY and Content-Type: application/json. See Authentication.Parameters
| Field | Requirement | Description |
|---|---|---|
crmid (path) |
Required | Your Shape system ID. |
lead_id |
Required | The ID of the record the documents belong to. |
documentIds |
Required | A list of document IDs from Get Record Documents. Send a list even for one ID. |
Example request
curl --request POST
--url "https://secure-api.setshape.com/api/delete/lead/documents/YOUR_CRM_ID"
--header "Authorization: YOUR_API_AUTHORIZATION_KEY"
--header "Content-Type: application/json"
--data '{ "lead_id": 281944, "documentIds": [55] }'
{
"lead_id": 281944,
"documentIds": [55]
}
Query parameters also work: ?lead_id=281944&documentIds[]=55&documentIds[]=56.
Response
A 200 response means the documents were deleted. Document IDs that don’t belong to the record are skipped.
{
"message": "Request queued successfully."
}
Deleted documents are removed right away. They can’t be restored through the API. To check, request the record’s document list again.
Errors
| Situation | Status | Response |
|---|---|---|
lead_id missing |
400 | {"message": "Please provide lead ID [leadid]"} |
documentIds not sent as a list |
400 | {"message": "Invalid ids parameter"} |
documentIds empty |
400 | {"message": "No valid DocumentIds provided"} |