Api

Task

The tasks object in the MarkupGo API represents the result of an API activity triggered by generating documents or images.

Endpoints

GET /tasks

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.

Query Parameters

KeyDescriptionDefault
limitThe number of tasks to return.10
pageThe page number to return.1

Response

The response contains an array of tasks and a meta object with pagination information.

KeyDescription
idThe unique identifier of the task.
urlThe URL of the generated document or image.
formatThe format of the generated document or image.
sizeThe size of the generated document or image in bytes.
widthThe width of the generated document or image in pixels.
heightThe height of the generated document or image in pixels.
createdAtThe date and time the task was created.
updatedAtThe date and time the task was last updated.
GET /tasks
Request
fetch("api/v1/tasks?limit=10&page=1", {
  method: "GET",
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  }
})
Response
{
  "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
  }
}

DELETE /tasks/{id}

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}
Request
fetch("api/v1/tasks/66f96077bd3eae71a05c9cfb", {
  method: "DELETE",
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY'
  }
})
Response
204 No Content