Difference between revisions of "API:Contact:Delete"
Greg Donald (talk | contribs) |
Ashley DeBon (talk | contribs) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
== [[API]] » Delete Contact == | == [[API]] » Delete Contact == | ||
| − | + | === Base URL === | |
| + | https://app.callproof.com | ||
| − | + | === 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 === | |
| + | {| class="wikitable" | ||
| + | ! Header !! Required !! Description | ||
| + | |- | ||
| + | | Content-Type || Yes || Must be <code>application/json</code>. | ||
| + | |} | ||
| − | + | === 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 ==== | ||
| + | {| class="wikitable" | ||
| + | ! 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 === | ||
| + | <pre> | ||
| + | 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 | ||
| + | } | ||
| + | }' | ||
| + | </pre> | ||
| + | |||
| + | === Successful Response (200) === | ||
| + | Indicates the contact was successfully deleted. The response returns the identifier of the deleted contact. | ||
| + | |||
| + | {| class="wikitable" | ||
| + | ! 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; <code>200</code> on success. | ||
| + | |} | ||
| + | |||
| + | Example response: | ||
| + | <pre> | ||
| + | { | ||
| + | "results": { | ||
| + | "id": 789 | ||
| + | }, | ||
| + | "errors": [], | ||
| + | "code": 200 | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | === 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 === | ||
| + | {| class="wikitable" | ||
| + | ! 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:''' | ||
| + | <pre> | ||
| + | { | ||
| + | "results": [], | ||
| + | "errors": ["Invalid 'id' field"], | ||
| + | "code": 400 | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | '''401 response body example:''' | ||
| + | <pre> | ||
| + | { | ||
| + | "results": [], | ||
| + | "errors": ["Invalid API Key"], | ||
| + | "code": 401 | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | '''405 response body example:''' | ||
| + | <pre> | ||
| + | { | ||
| + | "results": [], | ||
| + | "errors": ["Method not allowed"], | ||
| + | "code": 405 | ||
| + | } | ||
| + | </pre> | ||
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
}