---
updatedAt: 2025-06-05T21:41:10.000Z
agentTools:
  projectIndex: https://apidocs.officient.io/llms.txt
---

# Add expense category

The api end-point to add an expense nd an optional category id

Scope required: expenses.categories:read expenses.categories:write

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "officient-api",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.officient.io"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {}
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/1.0/expenses/categories/add": {
      "post": {
        "summary": "Add expense category",
        "description": "The api end-point to add an expense nd an optional category id",
        "operationId": "add-expense-category",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "type"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "default": "total",
                    "enum": [
                      "total",
                      "kilometer-allowance",
                      "day-allowance"
                    ]
                  },
                  "price-per-kilometer": {
                    "type": "number",
                    "format": "float"
                  },
                  "price-per-day": {
                    "type": "number",
                    "format": "float"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"success\": 1\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"status_code\": 400,\n    \"reason_phrase\": \"Expense categories of type 'total' are not allowed to have a price per kilometer.\"\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status_code": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "reason_phrase": {
                          "type": "string",
                          "example": "An expense category with that name already exists"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status_code": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "reason_phrase": {
                          "type": "string",
                          "example": "Price per kilometer has to be more than 0."
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status_code": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "reason_phrase": {
                          "type": "string",
                          "example": "Expense categories of type 'total' are not allowed to have a price per kilometer."
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "http",
              "code": "{\n\t\"name\": \"Regular expense\",\n  \"type\": \"total\"\n}"
            },
            {
              "language": "text",
              "code": "{\n\t\"name\": \"Regular expense\",\n  \"type\": \"total\"\n}"
            }
          ],
          "samples-languages": [
            "http",
            "text"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```