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



## OpenAPI

````yaml /swagger.yaml put /projects/{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:
  /projects/{id}:
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    put:
      tags:
        - Project
      summary: Update a project
      operationId: projects#update
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyProjectUpdate'
            examples:
              example:
                $ref: '#/components/examples/requestBodyProjectUpdate'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              examples:
                example:
                  $ref: '#/components/examples/project'
              schema:
                $ref: '#/components/schemas/project'
        '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'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
        - apiKey: []
components:
  schemas:
    requestBodyProjectUpdate:
      type: object
      properties:
        name:
          type: string
          description: The project name
        code:
          type: string
          description: The project number
        client_id:
          type: integer
        billing_client_id:
          type: integer
        address_id:
          type: integer
        category_ids:
          type: array
          items:
            type: integer
          description: The project schedule ids
        project_users:
          type: array
          items:
            $ref: '#/components/schemas/requestBodyProjectUserUpdate'
    project:
      type: object
      properties:
        id:
          type: integer
          description: The unique identifier for the project.
        name:
          type: string
          description: The name of the project.
        code:
          type: string
          nullable: true
          description: The number of the project.
        client:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/contact'
        billing_client:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/contact'
        address:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/address'
        categories:
          type: array
          items:
            $ref: '#/components/schemas/category'
          description: The categories of the project.
        project_currency:
          $ref: '#/components/schemas/projectCurrency'
        project_users:
          type: array
          items:
            $ref: '#/components/schemas/projectUser'
          description: The project users of the project.
    error:
      type: object
      properties:
        error:
          type: string
    requestBodyProjectUserUpdate:
      type: object
      properties:
        user_id:
          type: integer
        access:
          type: string
          enum:
            - admin
            - edit
            - view
      required:
        - user_id
        - access
    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'
    address:
      type: object
      properties:
        id:
          type: integer
        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
        postal_code:
          type: string
          nullable: true
        region_id:
          type: integer
          nullable: true
    category:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        children:
          type: array
          items:
            $ref: '#/components/schemas/category'
    projectCurrency:
      properties:
        enabled:
          type: boolean
        currency:
          $ref: '#/components/schemas/currency'
        exchange_rates:
          type: array
          items:
            $ref: '#/components/schemas/exchangeRate'
    projectUser:
      type: object
      properties:
        user_id:
          type: integer
        access:
          type: string
          enum:
            - admin
            - view
            - edit
    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
    currency:
      type: object
      properties:
        id:
          type: integer
        iso_code:
          type: string
        name:
          type: string
    exchangeRate:
      properties:
        rate:
          type: number
        exchange_currency:
          $ref: '#/components/schemas/currency'
  examples:
    requestBodyProjectUpdate:
      summary: An example of updating a project
      value:
        name: Project 42
        category_ids:
          - 1
          - 2
          - 3
    project:
      summary: A sample project response
      value:
        id: 5
        name: Sample Project (With Purchasing)
        code:
          client:
            id: 19
            name: Sample Client
            data:
              notes:
                value:
                  value: This is a sample client
              account:
                value:
                  vat: null
                  terms: null
                  currency: USD
                  lead_time: null
                  credit_limit: null
                  account_number: null
                  registration_number: null
              address:
                value:
                  - id: 19
                    city: New York
                    name: Sample Client
                    phone: '0123456789'
                    state: New York
                    country: United States of America
                    contacts:
                      value:
                        - id: 19
                          name: Sample Client
                          note: This is a sample client
                          email: info@client.com
                          phone: '0123456789'
                          position: null
                    post_code: '10001'
                    address_line_1: A street address
                    address_line_2: null
                    team_region_id: null
              company_details:
                value:
                  email: info@client.com
                  website: null
                  language: null
                  password: null
                  user_name: null
                  company_name: Sample Client
            addresses:
              - id: 19
                name: Sample Client
                phone: '0123456789'
                postcode: '10001'
                address_line_1: A street address
                address_line_2: null
                city: New York
                state: New York
                country: United States of America
            people:
              - id: 19
                name: Sample Client
                email: info@client.com
                phone: '0123456789'
                position: null
                note: This is a sample client
            category:
              id: 3
              type: client
            billing_client: null
            categories:
              - id: 157
                name: Cooking Equipment
                code: ''
                key: cooking_equipment
                children: []
              - id: 168
                name: Banquet and Event Equipment
                code: ''
                key: banquet_and_event_equipment
                children:
                  - id: 170
                    name: Buffet Stations and Display Tables
                    code: ''
                    key: buffet_stations_and_display_tables
                    children: []
                  - id: 171
                    name: Audiovisual Equipment
                    code: ''
                    key: audiovisual_equipment
                    children: []
            project_currency:
              enabled: true
              currency:
                id: 1
                iso_code: USD
                name: United States dollar
              exchange_rates:
                - rate: 73.49
                  exchange_currency:
                    id: 4
                    iso_code: EUR
                    name: Euro
                - rate: 99.78
                  exchange_currency:
                    id: 15
                    iso_code: AUD
                    name: Australian dollar
            project_users:
              - access: admin
                user_id: 1
              - access: edit
                user_id: 4
              - access: edit
                user_id: 5
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header

````