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

# Create a project



## OpenAPI

````yaml /swagger.yaml post /projects
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:
    post:
      tags:
        - Project
      summary: Create a project
      operationId: projects#create
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyProjectCreate'
            examples:
              test_example:
                $ref: '#/components/examples/requestBodyProjectCreate'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              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'
      security:
        - apiKey: []
components:
  schemas:
    requestBodyProjectCreate:
      type: object
      properties:
        name:
          type: string
        code:
          type: string
        iso_currency_code:
          type: string
        source_project_id:
          type: integer
        client_id:
          type: integer
        billing_client_id:
          type: integer
        address_id:
          type: integer
        category_ids:
          type: array
          items:
            type: integer
        project_users:
          type: array
          items:
            $ref: '#/components/schemas/requestBodyProjectUserCreate'
      required:
        - name
    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
    requestBodyProjectUserCreate:
      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:
    requestBodyProjectCreate:
      summary: An example of the request body for project creation
      value:
        name: Project 42
        category_ids:
          - 1
          - 2
          - 3
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header

````