Cancel Job
curl --request POST \
--url https://api.muvi.video/v1/jobs/{jobId}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.muvi.video/v1/jobs/{jobId}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.muvi.video/v1/jobs/{jobId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"jobId": "<string>",
"status": "<string>",
"refundedMicroCents": 123
}Task Management
Cancel Job
Cancel a pending job and receive a refund.
POST
/
v1
/
jobs
/
{jobId}
/
cancel
Cancel Job
curl --request POST \
--url https://api.muvi.video/v1/jobs/{jobId}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.muvi.video/v1/jobs/{jobId}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.muvi.video/v1/jobs/{jobId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"jobId": "<string>",
"status": "<string>",
"refundedMicroCents": 123
}Authentication
This endpoint requires an API key with thesubmit_job scope.
Authorization: Bearer YOUR_API_KEY
Path Parameters
string
required
The unique identifier of the job to cancel.
Details
Only jobs withpending status can be cancelled. Jobs that are already processing, completed, failed, or cancelled cannot be cancelled.
When a job is successfully cancelled, the charged credits are automatically refunded to your account.
Response
string
Unique identifier of the cancelled job.
string
Updated job status. Always
"cancelled" on success.number
The amount refunded in micro-cents.
Error Codes
| Code | Description |
|---|---|
JOB_NOT_FOUND | The specified job ID does not exist. |
UNAUTHORIZED_ACCESS | Your API key does not have access to this job. |
JOB_CANNOT_BE_CANCELLED | The job is not in a cancellable state (not pending). |
Examples
curl -X POST https://api.muvi.video/v1/jobs/job_abc123def456/cancel \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
response = requests.post(
"https://api.muvi.video/v1/jobs/job_abc123def456/cancel",
headers={
"Authorization": "Bearer YOUR_API_KEY"
}
)
data = response.json()
print(f"Job {data['jobId']} cancelled")
print(f"Refunded: {data['refundedMicroCents']} micro-cents")
const response = await fetch(
"https://api.muvi.video/v1/jobs/job_abc123def456/cancel",
{
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY"
}
}
);
const data = await response.json();
console.log(`Job ${data.jobId} cancelled`);
console.log(`Refunded: ${data.refundedMicroCents} micro-cents`);
Example Response
{
"jobId": "job_abc123def456",
"status": "cancelled",
"refundedMicroCents": 500000
}
