---
title: "POST /api/categories"
method: POST
path: "/api/categories"
tags: ["categories"]
---

# POST /api/categories

`POST /api/categories`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - API key in cookie `sessionid`

## Request body

- CategoryRequest
  - `id` integer, required
  - `name` string, required
  - `desc` string

## Response `201`

- Category
  - `id` integer, required
  - `name` string, required
  - `desc` string
  - `videocount` integer, required

## Other responses

- `400`
- `401`
- `403`
- `404`
- `405`
- `406`
- `415`
- `500`

## Changes

- **2026-08-19** `2bacf53705f7`: 1 breaking, 1 info
  - api path removed without deprecation
  - endpoint added
- **2026-08-18** `baf6b00d7559`: 1 breaking
  - the `videocount` response's property type changed from `string` to `integer` for status `201`
- **2026-08-15** `9164f6763019`: 1 info
  - added the non-success response with the status `404`
- **2025-08-17** `14b27b584fd2`: 7 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
  - added the non-success response with the status `405`
  - …3 more
- **2025-08-04** `ec9531386449`: 1 breaking
  - the `name` request property's minLength was increased from `0` to `1`

[Operation history](https://skmtc.dev/frikanalen/apis/frikanalen-django-api/changes/api/categories/post.md)

---

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