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

# Update service type

> Update a service type identified by `serviceTypeId`.

Usage notes:
- `item` replaces the whole service type: send every field, including the ones you are not changing. Optional fields you leave out (`serviceTypeCode`, `serviceTypeGroupId`, `defaultTaxIds`) are cleared.
- Renaming a service type also updates clear references to the old name in revenue agreements: the same updates ARMS makes without asking when you rename one there. Ambiguous references are left unchanged.
- An unknown `serviceTypeId` returns 400.
- A missing permission returns 401.



## OpenAPI

````yaml /user-docs/api-reference/external-openapi.json put /rms/service_types/update
openapi: 3.1.0
info:
  title: ARMS External API
  version: 1.0.0
  description: >-
    OpenAPI specification generated from external API schemas. Endpoints require
    query parameter carrierId and headers x-arms-api-key and x-arms-assume-user.
  license:
    name: Proprietary
    url: https://cedarai.com
servers:
  - url: https://api-lg.arms.cedarai.com
    description: Production (US)
  - url: https://api-lg.arms.cedarai.se
    description: Production (EU)
security:
  - ApiKeyAuth: []
    AssumeUser: []
paths:
  /rms/service_types/update:
    put:
      summary: Update service type
      description: >-
        Update a service type identified by `serviceTypeId`.


        Usage notes:

        - `item` replaces the whole service type: send every field, including
        the ones you are not changing. Optional fields you leave out
        (`serviceTypeCode`, `serviceTypeGroupId`, `defaultTaxIds`) are cleared.

        - Renaming a service type also updates clear references to the old name
        in revenue agreements: the same updates ARMS makes without asking when
        you rename one there. Ambiguous references are left unchanged.

        - An unknown `serviceTypeId` returns 400.

        - A missing permission returns 401.
      operationId: updateServiceType
      parameters:
        - $ref: '#/components/parameters/CarrierId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateServiceTypeInput'
            examples:
              rename:
                summary: Rename, keeping the code
                value:
                  serviceTypeId: 0b6f7d3e-3c55-4a3e-9d0e-6f1f4f0c2a11
                  item:
                    serviceTypeName: Track Lease - Monthly
                    serviceTypeCode: LEASE
                    contextType: CYCLE
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateServiceTypeOutput'
        '400':
          description: >-
            Bad Request (for example an unknown `serviceTypeId` or a duplicate
            name)
        '401':
          description: Unauthorized (bad key, carrier not permitted, or missing permission)
        '500':
          description: Internal Server Error
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    CarrierId:
      name: carrierId
      in: query
      required: true
      schema:
        type: integer
      description: Carrier identifier; required for all endpoints
  schemas:
    UpdateServiceTypeInput:
      type: object
      required:
        - serviceTypeId
        - item
      properties:
        carrierId:
          type: integer
          description: >-
            Carrier identifier. Defaults to the `carrierId` query parameter; if
            you send it, use the same value.
        serviceTypeId:
          type: string
          format: uuid
          description: ID of the service type to update.
        item:
          $ref: '#/components/schemas/ServiceTypeItemInput'
          description: >-
            The complete service type. It replaces every field: optional fields
            you leave out are cleared.
    UpdateServiceTypeOutput:
      type: object
      properties:
        item:
          $ref: '#/components/schemas/ServiceType'
        contract:
          type: object
          properties:
            effect:
              type: string
              enum:
                - mergeWithItem
            resourceType:
              type: string
              enum:
                - ServiceType
    Error:
      type: object
      properties:
        message:
          type: string
    ServiceTypeItemInput:
      type: object
      required:
        - serviceTypeName
        - contextType
      properties:
        serviceTypeName:
          type: string
          description: >-
            Service type name, for example the name of the matching NetSuite or
            QuickBooks item. Unique per carrier and `contextType`, including
            service types deleted in ARMS. New carriers start with default
            service types such as Demurrage and Storage.
        contextType:
          type: string
          enum:
            - INCIDENTAL
            - CYCLE
            - EXCESS
          description: >-
            How charges of this type are calculated. `INCIDENTAL`: one charge
            per event, such as a switch. `CYCLE`: charged over the time between
            two events, such as storage days. `EXCESS`: charged for time or cars
            beyond an allowance in a billing period.
        serviceTypeCode:
          type: string
          description: >-
            Optional code shown with the service type, for example on invoices
            and exports.
        serviceTypeGroupId:
          type: string
          format: uuid
          description: >-
            Optional ID of one of your service type groups (Service group in
            ARMS), as returned on existing service types.
        defaultTaxIds:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Optional IDs of taxes configured in ARMS that apply by default to
            charges of this service type, as returned on existing service types.
    ServiceType:
      type: object
      description: >-
        A service type: what a charge is for. Fields without a value are left
        out.
      properties:
        serviceTypeId:
          type: string
          format: uuid
        carrierId:
          type: integer
        serviceTypeName:
          type: string
        serviceTypeCode:
          type: string
        contextType:
          type: string
          enum:
            - INCIDENTAL
            - CYCLE
            - EXCESS
        serviceTypeGroupId:
          type: string
          format: uuid
        serviceTypeGroupName:
          type: string
        defaultTaxIds:
          type: array
          items:
            type: string
            format: uuid
        createdAt:
          type: string
          format: date-time
        createdById:
          type: string
          format: uuid
        updatedAt:
          type: string
          format: date-time
        updatedById:
          type: string
          format: uuid
        deletedAt:
          type: string
          format: date-time
        deletedById:
          type: string
          format: uuid
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-arms-api-key
      description: Your ARMS API key
    AssumeUser:
      type: apiKey
      in: header
      name: x-arms-assume-user
      description: Email of a user assigned to the appropriate user group

````

## Related topics

- [API Introduction](/user-docs/api-reference/introduction.md)
- [QuickBooks Web Connector](/user-docs/accounting-integrations/quickbooks-web-connector.md)
- [List service types](/api-reference/list-service-types.md)
- [Create service type](/api-reference/create-service-type.md)
- [Get service type](/api-reference/get-service-type.md)
