Recoup

Get started with Recoup.

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://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

idstringrequired

UUID of the task to delete

Example: "aade2bce-55c7-468e-a606-c4e76fb2ea2a"

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 — 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 · enumrequired

Always error.

Values: "error"

errorstringrequired

Human-readable error message or documented error code.

Additional properties

any

anyOf · object 2
statusstring · enumrequired

Always error.

Values: "error"

messagestringrequired

Human-readable authentication error message.

Additional properties

any

Missing credentials or both credential headers supplied

missingOrConflictingCredentials
{
  "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

invalidCredential
{
  "status": "error",
  "message": "Unauthorized"
}

403Forbidden — the authenticated account is not allowed to delete this task. Read the text error.

application/json

statusstring · enumrequired

Always error.

Values: "error"

errorstringrequired

Human-readable error message or documented error code.

Additional properties

any

taskAccessDenied
{
  "status": "error",
  "error": "Access denied to this task"
}

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
{
  "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"
          }
        }
      }
    }
  }
}