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

# Update Device By Id

> This endpoint update a Device.

You can specify the attributes which you want to be updated and their new values.

The updated Device is returned in the response.



## OpenAPI

````yaml openapi_2024-03-26 patch /device/{device_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: '2024-03-26'
servers:
  - url: https://api.pathstack.io
    description: PathStack production environment
security: []
paths:
  /device/{device_id}:
    patch:
      tags:
        - Devices
      summary: Update Device By Id
      description: >-
        This endpoint update a Device.


        You can specify the attributes which you want to be updated and their
        new values.


        The updated Device is returned in the response.
      operationId: update_device_by_id_device__device_id__patch
      parameters:
        - name: device_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Device id
            description: Device ID of the Device to be updated
          description: Device ID of the Device to be updated
        - name: x-api-version
          in: header
          required: false
          schema:
            type: string
            format: date
            default: '2024-03-26'
            title: X-Api-Version
          examples:
            default:
              value: '2024-03-26'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success_Device_'
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 400
                        title: Error code
                      message:
                        type: string
                        example: Invalid JWT format
                        title: Error message
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 401
                        title: Error code
                      message:
                        type: string
                        example: >-
                          Authentication header is missing, or token is
                          invalid/expired.
                        title: Error message
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 403
                        title: Error code
                      message:
                        type: string
                        example: You do not have access to this resource
                        title: Error message
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 404
                        title: Error code
                      message:
                        type: string
                        example: Device with ID <device_id> not found
                        title: Error message
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 422
                        title: Error code
                      message:
                        type: string
                        example: Field required
                        title: Error message
                      loc:
                        items:
                          anyOf:
                            - type: string
                            - type: integer
                        type: array
                        title: Location
                      msg:
                        type: string
                        title: Message
                      type:
                        type: string
                        title: Error Type
          description: Unprocessable Entity
      security:
        - JWTBearer: []
components:
  schemas:
    DeviceUpdate:
      properties:
        registration:
          anyOf:
            - type: string
            - type: 'null'
          title: Registration
        make:
          anyOf:
            - type: string
            - type: 'null'
          title: Make
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        year:
          anyOf:
            - type: integer
            - type: 'null'
          title: Year
        active:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Active
        tags:
          anyOf:
            - items:
                type: string
                maxLength: 255
                minLength: 1
              type: array
              maxItems: 10
            - type: 'null'
          title: Tags for the Device
          description: |2-

                            A maximum of 10 tags is allowed on a Device. Each tag must have a length between 1 and 255
                            characters. Tags are stored in lower case, and duplicate tags are removed. Leading and trailing 
                            whitespaces are removed.
                            
      type: object
      title: DeviceUpdate
    Success_Device_:
      properties:
        data:
          $ref: '#/components/schemas/Device'
          description: Successful response payload
      type: object
      required:
        - data
      title: Success[Device]
    Device:
      properties:
        system_device_id:
          type: string
          title: System Device Id
        registration:
          anyOf:
            - type: string
            - type: 'null'
          title: Registration
        make:
          anyOf:
            - type: string
            - type: 'null'
          title: Make
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        year:
          anyOf:
            - type: integer
            - type: 'null'
          title: Year
        active:
          type: boolean
          title: Active
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
        id:
          type: string
          format: uuid4
          title: Id
        connection_id:
          type: string
          format: uuid4
          title: Connection Id
      type: object
      required:
        - system_device_id
        - registration
        - make
        - model
        - year
        - active
        - tags
        - id
        - connection_id
      title: Device
  securitySchemes:
    JWTBearer:
      type: http
      scheme: bearer

````