Difference between revisions of "API:Contact:Delete"
Ashley DeBon (talk | contribs) |
Ashley DeBon (talk | contribs) |
||
| Line 1: | Line 1: | ||
== [[API]] » Delete Contact == | == [[API]] » Delete Contact == | ||
| − | |||
| − | |||
=== Base URL === | === Base URL === | ||
Latest revision as of 12:03, 17 July 2026
Contents
API » Delete Contact
Base URL
Endpoint
/api/contact/delete/
Purpose
Permanently removes a contact from your CallProof company. Use this when a contact record should no longer exist in the system. Related contact data such as custom field values and company primary-contact associations are also cleared as part of the deletion.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Content-Type | Yes | Must be application/json.
|
Security
- Yes – Requires a valid API key and secret with permission to delete contacts. Credentials are sent in the request body.
Parameters
Path Parameters
None.
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | object | Yes | Authentication credentials object. |
| api_key.key | string | Yes | Public API key assigned to your CallProof account. |
| api_key.secret | string | Yes | Private API secret paired with the API key. |
| contact | object | Yes | Contact deletion payload. |
| contact.id | integer | Yes | Unique identifier of the contact to delete. Must belong to your company. |
cURL Example
curl -X POST "https://app.callproof.com/api/contact/delete/" \
-H "Content-Type: application/json" \
-d '{
"api_key": {
"key": "YOUR_API_KEY",
"secret": "YOUR_API_SECRET"
},
"contact": {
"id": 789
}
}'
Successful Response (200)
Indicates the contact was successfully deleted. The response returns the identifier of the deleted contact.
| Field | Type | Description |
|---|---|---|
| results | object | Confirmation of the deleted contact. |
| results.id | integer | Identifier of the contact that was deleted. |
| errors | array | Empty list when the request succeeds. |
| code | integer | HTTP-style status value; 200 on success.
|
Example response:
{
"results": {
"id": 789
},
"errors": [],
"code": 200
}
Notes
- This action permanently deletes the contact and cannot be undone through this endpoint.
- The contact must belong to your company; otherwise the request is rejected.
- If the deleted contact was set as the primary contact for its associated company, that primary-contact link is cleared.
- Custom field values associated with the contact are removed during deletion.
- The response confirms deletion by returning the deleted contact’s ID.
Error Responses
| Status Code | Meaning |
|---|---|
| 400 | Bad Request – The contact ID is missing, invalid, or does not match a contact in your company. |
| 401 | Unauthorized – The API key and/or secret is missing, invalid, inactive, associated with a disabled account, or lacks permission to delete contacts. |
| 405 | Method Not Allowed – A method other than POST was used. |
| 500 | Internal Server Error – An unexpected server problem occurred. Not specified in Swagger. |
400 response body example:
{
"results": [],
"errors": ["Invalid 'id' field"],
"code": 400
}
401 response body example:
{
"results": [],
"errors": ["Invalid API Key"],
"code": 401
}
405 response body example:
{
"results": [],
"errors": ["Method not allowed"],
"code": 405
}