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

# Create Annotation

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

Reference: https://nemo-platform.docs.buildwithfern.com/nemo/platform/nemo/platform/documentation/reference/api-reference/annotations/create-annotation-apis-intake-v-2-workspaces-workspace-annotations-post

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Nemo Platform API
  version: 1.0.0
paths:
  /apis/intake/v2/workspaces/{workspace}/annotations:
    post:
      operationId: create-annotation-apis-intake-v-2-workspaces-workspace-annotations-post
      summary: Create Annotation
      tags:
        - subpackage_annotations
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Annotation'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnnotationInput'
servers:
  - url: https://host.com
    description: Default
components:
  schemas:
    FeedbackAnnotationInputValue:
      type: string
      enum:
        - positive
        - negative
      description: Sentiment of the feedback.
      title: FeedbackAnnotationInputValue
    LabelAnnotationInputValueType:
      type: string
      enum:
        - text
        - numeric
      description: >-
        Whether `value` should be interpreted as text (`text`) or a number
        (`numeric`).
      title: LabelAnnotationInputValueType
    LabelAnnotationInputValue:
      oneOf:
        - type: string
        - type: number
          format: double
      description: >-
        The label's value. Must be a string when `value_type=text` and a number
        when `value_type=numeric`.
      title: LabelAnnotationInputValue
    AnnotationInput:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - feedback
              description: Discriminator. Always `feedback` for this variant.
            span_id:
              type: string
              description: >-
                Id of the span this annotation applies to. Omit to annotate the
                whole session instead of a specific span.
            session_id:
              type: string
              description: Id of the session this annotation belongs to. Always required.
            value:
              $ref: '#/components/schemas/FeedbackAnnotationInputValue'
              description: Sentiment of the feedback.
          required:
            - kind
            - session_id
            - value
          description: Thumbs-up / thumbs-down feedback on a span or session.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - label
              description: Discriminator. Always `label` for this variant.
            span_id:
              type: string
              description: >-
                Id of the span this annotation applies to. Omit to annotate the
                whole session instead of a specific span.
            session_id:
              type: string
              description: Id of the session this annotation belongs to. Always required.
            value_type:
              $ref: '#/components/schemas/LabelAnnotationInputValueType'
              description: >-
                Whether `value` should be interpreted as text (`text`) or a
                number (`numeric`).
            value:
              $ref: '#/components/schemas/LabelAnnotationInputValue'
              description: >-
                The label's value. Must be a string when `value_type=text` and a
                number when `value_type=numeric`.
            name:
              type: string
              description: >-
                Name identifying what the label measures (e.g., `severity`,
                `helpfulness`). Optional for text labels; required for numeric
                labels.
          required:
            - kind
            - session_id
            - value_type
            - value
          description: >-
            Categorical or numeric label attached to a span or session.


            Use `value_type=text` for tag-style labels (e.g., `regression`,
            `needs-review`) and

            `value_type=numeric` for scored labels (e.g., a 1-5 helpfulness
            rating). Numeric labels

            must include a `name` to identify what the score measures.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - metadata
              description: Discriminator. Always `metadata` for this variant.
            span_id:
              type: string
              description: >-
                Id of the span this annotation applies to. Omit to annotate the
                whole session instead of a specific span.
            session_id:
              type: string
              description: Id of the session this annotation belongs to. Always required.
            metadata:
              type: object
              additionalProperties:
                description: Any type
              description: Arbitrary key/value pairs. Must contain at least one entry.
          required:
            - kind
            - session_id
            - metadata
          description: Structured key/value metadata attached to a span or session.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - note
              description: Discriminator. Always `note` for this variant.
            span_id:
              type: string
              description: >-
                Id of the span this annotation applies to. Omit to annotate the
                whole session instead of a specific span.
            session_id:
              type: string
              description: Id of the session this annotation belongs to. Always required.
            text:
              type: string
              description: The note content. 1 to 10,000 characters.
          required:
            - kind
            - session_id
            - text
          description: Free-text note attached to a span or session.
      discriminator:
        propertyName: kind
      description: Discriminated annotation create body. The shape varies by `kind`.
      title: AnnotationInput
    FeedbackAnnotationValue:
      type: string
      enum:
        - positive
        - negative
      description: Sentiment of the feedback.
      title: FeedbackAnnotationValue
    LabelAnnotationValueType:
      type: string
      enum:
        - text
        - numeric
      description: Whether `value` is a text label (`text`) or a number (`numeric`).
      title: LabelAnnotationValueType
    LabelAnnotationValue:
      oneOf:
        - type: string
        - type: number
          format: double
      description: >-
        The label's value. A string when `value_type=text`, a number when
        `value_type=numeric`.
      title: LabelAnnotationValue
    Annotation:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - feedback
              description: Discriminator. Always `feedback` for this variant.
            annotation_id:
              type: string
            workspace:
              type: string
            span_id:
              type: string
              description: >-
                Id of the span this annotation applies to, or omitted for
                session-level annotations.
            session_id:
              type: string
            created_by:
              type: string
            created_at:
              type: string
              format: date-time
            ingested_at:
              type: string
              format: date-time
            value:
              $ref: '#/components/schemas/FeedbackAnnotationValue'
              description: Sentiment of the feedback.
          required:
            - kind
            - annotation_id
            - workspace
            - session_id
            - created_at
            - ingested_at
            - value
          description: Thumbs-up / thumbs-down feedback on a span or session.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - label
              description: Discriminator. Always `label` for this variant.
            annotation_id:
              type: string
            workspace:
              type: string
            span_id:
              type: string
              description: >-
                Id of the span this annotation applies to, or omitted for
                session-level annotations.
            session_id:
              type: string
            created_by:
              type: string
            created_at:
              type: string
              format: date-time
            ingested_at:
              type: string
              format: date-time
            value_type:
              $ref: '#/components/schemas/LabelAnnotationValueType'
              description: >-
                Whether `value` is a text label (`text`) or a number
                (`numeric`).
            value:
              $ref: '#/components/schemas/LabelAnnotationValue'
              description: >-
                The label's value. A string when `value_type=text`, a number
                when `value_type=numeric`.
            name:
              type: string
              description: Name identifying what the label measures, when set.
          required:
            - kind
            - annotation_id
            - workspace
            - session_id
            - created_at
            - ingested_at
            - value_type
            - value
          description: Categorical or numeric label attached to a span or session.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - metadata
              description: Discriminator. Always `metadata` for this variant.
            annotation_id:
              type: string
            workspace:
              type: string
            span_id:
              type: string
              description: >-
                Id of the span this annotation applies to, or omitted for
                session-level annotations.
            session_id:
              type: string
            created_by:
              type: string
            created_at:
              type: string
              format: date-time
            ingested_at:
              type: string
              format: date-time
            metadata:
              type: object
              additionalProperties:
                description: Any type
              description: The metadata key/value pairs.
          required:
            - kind
            - annotation_id
            - workspace
            - session_id
            - created_at
            - ingested_at
            - metadata
          description: Structured key/value metadata attached to a span or session.
        - type: object
          properties:
            kind:
              type: string
              enum:
                - note
              description: Discriminator. Always `note` for this variant.
            annotation_id:
              type: string
            workspace:
              type: string
            span_id:
              type: string
              description: >-
                Id of the span this annotation applies to, or omitted for
                session-level annotations.
            session_id:
              type: string
            created_by:
              type: string
            created_at:
              type: string
              format: date-time
            ingested_at:
              type: string
              format: date-time
            text:
              type: string
              description: The note content.
          required:
            - kind
            - annotation_id
            - workspace
            - session_id
            - created_at
            - ingested_at
            - text
          description: Free-text note attached to a span or session.
      discriminator:
        propertyName: kind
      description: Discriminated annotation read response. The shape varies by `kind`.
      title: Annotation
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          type: object
          additionalProperties:
            description: Any type
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError

