---
title: "POST /api/v1/charts"
method: POST
path: "/api/v1/charts"
tags: ["PublicCharts"]
---

# POST /api/v1/charts

`POST /api/v1/charts`

## Request

- Base URL: `https://api.habitpocket.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.habitpocket.io/api/v1/charts`
- Auth: API key in header `X-API-KEY`

## Request body

- CreatePublicChartRequest
  - `name` string, required
  - `type` string, required
  - `habitIds` string[], required
  - `days` integer
  - `candleBottomOffset` integer
  - `candleTopOffset` integer

## Response `201`

Created

- PublicChartModel
  - `id` string, uuid
  - `name` string, nullable
  - `type` string, nullable
  - `habitIds` string[], nullable
  - `days` integer
  - `isDefault` boolean
  - `candleBottomOffset` integer
  - `candleTopOffset` integer

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required

---

[API](https://skmtc.dev/habitpocket/apis/metricspocket-public-api.md) - [All operations](https://skmtc.dev/habitpocket/apis/metricspocket-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/habitpocket/apis/metricspocket-public-api/revisions/28a2063c7bbe?raw)
