The tasks object in the MarkupGo API represents the result of an API activity triggered by generating documents or images. Tasks are created after calling the /pdf or /image endpoints.
You can also see the list in activity tab in the dashboard.
| Key | Description | Default |
|---|---|---|
limit | The number of tasks to return. | 10 |
page | The page number to return. | 1 |
The response contains an array of tasks and a meta object with pagination information.
| Key | Description |
|---|---|
id | The unique identifier of the task. |
url | The URL of the generated document or image. |
format | The format of the generated document or image. |
size | The size of the generated document or image in bytes. |
width | The width of the generated document or image in pixels. |
height | The height of the generated document or image in pixels. |
createdAt | The date and time the task was created. |
updatedAt | The date and time the task was last updated. |
expiresAt | ISO date when the task will be auto-deleted. null when no expiration was requested. |
GET /tasks
fetch("api/v1/tasks?limit=10&page=1", {
method: "GET",
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
})
{
"data": [
{
"id": "66f96077bd3eae71a05c9cfb",
"url": "https://files.markupgo.com/66923f55c937db8a3d73a1fb/1721135544120.pdf",
"format": "pdf",
"size": 1048576,
"width": 210,
"height": 297,
"createdAt": "2023-06-21T10:00:00Z",
"updatedAt": "2023-06-21T10:05:00Z",
"expiresAt": null
},
],
"meta": {
"total": 2,
"skip": 0,
"limit": 10
}
}
The delete task endpoint allows you to delete a task by its unique identifier. This will remove the generated file from the server.
You can also delete tasks in the activity tab in the dashboard.
This action is permanent; credits used will not be reduced.
The file may still be briefly accessible due to browser cache.
DELETE /tasks/{id}
fetch("api/v1/tasks/66f96077bd3eae71a05c9cfb", {
method: "DELETE",
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
})
204 No Content
Delete multiple tasks in a single call. You can target either a list of task IDs or a created-at time range — the two options are mutually exclusive.
| Key | Description |
|---|---|
ids | Array of task IDs to delete. Maximum 100 per request. |
from | ISO-8601 timestamp — lower bound (inclusive) of createdAt. |
to | ISO-8601 timestamp — upper bound (inclusive) of createdAt. |
| Key | Description |
|---|---|
deleted | The number of tasks that were actually deleted in this call. |
hasMore | true when the range matches more tasks than the per-request cap and further calls are needed to drain the remainder. Always false for the ids variant. |
This action is permanent; credits used will not be reduced.
Files may still be briefly accessible due to browser cache.
Per-request caps. The ids variant accepts up to 100 IDs per call — issue several requests if you have more. The range variant deletes up to 500 tasks per call (newest first); when more tasks fall inside the interval the response returns hasMore: true and you can re-issue the same request until hasMore becomes false.
DELETE /tasks
fetch("api/v1/tasks", {
method: "DELETE",
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
ids: [
"66f96077bd3eae71a05c9cfb",
"66f96077bd3eae71a05c9cfc"
]
})
})
fetch("api/v1/tasks", {
method: "DELETE",
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
from: "2026-04-01T00:00:00Z",
to: "2026-04-01T23:59:59Z"
})
})
{
"deleted": 2,
"hasMore": false
}