> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.labelstud.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.labelstud.io/_mcp/server.

# Get all task annotations

GET http://localhost:8000/api/tasks/{id}/annotations/

List all annotations for a task.

Reference: https://api.labelstud.io/api-reference/api-reference/annotations/list

## Authentication

- `Authorization` header (required) (prefixed with ` Token   `) — The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: curl [https://label-studio-host/api/projects](https://label-studio-host/api/projects) -H "Authorization: Token \[your-token]"

## Request

### Path parameters

- `id` (integer, required) — Task ID

### Query parameters

- `ordering` (string, optional) — Which field to use when ordering the results.

## Response

### 200

Annotation

- `list of Annotation`

## Types

### Annotation

Annotation Serializer with FSM state support. Note: The 'state' field will be populated from the queryset annotation if present, preventing N+1 queries. Use .with_state() on your queryset.

- `created_ago` (string, required, default: ) — Time delta from creation time
- `created_at` (datetime, required) — Creation time
- `created_username` (string, required, default: ) — Username string
- `id` (integer, required)
- `state` (string, required)
- `updated_at` (datetime, required) — Last updated time
- `bulk_created` (boolean, optional, nullable) — Annotation was created in bulk mode
- `completed_by` (integer, optional)
- `draft_created_at` (datetime, optional, nullable) — Draft creation time
- `ground_truth` (boolean, optional) — This annotation is a Ground Truth (ground_truth)
- `import_id` (long, optional, nullable) — Original annotation ID that was at the import step or NULL if this annotation wasn't imported
- `last_action` (enum, optional, nullable) — Action which was performed in the last annotation history item * `prediction` - Created from prediction * `propagated_annotation` - Created from another annotation * `imported` - Imported * `submitted` - Submitted * `updated` - Updated * `skipped` - Skipped * `accepted` - Accepted * `rejected` - Rejected * `fixed_and_accepted` - Fixed and accepted * `deleted_review` - Deleted review
  - Allowed values: `prediction`, `propagated_annotation`, `imported`, `submitted`, `updated`, `skipped`, `accepted`, `rejected`, `fixed_and_accepted`, `deleted_review`
- `last_created_by` (integer, optional, nullable) — User who created the last annotation history item
- `lead_time` (double, optional, nullable) — How much time it took to annotate the task
- `parent_annotation` (integer, optional, nullable) — Points to the parent annotation from which this annotation was created
- `parent_prediction` (integer, optional, nullable) — Points to the prediction from which this annotation was created
- `project` (integer, optional, nullable) — Project ID for this annotation
- `result` (list of AnnotationResultItems, optional) — List of annotation results for the task
- `task` (integer, optional, nullable) — Corresponding task for this annotation
- `updated_by` (integer, optional, nullable) — Last user who updated this annotation
- `was_cancelled` (boolean, optional) — User skipped the task

### AnnotationResultItems

List of annotated regions for the task

## Examples

**Response**

```json
[
  {
    "created_ago": "",
    "created_at": "2024-06-18T23:45:46.048490Z",
    "created_username": "",
    "id": 1,
    "state": "CREATED",
    "updated_at": "2024-06-18T23:45:46.048538Z",
    "completed_by": 1,
    "ground_truth": false,
    "lead_time": 10,
    "project": 1,
    "result": [
      {
        "from_name": "bboxes",
        "image_rotation": 0,
        "original_height": 1080,
        "original_width": 1920,
        "to_name": "image",
        "type": "rectanglelabels",
        "value": {
          "height": 60,
          "rotation": 0,
          "values": {
            "rectanglelabels": [
              "Person"
            ]
          },
          "width": 50,
          "x": 20,
          "y": 30
        }
      }
    ],
    "task": 1,
    "updated_by": 1,
    "was_cancelled": false
  }
]
```

**SDK Code**

```python response
import requests

url = "http://localhost:8000/api/tasks/1/annotations/"

headers = {"Authorization": "Token  <api_key>"}

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

print(response.json())
```

```javascript response
const url = 'http://localhost:8000/api/tasks/1/annotations/';
const options = {method: 'GET', headers: {Authorization: 'Token  <api_key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8000/api/tasks/1/annotations/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Token  <api_key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby response
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/api/tasks/1/annotations/")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Token  <api_key>'

response = http.request(request)
puts response.read_body
```

```java response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://localhost:8000/api/tasks/1/annotations/")
  .header("Authorization", "Token  <api_key>")
  .asString();
```

```php response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:8000/api/tasks/1/annotations/', [
  'headers' => [
    'Authorization' => 'Token  <api_key>',
  ],
]);

echo $response->getBody();
```

```csharp response
using RestSharp;

var client = new RestClient("http://localhost:8000/api/tasks/1/annotations/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Token  <api_key>");
IRestResponse response = client.Execute(request);
```

```swift response
import Foundation

let headers = ["Authorization": "Token  <api_key>"]

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/tasks/1/annotations/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```