> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cookiechimp.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update category

> Update category by ID



## OpenAPI

````yaml put /categories/{id}
openapi: 3.1.0
info:
  title: CookieChimp API
  description: API for CookieChimp.com
  version: 1.0.1
servers:
  - url: https://cookiechimp.com/api/v1
security:
  - authorization: []
paths:
  /categories/{id}:
    put:
      tags:
        - Categories
      summary: Update category
      description: Update category by ID
      operationId: updateCategory
      parameters:
        - $ref: '#/components/parameters/id'
      requestBody:
        description: Category to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CategoryWrite'
      responses:
        '200':
          description: Updated category
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Category'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    id:
      name: id
      in: path
      description: ID of the resource
      required: true
      schema:
        type: string
  schemas:
    CategoryWrite:
      type: object
      properties:
        name:
          type: string
          description: Name of the category that is displayed to users
        description:
          type: string
          description: Description of the category that is displayed to users
        required:
          type: boolean
          description: Whether the category is required for the website to function
      required:
        - name
        - description
        - required
    Category:
      type: object
      allOf:
        - $ref: '#/components/schemas/CategoryWrite'
      properties:
        id:
          type: string
          readOnly: true
          description: Unique identifier for the category
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date and time when the category was created
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Date and time when the category was last updated
      example:
        id: essential
        name: Essential
        description: Cookies essential for website functionality
        required: true
        created_at: '2023-01-01T00:00:00Z'
        updated_at: '2023-01-02T00:00:00Z'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
      example:
        error:
          code: 400
          message: Invalid request
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      description: API token obtained from the login endpoint or the dashboard

````