RecoupGet a free auditFree audit

API REFERENCE

Delete Task

On this page
DELETE/api/tasks

Delete an existing scheduled task by id. Returns only the delete operation status.

Authentication

x-api-key in header

bearerAuth bearer

Request

cURL
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 for this request
curl --request DELETE \
  --url 'https://recoup-api.vercel.app/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

idstringrequired

UUID of the task to delete

format: uuid

Delete one task

deleteTask
{
  "id": "aade2bce-55c7-468e-a606-c4e76fb2ea2a"
}

Responses

200Task deleted successfully.

application/json

statusstring · enumrequired

Status of the delete operation

Values: "success"

400Bad request — missing id or invalid request body.

application/json

statusstring · enumrequired

Always error when validation fails

Values: "error"

missing_fieldsarray<one of>required

JSON 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

errorstringrequired

Validation message for the first failing field

401Unauthorized - missing or invalid credentials

application/json

errorintegerrequired

format: int32

messagestringrequired
403Forbidden - account_id is outside caller authorization scope

application/json

errorintegerrequired

format: int32

messagestringrequired
404No task exists with the given id.

application/json

statusstring · enumrequired

Always error for this response shape

Values: "error"

errorstringrequired

Human-readable error message (for example Task not found on 404)

Unknown task id

notFound
{
  "status": "error",
  "error": "Task not found"
}

500Internal server error while deleting the task or deleting its Trigger.dev schedule.

application/json

statusstring · enumrequired

Always error for this response shape

Values: "error"

errorstringrequired

Human-readable error message (for example Task not found on 404)

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download releases.json
View operation source
json
{
  "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 - missing or invalid credentials",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "Forbidden - account_id is outside caller authorization scope",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "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"
          }
        }
      }
    }
  }
}