API REFERENCE
Delete task
On this page
/api/tasksDelete an existing scheduled task by id. Returns only the delete operation status.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request DELETE \
--url 'https://api.recoupable.dev/api/tasks' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a"
}'Try it
Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.
Kept in this browser tab only and cleared when it closes.
curl --request DELETE \
--url 'https://api.recoupable.dev/api/tasks' \
--header 'Content-Type: application/json' \
--data '{
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a"
}'Request body required
JSON object containing the task id to delete.
application/json
idstringrequiredUUID of the task to delete
Example: "aade2bce-55c7-468e-a606-c4e76fb2ea2a"
format: uuid
Delete one task
{
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a"
}Responses
200Task deleted successfully.+
application/json
statusstring · enumrequiredStatus of the delete operation
Values: "success"
400Bad request — missing id or invalid request body.+
application/json
statusstring · enumrequiredAlways error when validation fails
Values: "error"
missing_fieldsarray<one of>requiredJSON path segments to the first field that failed validation (from Zod), e.g. ["id"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredValidation message for the first failing field
401Unauthorized — send exactly one of x-api-key or Authorization: Bearer …. Missing or conflicting headers return a text error; malformed or rejected credentials return a text message. Both envelopes include status: error; read whichever text field is present.+
application/json
anyOf · object 1
statusstring · enumrequiredAlways error.
Values: "error"
errorstringrequiredHuman-readable error message or documented error code.
Additional properties
any
anyOf · object 2
statusstring · enumrequiredAlways error.
Values: "error"
messagestringrequiredHuman-readable authentication error message.
Additional properties
any
Missing credentials or both credential headers supplied
{
"status": "error",
"error": "Exactly one of x-api-key or Authorization must be provided"
}Rejected API key, whether sent in x-api-key or as a Bearer key
{
"status": "error",
"message": "Unauthorized"
}403Forbidden — the authenticated account is not allowed to delete this task. Read the text error.+
application/json
statusstring · enumrequiredAlways error.
Values: "error"
errorstringrequiredHuman-readable error message or documented error code.
Additional properties
any
{
"status": "error",
"error": "Access denied to this task"
}404No task exists with the given id.+
application/json
statusstring · enumrequiredAlways error for this response shape
Values: "error"
errorstringrequiredHuman-readable error message (for example Task not found on 404)
Unknown task id
{
"status": "error",
"error": "Task not found"
}500Internal server error while deleting the task or deleting its Trigger.dev schedule.+
application/json
statusstring · enumrequiredAlways error for this response shape
Values: "error"
errorstringrequiredHuman-readable error message (for example Task not found on 404)
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download releases.jsonView operation source
{
"operationId": "deleteTasks",
"summary": "Delete scheduled task",
"description": "Delete an existing scheduled task by `id`. Returns only the delete operation status.",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"requestBody": {
"description": "JSON object containing the task `id` to delete.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTaskRequest"
},
"examples": {
"deleteTask": {
"summary": "Delete one task",
"value": {
"id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Task deleted successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTaskResponse"
}
}
}
},
"400": {
"description": "Bad request — missing `id` or invalid request body.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTaskValidationErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized — send exactly one of `x-api-key` or `Authorization: Bearer …`. Missing or conflicting headers return a text `error`; malformed or rejected credentials return a text `message`. Both envelopes include `status: error`; read whichever text field is present.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskAuthenticationErrorResponse"
},
"examples": {
"missingOrConflictingCredentials": {
"summary": "Missing credentials or both credential headers supplied",
"value": {
"status": "error",
"error": "Exactly one of x-api-key or Authorization must be provided"
}
},
"invalidCredential": {
"summary": "Rejected API key, whether sent in x-api-key or as a Bearer key",
"value": {
"status": "error",
"message": "Unauthorized"
}
}
}
}
}
},
"403": {
"description": "Forbidden — the authenticated account is not allowed to delete this task. Read the text `error`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TaskFailureErrorResponse"
},
"examples": {
"taskAccessDenied": {
"value": {
"status": "error",
"error": "Access denied to this task"
}
}
}
}
}
},
"404": {
"description": "No task exists with the given `id`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTaskFailureResponse"
},
"examples": {
"notFound": {
"summary": "Unknown task id",
"value": {
"status": "error",
"error": "Task not found"
}
}
}
}
}
},
"500": {
"description": "Internal server error while deleting the task or deleting its Trigger.dev schedule.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTaskFailureResponse"
}
}
}
}
}
}