```

## Examples



**Request**

```json
{
  "kind": "feedback",
  "session_id": "a1b2c3d4e5f67890",
  "value": "positive"
}
```

**Response**

```json
{
  "kind": "feedback",
  "annotation_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "created_at": "2024-01-15T09:30:00Z",
  "ingested_at": "2024-01-15T09:30:00Z",
  "session_id": "a1b2c3d4e5f67890",
  "value": "positive",
  "workspace": "nemo-analytics",
  "created_by": "user_jdoe",
  "span_id": "span-12345"
}
```

**SDK Code**

```python
import requests

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

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

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

print(response.json())
```

```javascript
const url = 'https://host.com/apis/intake/v2/workspaces/workspace/annotations';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"kind":"feedback","session_id":"a1b2c3d4e5f67890","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://host.com/apis/intake/v2/workspaces/workspace/annotations"

	payload := strings.NewReader("{\n  \"kind\": \"feedback\",\n  \"session_id\": \"a1b2c3d4e5f67890\",\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://host.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\": \"feedback\",\n  \"session_id\": \"a1b2c3d4e5f67890\",\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://host.com/apis/intake/v2/workspaces/workspace/annotations")
  .header("Content-Type", "application/json")
  .body("{\n  \"kind\": \"feedback\",\n  \"session_id\": \"a1b2c3d4e5f67890\",\n  \"value\": \"positive\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

var client = new RestClient("https://host.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\": \"feedback\",\n  \"session_id\": \"a1b2c3d4e5f67890\",\n  \"value\": \"positive\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://host.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()
```