> ## 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 unit

> Update a unit

<sup>Required permissions: `unit:write`</sup>



## OpenAPI

````yaml put /units/{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:
  /units/{id}:
    parameters: []
    put:
      tags:
        - Unit
      summary: Update a unit
      description: |-
        Update a unit

        <sup>Required permissions: `unit:write`</sup>
      operationId: updateUnit
      parameters:
        - name: id
          in: path
          description: Unit identifier
          required: true
          deprecated: false
          schema:
            type: string
          style: simple
          explode: false
      requestBody:
        description: The updated Unit resource
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Unit-UnitUpdate'
          text/html:
            schema:
              $ref: '#/components/schemas/Unit-UnitUpdate'
        required: true
      responses:
        '200':
          description: Unit resource updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit-UnitRead'
            text/html:
              schema:
                $ref: '#/components/schemas/Unit-UnitRead'
          links: {}
        '400':
          description: Invalid input
        '404':
          description: Resource not found
        '422':
          description: Unprocessable entity
      deprecated: false
      security:
        - JWT:
            - unit:write
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X PUT \
             /units/{id} \
             --header "Content-Type: application/json" \
             --header "Authorization: Bearer <token>" \
             --data '{
                "translations": []
            }'
components:
  schemas:
    Unit-UnitUpdate:
      type: object
      description: ''
      deprecated: false
      properties:
        translations:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/UnitTranslation-UnitUpdate'
    Unit-UnitRead:
      type: object
      description: ''
      deprecated: false
      properties:
        id:
          $ref: '#/components/schemas/UnitId-UnitRead'
          readOnly: true
        name:
          example: Stück
          type: string
        translations:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/UnitTranslation-UnitRead'
        createdAt:
          readOnly: true
          description: The date and time when the resource 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 resource was last updated.
          example: '2021-01-01T00:00:00+00:00'
          type: string
          format: date-time
    UnitTranslation-UnitUpdate:
      type: object
      description: ''
      deprecated: false
      required:
        - name
        - locale
      properties:
        name:
          maxLength: 255
          example: Stück
          type: string
        locale:
          example: de
          type: string
    UnitId-UnitRead:
      type: object
      description: ''
      deprecated: false
    UnitTranslation-UnitRead:
      type: object
      description: ''
      deprecated: false
      required:
        - name
        - locale
      properties:
        name:
          maxLength: 255
          example: Stück
          type: string
        locale:
          example: de
          type: string
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````