---
title: "Create annotation"
method: POST
path: "/annotations/create"
tags: ["Annotations"]
---

# Create annotation

`POST /annotations/create`

## Request

- Base URL: `https://api.databuddy.cc`
- URL: `https://api.databuddy.cc/annotations/create`
- Auth: API key in header `x-api-key`

Creates a new annotation. Requires website update permission.

## Request body

- object
  - `annotationType` 'point' | 'line' | 'range', required
  - `xValue` union, required
    - string, date
    - string, date-time
  - `xEndValue` union
    - string, date
    - string, date-time
  - `websiteId` string, required
  - `chartType` 'metrics', required
  - `chartContext` object, required
    - `dateRange` object, required
      - `start_date` string, required
      - `end_date` string, required
      - `granularity` 'hourly' | 'daily' | 'weekly' | 'monthly', required
    - `filters` object[]
      - `field` string, required
      - `operator` 'eq' | 'ne' | 'gt' | 'lt' | 'contains', required
      - `value` string, required
    - `metrics` string[]
    - `tabId` string
  - `yValue` number
  - `text` string, required
  - `tags` string[]
  - `color` string
  - `isPublic` boolean

## Response `200`

OK

- object
  - `annotationType` string, required
  - `chartContext` object, required
    - `dateRange` object, required
      - `start_date` string, required
      - `end_date` string, required
      - `granularity` 'hourly' | 'daily' | 'weekly' | 'monthly', required
    - `filters` object[]
      - `field` string, required
      - `operator` 'eq' | 'ne' | 'gt' | 'lt' | 'contains', required
      - `value` string, required
    - `metrics` string[]
    - `tabId` string
  - `chartType` string, required
  - `color` string, required
  - `createdAt` string, date-time, required
  - `createdBy` string, nullable, required
  - `deletedAt` string, date-time, nullable, required
  - `id` string, required
  - `isPublic` boolean, required
  - `tags` string[], nullable, required
  - `text` string, required
  - `updatedAt` string, date-time, required
  - `websiteId` string, required
  - `xEndValue` string, date-time, nullable, required
  - `xValue` string, date-time, required
  - `yValue` number, nullable, required

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `403`: 403
- `404`: 404
- `409`: 409
- `429`: 429
- `500`: 500
- `503`: 503

---

[API](https://skmtc.dev/databuddy/apis/databuddy-api.md) - [All operations](https://skmtc.dev/databuddy/apis/databuddy-api/llms.txt) - [OpenAPI document](https://skmtc.dev/databuddy/apis/databuddy-api/revisions/ddfbba648d52?raw)
