---
title: "Create annotation"
method: POST
path: "/workspaces/{workspace_id}/projects/{project_id}/annotations"
tags: ["Annotations"]
---

# Create annotation

`POST /workspaces/{workspace_id}/projects/{project_id}/annotations`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/workspaces/{workspace_id}/projects/{project_id}/annotations`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

Create an annotation thread on a dataset, dataview, or workflow.

## Path parameters

- `workspace_id` integer, required: Workspace refers to a collection of projects. Workspace ID is unique identifier for workspace.
- `project_id` integer, required: Project ID of the workspace

## Request body

- CreateAnnotationRequest
  - `target_type` 'dataset' | 'dataview' | 'workflow', required: Type of the annotated resource: dataset, dataview, or workflow
  - `target_id` integer, required: ID of the annotated resource
  - `body` string, required: Initial comment body

## Response `201`

Document created, URL follows

- AnnotationResponse
  - `id` integer, required
  - `target_type` string, required
  - `target_id` integer, required
  - `project_id` integer, required
  - `status` string, required
  - `resolved_by` integer, nullable
  - `resolved_at` string, nullable
  - `created_by` integer, required
  - `created_at` string, nullable
  - `comments` AnnotationCommentResponse[]
    - `id` integer, required
    - `annotation_id` integer, required
    - `body` string, required
    - `created_by` integer, required
    - `created_at` string, nullable

## Other responses

- `400`: Bad request syntax or unsupported method
- `422`: Server is not able to process the contained instructions

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/fe078afe239b?raw)
