Delete Contact
Delete an existing contact.
HTTP Request
DELETE/api/contacts/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the contact to delete |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2response = requests.delete('http://www.example.com/api/contacts/1', headers={
3 'Authorization': 'Token <your_api_key>'
4})
5
6print(response.status_code) # Should be 204 for successful deletion1curl -X DELETE "http://www.example.com/api/contacts/1" -H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 204 | Contact deleted successfully |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Not found — contact does not exist |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| None | None | No response body returned |