Skip to main content
GET
/
tasks
/
{taskIdOrSlug}
Get task
curl --request GET \
  --url https://twill.ai/api/v1/tasks/{taskIdOrSlug} \
  --header 'Authorization: Bearer <token>'
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://twill.ai/api/v1/tasks/{taskIdOrSlug}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
import requests

url = "https://twill.ai/api/v1/tasks/{taskIdOrSlug}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
{
  "task": {
    "id": "<string>",
    "slug": "<string>",
    "title": "<string>",
    "url": "<string>",
    "repositoryUrl": "<string>",
    "baseBranch": "<string>",
    "featureBranch": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  },
  "latestJob": {
    "id": "<string>",
    "type": "<string>",
    "agentProvider": "<string>",
    "startedAt": "2023-11-07T05:31:56Z",
    "completedAt": "2023-11-07T05:31:56Z",
    "pr": {
      "url": "<string>",
      "number": 123,
      "title": "<string>"
    },
    "plan": "<string>",
    "planOutcome": "<string>"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key"
  }
}
{
  "error": {
    "code": "not_found",
    "message": "Task not found"
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded. Max 100 requests per minute."
  }
}
{
  "error": {
    "code": "internal_error",
    "message": "Server error"
  }
}
Look up a task by its UUID or its human-readable slug.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

taskIdOrSlug
string
required

Task id (UUID) or task slug.

Response

Task detail

task
object
required
latestJob
object | null
required