← Back to API
Delete a form
Permanently delete a form. Only forms owned by the API key's account can be deleted. This action cannot be undone.
DELETE /api/v1/forms/:id
Request
Path parameters
| Parameter | Description |
|---|---|
id | Form ID (e.g. form_1739012345_abc123xyz) |
Response (success)
Status: 200 OK
{
"success": true,
"data": {
"id": "form_1739012345_abc123xyz",
"deleted": true
},
"meta": { "request_id": null, "api_version": "2024-01-01" }
}Code examples
curl -X DELETE "https://backend.chatterforms.com/api/v1/forms/form_1739012345_abc123xyz" \
-H "Authorization: Bearer cf_live_YOUR_API_KEY"const API_KEY = 'cf_live_YOUR_API_KEY';
const BASE_URL = 'https://backend.chatterforms.com';
async function deleteForm(formId) {
const res = await fetch(`${BASE_URL}/api/v1/forms/${formId}`, {
method: 'DELETE',
headers: { Authorization: `Bearer ${API_KEY}` },
});
const json = await res.json();
if (!json.success) throw new Error(json.error?.message || 'Request failed');
return json.data;
}
// Usage
const result = await deleteForm('form_1739012345_abc123xyz');
console.log('Deleted:', result.deleted);import requests
API_KEY = 'cf_live_YOUR_API_KEY'
BASE_URL = 'https://backend.chatterforms.com'
def delete_form(form_id: str) -> dict:
url = f'{BASE_URL}/api/v1/forms/{form_id}'
headers = {'Authorization': f'Bearer {API_KEY}'}
response = requests.delete(url, headers=headers)
data = response.json()
if not data.get('success'):
raise Exception(data.get('error', {}).get('message', 'Request failed'))
return data['data']
# Usage
result = delete_form('form_1739012345_abc123xyz')
print('Deleted:', result['deleted'])Error responses
| Status | Code | Description |
|---|---|---|
| 401 | INVALID_API_KEY | Missing or invalid API key |
| 404 | NOT_FOUND | Form not found or not owned |
| 500 | DELETE_FAILED | Failed to delete form |
| 500 | INTERNAL_ERROR | Internal error |
See Errors for details.