Skip to main content
DELETE
/
screenplay
/
tasks
/
{task_id}
Cancel Task
curl --request DELETE \
  --url https://mavi-backend.memories.ai/serve/api/v2/screenplay/tasks/{task_id} \
  --header 'Authorization: <api-key>'
{
  "code": 200,
  "msg": "success",
  "data": {
    "task_id": "ros-sd-20260313-a3f8c2b1",
    "status": "cancelled"
  },
  "failed": false,
  "success": true
}
This endpoint cancels an in-progress screenplay extraction task. Once cancelled, the task cannot be resumed.

Code Examples

const BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2";
const API_KEY = "sk-mai-this_a_test_string_please_use_your_generated_key_during_testing";

const taskId = "ros-sd-20260313-a3f8c2b1";
const response = await fetch(`${BASE_URL}/screenplay/tasks/${taskId}`, {
  method: 'DELETE',
  headers: {
    'Authorization': API_KEY
  }
});

const data = await response.json();
console.log(data);

Path Parameters

ParameterTypeRequiredDescription
task_idstringYesThe screenplay task ID to cancel

Response

{
  "code": 200,
  "msg": "success",
  "data": {
    "task_id": "ros-sd-20260313-a3f8c2b1",
    "status": "cancelled"
  },
  "failed": false,
  "success": true
}

Response Parameters

ParameterTypeDescription
codeintegerResponse code indicating the result status
msgstringResponse message
data.task_idstringThe cancelled task ID
data.statusstringTask status: "cancelled"
successbooleanIndicates whether the cancellation was successful
failedbooleanIndicates whether the cancellation failed

Notes

  • Only tasks in pending or running status can be cancelled
  • Cancellation is irreversible — a cancelled task cannot be resumed
  • The processing cost charged at submission time is not refunded upon cancellation
  • After cancellation, Get Task Status will return "cancelled" status

Authorizations

Authorization
string
header
required

API key for authentication

Path Parameters

task_id
string
required

The screenplay task ID to cancel

Example:

"ros-sd-20260313-a3f8c2b1"

Response

200 - application/json

Task cancelled successfully

code
integer

Response code indicating the result status

Example:

200

msg
string

Response message

Example:

"success"

data
object
success
boolean

Indicates whether the cancellation was successful

Example:

true

failed
boolean

Indicates whether the cancellation failed

Example:

false