---
updatedAt: 2025-05-19T20:30:35.000Z
agentTools:
  projectIndex: https://developers.pocketsmith.com/llms.txt
---

# Update category

Updates a category by its ID.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "PocketSmith",
    "description": "The PocketSmith API",
    "contact": {
      "name": "API Support",
      "email": "api@pocketsmith.com"
    },
    "version": "2.0"
  },
  "x-samples-languages": [
    "curl",
    "node",
    "javascript",
    "php",
    "python"
  ],
  "servers": [
    {
      "url": "https://api.pocketsmith.com/v2",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "developerKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Developer-Key",
        "description": "If you want to build a tool just for yourself, be it a desktop widget to display your balances or a tool to import transactions from a bank without a bank feed, you can use our developer keys feature. You can issue yourself a key which will give you persistent API access to just your account. You should rotate your keys regularly."
      }
    },
    "responses": {
      "403": {
        "description": "Not Allowed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "404": {
        "description": "Not Found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "422": {
        "description": "Validation Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Category": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The unique identifier of the category.",
            "example": 1438154
          },
          "title": {
            "type": "string",
            "description": "The title of the category.",
            "example": "Beer"
          },
          "colour": {
            "type": "string",
            "description": "The colour for the category.",
            "format": "CSS-style hex triplet",
            "example": "#00ff00"
          },
          "children": {
            "type": "array",
            "description": "The category's child categories.",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "parent_id": {
            "type": "integer",
            "description": "The unique identifier of the parent category of this category, or null if this category has no parent (i.e. is a top-level category)",
            "example": 42
          },
          "is_transfer": {
            "type": "boolean",
            "description": "Whether this category has been marked as a transfer category.",
            "example": false
          },
          "is_bill": {
            "type": "boolean",
            "description": "Whether the category is a bill category. A bill category is when budgeted amounts are normally spent at once, instead of spread across a budgeting period. This category will be included in the bill reminder email when set to true.",
            "example": true
          },
          "roll_up": {
            "type": "boolean",
            "description": "Whether the category's budget is rolled up into its parent category, if a parent category is present.",
            "example": false
          },
          "refund_behaviour": {
            "type": "string",
            "nullable": true,
            "description": "How the category's refunds or deductions should be reported on.",
            "enum": [
              "debits_are_deductions",
              "credits_are_refunds",
              null
            ],
            "example": "credits_are_refunds"
          },
          "created_at": {
            "type": "string",
            "description": "When the category was created.",
            "format": "ISO 8601 timestamp",
            "example": "2015-08-16T02:17:02Z"
          },
          "updated_at": {
            "type": "string",
            "description": "When the category was last updated.",
            "format": "ISO 8601 timestamp",
            "example": "2015-08-16T02:17:02Z"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A message describing the error that occurred.",
            "example": "A message describing the error that occurred."
          }
        }
      }
    }
  },
  "paths": {
    "/categories/{id}": {
      "put": {
        "summary": "Update category",
        "description": "Updates a category by its ID.",
        "tags": [
          "Categories"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique identifier of the category.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 42
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "A new title for the category.",
                    "example": "Food"
                  },
                  "colour": {
                    "type": "string",
                    "description": "A new CSS-style hex colour for the category.",
                    "example": "#e0e7ff"
                  },
                  "parent_id": {
                    "type": "integer",
                    "description": "The unique identifier of a parent category for the category, making this category a child of that category.",
                    "example": 42
                  },
                  "is_transfer": {
                    "type": "boolean",
                    "description": "Set the category as a transfer category.",
                    "example": false
                  },
                  "is_bill": {
                    "type": "boolean",
                    "description": "Set the category as a bill category.",
                    "example": true
                  },
                  "roll_up": {
                    "type": "boolean",
                    "description": "Set the category to be rolled up into its parent category.",
                    "example": false
                  },
                  "refund_behaviour": {
                    "type": "string",
                    "nullable": true,
                    "description": "Set the refund behaviour of the category.",
                    "enum": [
                      "debits_are_deductions",
                      "credits_are_refunds",
                      null
                    ],
                    "example": "credits_are_refunds"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Category"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "422": {
            "$ref": "#/components/responses/422"
          }
        }
      }
    }
  },
  "security": [
    {
      "developerKey": []
    }
  ]
}
```