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

# Update a cost centre

> Update a cost centre. A cost centre can be of type KOST1 or KOST2 and must have a unique code.

<sup>Required permissions: `cost-centre:write`</sup>



## OpenAPI

````yaml patch /accounting/cost-centres/{id}
openapi: 3.1.0
info:
  title: Fynn API
  description: ''
  termsOfService: https://www.fynn.eu/tos
  contact:
    name: Fynn UG (haftungsbeschränkt)
    url: https://www.fynn.eu
    email: hi@fynn.eu
  license:
    name: Proprietary
    url: https://www.fynn.eu/license
  version: 0.0.0
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - JWT: []
tags: []
paths:
  /accounting/cost-centres/{id}:
    parameters: []
    patch:
      tags:
        - CostCentre
      summary: Update a cost centre
      description: >-
        Update a cost centre. A cost centre can be of type KOST1 or KOST2 and
        must have a unique code.


        <sup>Required permissions: `cost-centre:write`</sup>
      operationId: updateCostCentre
      parameters:
        - name: id
          in: path
          description: CostCentre identifier
          required: true
          deprecated: false
          schema:
            type: string
          style: simple
          explode: false
      requestBody:
        description: The updated CostCentre resource
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/CostCentre-CostCentreWrite'
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/CostCentre-CostCentreWrite'
        required: true
      responses:
        '200':
          description: CostCentre resource updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CostCentre-CostCentreRead'
            text/html:
              schema:
                $ref: '#/components/schemas/CostCentre-CostCentreRead'
          links: {}
        '400':
          description: Invalid input
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity
      deprecated: false
      security:
        - JWT:
            - cost-centre:write
components:
  schemas:
    CostCentre-CostCentreWrite:
      type: object
      description: ''
      deprecated: false
      required:
        - name
        - type
        - status
      properties:
        name:
          maxLength: 255
          description: The name of the cost centre, which is displayed in the UI
          example: Cost Centre
          type: string
        type:
          description: The type of the cost centre, which is used for exports
          example: KOST1
          type: string
          enum:
            - KOST1
            - KOST2
        status:
          description: |-
            The status of the cost centre

            Possible values:
             * `active`: The cost centre is active and can be used and referenced
             * `archived`: The cost centre is archived and cannot be referenced anymore. It also disappears from the UI.
          default: active
          example: active
    CostCentre-CostCentreRead:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          readOnly: true
          example: ad8f1c9c-4f0a-4e1a-8b1a-9c4d9c4d9c4d
          type: string
        name:
          maxLength: 255
          description: The name of the cost centre, which is displayed in the UI
          example: Cost Centre
          type: string
        code:
          description: The code of the cost centre, which is used for exports
          example: CC
          type: string
        type:
          description: The type of the cost centre, which is used for exports
          example: KOST1
          type: string
          enum:
            - KOST1
            - KOST2
        status:
          description: |-
            The status of the cost centre

            Possible values:
             * `active`: The cost centre is active and can be used and referenced
             * `archived`: The cost centre is archived and cannot be referenced anymore. It also disappears from the UI.
          default: active
          example: active
        createdAt:
          readOnly: true
          description: The date and time when the cost centre was created
          example: '2021-01-01T00:00:00+00:00'
          type: string
          format: date-time
        updatedAt:
          readOnly: true
          description: The date and time when the cost centre was last updated
          example: '2021-01-01T00:00:00+00:00'
          type: string
          format: date-time
      required:
        - name
        - type
        - status
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````