# Create a category

POST https://api.oletapp.com/your-store/v1/categories

A missing or foreign `parent_id` is refused with `404 NOT_FOUND`. Nesting under a system category, or under a parent already at maximum depth, is refused with `400 VALIDATION_FAILED`. Duplicate names are allowed.

**Requires scope:** `catalog:write`

Required scope: `catalog:write`

## Parameters

None.

## Request body

```
{
  name: string
  parent_id?: string
}
```

## Response (201)

```
{
  data: {
  depth: integer
  id: string
  name: string
  parent_id: string | null
  version: string
}
}
```

Errors follow the standard error envelope: https://getolet.com/resources/developers/errors.md

## Example

```bash
curl -X POST "https://api.oletapp.com/your-store/v1/categories" \
  -H "Authorization: Bearer olet_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string"}'
```
