---
title: "Store a new category"
method: POST
path: "/v1/categories"
tags: ["categories"]
---

# Store a new category

`POST /v1/categories`

## Request

- Base URL: `https://demo.firefly-iii.org/api`
- URL: `https://demo.firefly-iii.org/api/v1/categories`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://demo.firefly-iii.org/oauth/authorize`
    - Token URL: `https://demo.firefly-iii.org/oauth/token`
  - HTTP bearer

Creates a new category. The data required can be submitted as a JSON body or as a list of parameters.

## Headers

- `X-Trace-Id` string, uuid

## Request body

- CategoryStore
  - `name` string, string, required
  - `notes` string, string, nullable

## Response `200`

New category stored, result in response.

- CategorySingle
  - `data` CategoryRead, required
    - `type` string, string, required: Immutable value
    - `id` string, string, required
    - `attributes` CategoryProperties, required
      - `created_at` string, date-time
      - `updated_at` string, date-time
      - `name` string, string, required
      - `notes` string, string, nullable
      - `object_has_currency_setting` boolean: This object never has its own currency setting, so this value is always false.
      - `primary_currency_id` string, string: The currency ID of the administration's primary currency.
      - `primary_currency_name` string, string: The currency name of the administration's primary currency.
      - `primary_currency_code` string, string: The currency code of the administration's primary currency.
      - `primary_currency_symbol` string, string: The currency symbol of the administration's primary currency.
      - `primary_currency_decimal_places` integer: The currency decimal places of the administration's primary currency.
      - `spent` ArrayEntryWithCurrencyAndSum[]: Amount(s) spent in the currencies in the database for this category. ONLY present when start and date are set.
        - `currency_id` string, string
        - `currency_code` string, string
        - `currency_symbol` string, string
        - `currency_decimal_places` integer: Number of decimals supported by the currency
        - `sum` string, amount: The amount earned, spent or transferred.
      - `pc_spent` ArrayEntryWithCurrencyAndSum[]: Amount(s) spent in the primary currency in the database for this category. ONLY present when start and date are set.
        - `currency_id` string, string
        - `currency_code` string, string
        - `currency_symbol` string, string
        - `currency_decimal_places` integer: Number of decimals supported by the currency
        - `sum` string, amount: The amount earned, spent or transferred.
      - `earned` ArrayEntryWithCurrencyAndSum[]: Amount(s) earned in the currencies in the database for this category. ONLY present when start and date are set.
        - `currency_id` string, string
        - `currency_code` string, string
        - `currency_symbol` string, string
        - `currency_decimal_places` integer: Number of decimals supported by the currency
        - `sum` string, amount: The amount earned, spent or transferred.
      - `pc_earned` ArrayEntryWithCurrencyAndSum[]: Amount(s) earned in the primary currency in the database for this category. ONLY present when start and date are set.
        - `currency_id` string, string
        - `currency_code` string, string
        - `currency_symbol` string, string
        - `currency_decimal_places` integer: Number of decimals supported by the currency
        - `sum` string, amount: The amount earned, spent or transferred.
      - `transferred` ArrayEntryWithCurrencyAndSum[]: Amount(s) transferred in the currencies in the database for this category. ONLY present when start and date are set.
        - `currency_id` string, string
        - `currency_code` string, string
        - `currency_symbol` string, string
        - `currency_decimal_places` integer: Number of decimals supported by the currency
        - `sum` string, amount: The amount earned, spent or transferred.
      - `pc_transferred` ArrayEntryWithCurrencyAndSum[]: Amount(s) transferred in primary currency in the database for this category. ONLY present when start and date are set.
        - `currency_id` string, string
        - `currency_code` string, string
        - `currency_symbol` string, string
        - `currency_decimal_places` integer: Number of decimals supported by the currency
        - `sum` string, amount: The amount earned, spent or transferred.

## Other responses

- `400`: Bad request
- `401`: Unauthenticated
- `404`: Page not found
- `422`: Validation error. The body will have the exact details.
- `500`: Internal exception

---

[API](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-5-5.md) - [All operations](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-5-5/llms.txt) - [OpenAPI document](https://skmtc.dev/firefly-iii/apis/firefly-iii-api-v6-5-5/revisions/906276730447?raw)
