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

# Update a snippet category's name

Updates the name of an existing snippet category. The parent relationship and sort position are managed through the separate position endpoint.


## OpenAPI

````yaml https://api.getfernand.com/openapi.json patch /snippets/categories/{id}
openapi: 3.0.3
info:
  title: Fernand API Documentation
  version: '3.0'
  description: This is the documentation for the [Fernand](https://getfernand.com) API.
  termsOfService: https://getfernand.com/terms
  contact:
    name: Fernand Support
    url: https://getfernand.com
    email: support@getfernand.com
  x-logo:
    url: https://app.getfernand.com/images/favicon/icon_128.png
servers:
  - url: https://api.getfernand.com
    description: ''
    x-last-modified: 1764750693905
security:
  - apiKeyHeader: []
externalDocs:
  description: You can access our documentation online by visiting https://api.fernand.help
  url: https://api.fernand.help
paths:
  /snippets/categories/{id}:
    patch:
      tags:
        - Snippet Categories
      summary: Update a snippet category's name
      description: >-
        Updates the name of an existing snippet category. The parent
        relationship and sort position are managed through the separate position
        endpoint.
      operationId: updateSnippetCategory
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
          description: ID of the category to update.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 50
                  nullable: true
                  description: New name for the category (optional).
                  example: Updated Support
              required:
                - name
      responses:
        '200':
          description: Category updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnippetCategory'
        '400':
          description: Invalid input.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '404':
          description: Category not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  schemas:
    SnippetCategory:
      type: object
      properties:
        id:
          type: integer
          format: int32
          description: Unique identifier for the snippet category
          example: 5
        name:
          type: string
          maxLength: 250
          description: Name of the category
          example: Customer Support
        parent_id:
          type: integer
          format: int32
          nullable: true
          description: ID of the parent category (null for root-level categories)
          example: 2
        sort:
          type: integer
          format: int32
          description: Sort order within the parent category (1-based)
          example: 1
      required:
        - id
        - name
        - sort
      x-computed-hash: 1b4d16a9a35a9d103ccbdaccc7316600d08ef27b337e5623ad58f40ccc9f763b
      x-last-modified: 1769075324
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      description: >-
        Authenticate your account by including your secret key in API requests.

        You can manage your API keys in the
        [Dashboard](https://app.getfernand.com/).


        Authentication to the API is performed by using the HTTP Header
        X-API-Key.
      name: X-API-Key
      in: header
      x-last-modified: 1764750344730

````