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

# Update a contact



## OpenAPI

````yaml /swagger.yaml put /contacts/{id}
openapi: 3.0.1
info:
  title: Fohlio REST API
  description: This is the documentation for the Fohlio REST API.
  version: 1.0.0
servers:
  - url: /openapi
  - url: https://app.fohlio.com/be/openapi
security: []
paths:
  /contacts/{id}:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    put:
      tags:
        - Contact
      summary: Update a contact
      operationId: contacts#update
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyContactUpdate'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contact'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
        - apiKey: []
components:
  schemas:
    requestBodyContactUpdate:
      type: object
      properties:
        id:
          type: integer
        category_type:
          type: string
          enum:
            - client_category
            - supplier_category
            - general_contractor_category
            - manufacture_category
            - warehouse_category
        new_data:
          type: object
          properties:
            company_details:
              type: object
              properties:
                value:
                  type: object
                  properties:
                    company_name:
                      type: string
                    email:
                      type: string
                    website:
                      type: string
                    language:
                      type: string
                    user_name:
                      type: string
                    password:
                      type: string
            address:
              type: object
              properties:
                value:
                  type: object
                  properties:
                    name:
                      type: string
                    phone:
                      type: string
                    address_line_1:
                      type: string
                    address_line_2:
                      type: string
                    country:
                      type: string
                    state:
                      type: string
                    city:
                      type: string
                    post_code:
                      type: string
                    contacts:
                      type: object
                      properties:
                        value:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              phone:
                                type: string
                              position:
                                type: string
                              email:
                                type: string
                              note:
                                type: string
      required:
        - id
        - category_type
        - new_data
    contact:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        data:
          type: object
          additionalProperties: true
          description: The details of the contact encoded in JSON format.
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/contactAddress'
        people:
          type: array
          items:
            $ref: '#/components/schemas/contactPerson'
        categories:
          type: array
          items:
            $ref: '#/components/schemas/contactCategory'
    error:
      type: object
      properties:
        error:
          type: string
    contactAddress:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        phone:
          type: string
          nullable: true
        post_code:
          type: string
          nullable: true
        address_line_1:
          type: string
          nullable: true
        address_line_2:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        priority:
          type: boolean
    contactPerson:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        position:
          type: string
          nullable: true
        note:
          type: string
          nullable: true
        priority:
          type: boolean
    contactCategory:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
          enum:
            - client
            - supplier
            - general_contractor
            - manufacture
            - warehouse
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header

````