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

# Update service details or product assignment



## OpenAPI

````yaml /docs/service-api.yaml patch /services/{service}
openapi: 3.1.0
info:
  title: Spartan Service API
  version: 1.1.0
  description: >-
    Service inventory, lifecycle, billing, pricing, notes, members, addons,
    provider service details, upgrades, downgrades, and evidence. All operations
    require a bearer API token with the documented `x-permission`.
servers:
  - url: https:/docs.dezerx.com/api/application
    description: Development
security:
  - bearerAuth: []
tags:
  - name: Services
  - name: Lifecycle
  - name: Billing
  - name: Members
  - name: Service Details
  - name: Evidence
paths:
  /services/{service}:
    parameters:
      - $ref: '#/components/parameters/ServiceId'
    patch:
      tags:
        - Services
      summary: Update service details or product assignment
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type:
                    - string
                    - 'null'
                  maxLength: 255
                product_id:
                  type:
                    - integer
                    - 'null'
                category_id:
                  type:
                    - integer
                    - 'null'
      responses:
        '200':
          $ref: '#/components/responses/Service'
        '422':
          $ref: '#/components/responses/Error'
components:
  parameters:
    ServiceId:
      name: service
      in: path
      required: true
      schema:
        type: integer
  responses:
    Service:
      description: Service response
      content:
        application/json:
          schema:
            type: object
            required:
              - data
              - meta
            properties:
              data:
                $ref: '#/components/schemas/Service'
              message:
                type: string
              meta:
                type: object
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Service:
      type: object
      required:
        - id
        - status
        - price
      properties:
        id:
          type: integer
        name:
          type:
            - string
            - 'null'
        status:
          type: string
        owner:
          type:
            - object
            - 'null'
        product:
          type:
            - object
            - 'null'
        category:
          type:
            - object
            - 'null'
        module:
          type:
            - string
            - 'null'
        price:
          type: number
        billing_cycle:
          type:
            - string
            - 'null'
        due_date:
          type:
            - string
            - 'null'
          format: date-time
        addons:
          type: array
    Error:
      type: object
      required:
        - error
        - request_id
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
        request_id:
          type: string
          format: uuid
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````