curl --request DELETE \
--url https://api.credira.com/v1/users/user_123456789 \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'
const userId = "user_123456789";
const response = await fetch(`https://api.credira.com/v1/users/${userId}`, {
method: "DELETE",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);
{
"success": true,
"data": {
"id": "user_123456789",
"deleted": true,
"deleted_time": "2024-01-15T10:30:00Z",
"deleted_items": {
"user_account": true,
"api_keys": 1,
"activity_history": true,
"associated_resources": {
"calls": 45,
"emails": 120,
"callouts": 8
}
}
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789",
"message": "User deleted successfully"
}
}
Users
Delete User
Delete a user account by ID
DELETE
/
users
/
{id}
curl --request DELETE \
--url https://api.credira.com/v1/users/user_123456789 \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'
const userId = "user_123456789";
const response = await fetch(`https://api.credira.com/v1/users/${userId}`, {
method: "DELETE",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);
{
"success": true,
"data": {
"id": "user_123456789",
"deleted": true,
"deleted_time": "2024-01-15T10:30:00Z",
"deleted_items": {
"user_account": true,
"api_keys": 1,
"activity_history": true,
"associated_resources": {
"calls": 45,
"emails": 120,
"callouts": 8
}
}
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789",
"message": "User deleted successfully"
}
}
Delete a user account and all associated data.
This action is irreversible. All user data, including API keys, activity
history, and associated resources will be permanently deleted.
Request
string
required
The unique identifier of the user to delete
string
required
Bearer token for API authentication
curl --request DELETE \
--url https://api.credira.com/v1/users/user_123456789 \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json'
const userId = "user_123456789";
const response = await fetch(`https://api.credira.com/v1/users/${userId}`, {
method: "DELETE",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);
{
"success": true,
"data": {
"id": "user_123456789",
"deleted": true,
"deleted_time": "2024-01-15T10:30:00Z",
"deleted_items": {
"user_account": true,
"api_keys": 1,
"activity_history": true,
"associated_resources": {
"calls": 45,
"emails": 120,
"callouts": 8
}
}
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789",
"message": "User deleted successfully"
}
}
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid user ID format"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "You don't have permission to delete this user"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "User not found"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
{
"success": false,
"error": {
"code": "CONFLICT",
"message": "Cannot delete user with active sessions"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
