> This page is for version 0.5.1.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo-helix/latest/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo-helix/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo-helix/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo-helix/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo-helix/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo-helix/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo-helix/v0.3.0/llms.txt
> - 0.2.0: https://docs.nvidia.com/nemo-helix/v0.2.0/llms.txt

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

# Create Annotation

POST /apis/intake/v2/workspaces/{workspace}/annotations
Content-Type: application/json

Reference: https://docs.nvidia.com/nemo-helix/v0.5.1/documentation/reference/api-reference/annotations/create-annotation-apis-intake-v-2-workspaces-workspace-annotations-post

## Request

### Path parameters

- `workspace` (string, required)

### Body (application/json)

This endpoint expects an AnnotationInput.

- `AnnotationInput`
  - `kind`: `feedback` (FeedbackAnnotationInput)
    - `session_id` (string, required) — Id of the session this annotation belongs to. Always required.
    - `value` (enum, required) — Sentiment of the feedback.
      - Allowed values: `positive`, `negative`
    - `span_id` (string, optional) — Id of the span this annotation applies to. Omit to annotate the whole session instead of a specific span.
  - `kind`: `label` (LabelAnnotationInput)
    - `session_id` (string, required) — Id of the session this annotation belongs to. Always required.
    - `value` (LabelAnnotationInputValue, required) — The label's value. Must be a string when `value_type=text` and a number when `value_type=numeric`.
    - `value_type` (enum, required) — Whether `value` should be interpreted as text (`text`) or a number (`numeric`).
      - Allowed values: `text`, `numeric`
    - `name` (string, optional) — Name identifying what the label measures (e.g., `severity`, `helpfulness`). Optional for text labels; required for numeric labels.
    - `span_id` (string, optional) — Id of the span this annotation applies to. Omit to annotate the whole session instead of a specific span.
  - `kind`: `metadata` (MetadataAnnotationInput)
    - `metadata` (map from string to any, required) — Arbitrary key/value pairs. Must contain at least one entry.
    - `session_id` (string, required) — Id of the session this annotation belongs to. Always required.
    - `span_id` (string, optional) — Id of the span this annotation applies to. Omit to annotate the whole session instead of a specific span.
  - `kind`: `note` (NoteAnnotationInput)
    - `session_id` (string, required) — Id of the session this annotation belongs to. Always required.
    - `text` (string, required) — The note content. 1 to 10,000 characters.
    - `span_id` (string, optional) — Id of the span this annotation applies to. Omit to annotate the whole session instead of a specific span.

## Response

### 201

Successful Response

- `Annotation`
  - `kind`: `feedback` (FeedbackAnnotation)
    - `annotation_id` (string, required)
    - `created_at` (datetime, required)
    - `ingested_at` (datetime, required)
    - `session_id` (string, required)
    - `value` (enum, required) — Sentiment of the feedback.
      - Allowed values: `positive`, `negative`
    - `workspace` (string, required)
    - `created_by` (string, optional)
    - `span_id` (string, optional) — Id of the span this annotation applies to, or omitted for session-level annotations.
  - `kind`: `label` (LabelAnnotation)
    - `annotation_id` (string, required)
    - `created_at` (datetime, required)
    - `ingested_at` (datetime, required)
    - `session_id` (string, required)
    - `value` (LabelAnnotationValue, required) — The label's value. A string when `value_type=text`, a number when `value_type=numeric`.
    - `value_type` (enum, required) — Whether `value` is a text label (`text`) or a number (`numeric`).
      - Allowed values: `text`, `numeric`
    - `workspace` (string, required)
    - `created_by` (string, optional)
    - `name` (string, optional) — Name identifying what the label measures, when set.
    - `span_id` (string, optional) — Id of the span this annotation applies to, or omitted for session-level annotations.
  - `kind`: `metadata` (MetadataAnnotation)
    - `annotation_id` (string, required)
    - `created_at` (datetime, required)
    - `ingested_at` (datetime, required)
    - `metadata` (map from string to any, required) — The metadata key/value pairs.
    - `session_id` (string, required)
    - `workspace` (string, required)
    - `created_by` (string, optional)
    - `span_id` (string, optional) — Id of the span this annotation applies to, or omitted for session-level annotations.
  - `kind`: `note` (NoteAnnotation)
    - `annotation_id` (string, required)
    - `created_at` (datetime, required)
    - `ingested_at` (datetime, required)
    - `session_id` (string, required)
    - `text` (string, required) — The note content.
    - `workspace` (string, required)
    - `created_by` (string, optional)
    - `span_id` (string, optional) — Id of the span this annotation applies to, or omitted for session-level annotations.

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### LabelAnnotationInputValue

The label's value. Must be a string when `value_type=text` and a number when `value_type=numeric`.

### LabelAnnotationValue

The label's value. A string when `value_type=text`, a number when `value_type=numeric`.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (map from string to any, optional)

### ValidationErrorLocItems

## Examples

**Request**

```json
{
  "kind": "string",
  "session_id": "string",
  "value": "positive"
}
```

**Response**

```json
{
  "annotation_id": "string",
  "created_at": "2024-01-15T09:30:00Z",
  "created_by": "string",
  "ingested_at": "2024-01-15T09:30:00Z",
  "kind": "string",
  "session_id": "string",
  "span_id": "string",
  "value": "positive",
  "workspace": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/apis/intake/v2/workspaces/workspace/annotations"

payload = {
    "kind": "string",
    "session_id": "string",
    "value": "positive"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/apis/intake/v2/workspaces/workspace/annotations';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"kind":"string","session_id":"string","value":"positive"}'
};

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

```go
package main

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

func main() {

	url := "https://api.example.com/apis/intake/v2/workspaces/workspace/annotations"

	payload := strings.NewReader("{\n  \"kind\": \"string\",\n  \"session_id\": \"string\",\n  \"value\": \"positive\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://api.example.com/apis/intake/v2/workspaces/workspace/annotations")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"kind\": \"string\",\n  \"session_id\": \"string\",\n  \"value\": \"positive\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.example.com/apis/intake/v2/workspaces/workspace/annotations")
  .header("Content-Type", "application/json")
  .body("{\n  \"kind\": \"string\",\n  \"session_id\": \"string\",\n  \"value\": \"positive\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/apis/intake/v2/workspaces/workspace/annotations', [
  'body' => '{
  "kind": "string",
  "session_id": "string",
  "value": "positive"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/apis/intake/v2/workspaces/workspace/annotations");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"kind\": \"string\",\n  \"session_id\": \"string\",\n  \"value\": \"positive\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "kind": "string",
  "session_id": "string",
  "value": "positive"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/apis/intake/v2/workspaces/workspace/annotations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```