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

# Update a category

> Update an existing product category by id. Requires the WRITE_CATEGORIES scope.

Updates an existing category within the store. The store is bound to your app token server-side — never send a shop id.


## OpenAPI

````yaml PUT /categories/{id}
openapi: 3.1.0
info:
  title: Salesive Apps API — Customers & Categories
  version: 1.0.0
  description: >-
    Read and manage the store's customers and product categories from an
    installed third-party app. Every endpoint authenticates with an
    installed-app access token (prefix `app_`) and requires a specific OAuth
    scope. The target store is bound to the token server-side from the
    installation — never send a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /categories/{id}:
    put:
      tags:
        - Categories
      summary: Update a category
      description: >-
        Updates an existing category by id within the store. Returns 404 if the
        category is not in this store. The store is bound to the app token
        server-side from the installation — never send a shop id. Requires the
        `WRITE_CATEGORIES` scope.
      operationId: updateCategory
      parameters:
        - $ref: '#/components/parameters/CategoryId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CategoryUpdate'
            example:
              description: Phones, laptops, audio and accessories
      responses:
        '200':
          description: The updated category.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Category'
              example:
                status: 200
                success: true
                message: Category updated successfully
                data:
                  _id: 6651ab12cd34ef56ab78cd90
                  name: Electronics
                  slug: electronics
                  description: Phones, laptops, audio and accessories
                  image: https://cdn.example.com/c/electronics.png
                  deleted: false
                  deletedAt: null
                  shop: 664f0e2a1c2b3d4e5f6a7b8c
                  createdAt: '2026-04-10T12:00:00.000Z'
                  updatedAt: '2026-06-28T08:15:00.000Z'
                  id: 6651ab12cd34ef56ab78cd90
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/CategoryNotFound'
components:
  parameters:
    CategoryId:
      name: id
      in: path
      required: true
      description: The category id.
      schema:
        type: string
  schemas:
    CategoryUpdate:
      type: object
      description: Fields accepted when updating a category.
      properties:
        name:
          type: string
          description: Updated category name.
        description:
          type:
            - string
            - 'null'
          description: Updated description. May be null or empty.
        image:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Updated image URL. Must be a valid URI if provided; may be null or
            empty.
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
          description: HTTP status code, echoed in the body.
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Human-readable result message.
    Category:
      type: object
      description: >-
        A store-scoped product category. The `productCount` field is included on
        list and get responses.
      properties:
        _id:
          type: string
        id:
          type: string
          description: Virtual alias of `_id`.
        name:
          type: string
        slug:
          type: string
          description: URL-friendly slug auto-generated from the name.
        description:
          type:
            - string
            - 'null'
        image:
          type:
            - string
            - 'null'
        deleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
        shop:
          type: string
          description: The store id (bound server-side).
        productCount:
          type: integer
          description: Number of products assigned to this category.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 401
            success: false
            message: Authentication required
            data: null
    Forbidden:
      description: The app token is missing the OAuth scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 403
            success: false
            message: Insufficient scope
            data: null
    CategoryNotFound:
      description: The category does not exist or is not in the installation's store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 404
            success: false
            message: Category not found
            data: null
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side — never send a shop
        id.

````