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. |
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"
},
],
"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