openapi: 3.0.0
info:
  title: Apacta Partner API
  version: 0.0.43
  description: |
    This is the **Partner API** - a stable, documented API designed for external integrations and third-party developers.

    Endpoints in this API follow semantic versioning and we strive to maintain backward compatibility. Breaking changes will be communicated in advance.

    If you're building an integration with Apacta, this is the API you should use.

    **Pagination** - If the endpoint returns a `pagination` object it means the endpoint supports pagination - currently it's only possible to change pages with `?page={page_number}` but implementing custom page sizes are on the road map.

    **Search/filter** - See the individual endpoints' docs for further explanation.

    **Ordering** - On some endpoints it's implemented on URL querys so eg. to order Invoices by `invoice_number` appending `?sort=Invoices.invoice_number&direction=desc` would sort the list descending by the value of `invoice_number`.

    **Errors/Exceptions** - 422 (Validation) example response:

    ```json
    {
        "success": false,
        "data": {
            "code": 422,
            "url": "/api/v1/contacts?api_key=5523be3b-30ef-425d-8203-04df7caaa93a",
            "message": "A validation error occurred",
            "errorCount": 1,
            "errors": {
                "contact_types": [
                    "Contacts must have at least one contact type"
                ]
            }
        }
    }
    ```
  license:
    name: Proprietary
    url: https://apacta.com/forretnings-og-abonnementsbetingelser
servers:
  - url: https://app.apacta.com/api/v1
tags:
  - name: Activities
    description: Operations related to activities
  - name: TimeEntries
    description: Experimental - Time entry operations
  - name: TimeEntryTypes
    description: Experimental - Time entry type operations
  - name: Contacts
    description: Operations related to contacts
  - name: ContactPersons
    description: Operations related to contact persons
  - name: Invoices
    description: Operations related to invoices
paths:
  /activities:
    get:
      operationId: getActivities
      summary: Get a list of activities
      tags:
        - Activities
      security:
        - bearerAuth: []
      parameters:
        - name: erp_id
          in: query
          description: Search for activities with a specific ERP id
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Activity'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createActivity
      summary: Create an activity
      tags:
        - Activities
      security:
        - bearerAuth: []
      requestBody:
        $ref: '#/components/requestBodies/Activity'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptySuccessResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /activities/{activity_id}:
    put:
      operationId: updateActivity
      summary: Edit an activity
      tags:
        - Activities
      security:
        - bearerAuth: []
      parameters:
        - name: activity_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        $ref: '#/components/requestBodies/Activity'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptySuccessResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Record not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
    delete:
      operationId: deleteActivity
      summary: Delete an activity
      tags:
        - Activities
      security:
        - bearerAuth: []
      parameters:
        - name: activity_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptySuccessResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Record not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /cities:
    get:
      operationId: getCities
      summary: Get list of cities supported in Apacta
      tags:
        - Cities
      security:
        - bearerAuth: []
      parameters:
        - name: zip_code
          in: query
          description: Used to search for a city with specific zip code
          required: false
          schema:
            type: string
        - name: name
          in: query
          description: Used to search for a city by name
          required: false
          schema:
            type: string
        - name: include_all
          in: query
          description: Used to search for a city without filtering by country
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/City'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /cities/{city_id}:
    get:
      operationId: getCity
      summary: Get details about one city
      tags:
        - Cities
      security:
        - bearerAuth: []
      parameters:
        - name: city_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/City'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /clocking_records:
    get:
      operationId: getClockingRecords
      summary: Get a list of clocking records
      tags:
        - ClockingRecords
      security:
        - bearerAuth: []
      parameters:
        - name: active
          in: query
          description: Used to search for active clocking records
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ClockingRecord'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createClockingRecord
      summary: Create clocking record for authenticated user
      tags:
        - ClockingRecords
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  format: uuid
                checkin_longitude:
                  type: string
                checkin_latitude:
                  type: string
                checkout_longitude:
                  type: string
                checkout_latitude:
                  type: string
      responses:
        '201':
          description: Successfully added clocking record
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /clocking_records/checkout:
    post:
      operationId: checkoutClockingRecord
      summary: Checkout active clocking record for authenticated user
      tags:
        - ClockingRecords
      security:
        - bearerAuth: []
      responses:
        '201':
          description: Successfully checked out
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /clocking_records/{clocking_record_id}:
    get:
      operationId: getClockingRecord
      summary: Details of 1 clocking_record
      tags:
        - ClockingRecords
      security:
        - bearerAuth: []
      parameters:
        - name: clocking_record_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/ClockingRecord'
        '404':
          description: Clocking record not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    put:
      operationId: updateClockingRecord
      summary: Edit a clocking record
      tags:
        - ClockingRecords
      security:
        - bearerAuth: []
      parameters:
        - name: clocking_record_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
    delete:
      operationId: deleteClockingRecord
      summary: Delete a clocking record
      tags:
        - ClockingRecords
      security:
        - bearerAuth: []
      parameters:
        - name: clocking_record_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: string
        '401':
          description: Unauthorized
  /companies:
    get:
      operationId: getCompanies
      summary: Get a list of companies
      tags:
        - Companies
      security:
        - bearerAuth: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Company'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
  /companies/{company_id}:
    get:
      operationId: getCompany
      summary: Details of 1 company
      tags:
        - Companies
      security:
        - bearerAuth: []
      parameters:
        - name: company_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Company object
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/Company'
        '404':
          description: Company not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /companies/subscription_self_service:
    get:
      operationId: getCompanySubscriptionSelfService
      summary: URL for subscription selfservice
      tags:
        - Companies
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Self service url
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/SubscriptionSelfServiceRequestBody'
        '404':
          description: Company not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /company_settings:
    get:
      operationId: getCompaySettingsList
      summary: Get a list of company settings
      tags:
        - CompanySettings
      security:
        - bearerAuth: []
      parameters:
        - name: name
          in: query
          description: Filter by name
          schema:
            type: string
        - name: description
          in: query
          description: Filter by description
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/CompanySettings'
        '404':
          description: CompanySetting not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /contacts:
    get:
      operationId: getContacts
      summary: Get a list of contacts
      tags:
        - Contacts
      security:
        - bearerAuth: []
      parameters:
        - name: name
          in: query
          description: Used to search for a contact with a specific name
          required: false
          schema:
            type: string
        - name: cvr
          in: query
          description: Search for values in CVR field
          schema:
            type: string
        - name: ean
          in: query
          description: Search for values in EAN field
          schema:
            type: string
        - name: erp_id
          in: query
          description: Search for values in ERP id field
          schema:
            type: string
        - name: city
          in: query
          description: Used to show only contacts with with one specific `City`
          schema:
            type: string
        - name: modified_gte
          in: query
          schema:
            type: string
            format: datetime
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Contact'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createContact
      summary: Add a new contact
      tags:
        - Contacts
      security:
        - bearerAuth: []
      requestBody:
        $ref: '#/components/requestBodies/Contact'
      responses:
        '201':
          description: Successfully added contact
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /contacts/{contact_id}:
    get:
      operationId: getContact
      summary: Details of 1 contact
      tags:
        - Contacts
      security:
        - bearerAuth: []
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/Contact'
        '404':
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    put:
      operationId: updateContact
      summary: Edit a contact
      tags:
        - Contacts
      security:
        - bearerAuth: []
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/Contact'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
    delete:
      operationId: deleteContact
      summary: Delete a contact
      tags:
        - Contacts
      security:
        - bearerAuth: []
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: string
        '401':
          description: Unauthorized
  /contacts/{contact_id}/contact_persons:
    get:
      operationId: getContactPersonsList
      summary: Get a list of contact people
      description: Get a list of contact people associated with a contact
      tags:
        - ContactPersons
      security:
        - bearerAuth: []
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
        - name: q
          in: query
          schema:
            type: string
        - name: created_gte
          in: query
          schema:
            type: string
            format: date
        - name: created_lte
          in: query
          schema:
            type: string
            format: date
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ContactPerson'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    post:
      operationId: addContactPerson
      summary: Add a new contact person to a contact
      tags:
        - ContactPersons
      security:
        - bearerAuth: []
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/addContactPersonContactperson'
      responses:
        '201':
          description: Successfully added contact person
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /contacts/{contact_id}/contact_persons/{contact_person_id}:
    get:
      operationId: getContactPerson
      summary: Get a contact person
      tags:
        - ContactPersons
      security:
        - bearerAuth: []
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
        - name: contact_person_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/ContactPerson'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    put:
      operationId: editContactPerson
      summary: Edit a contact person
      tags:
        - ContactPersons
      security:
        - bearerAuth: []
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
        - name: contact_person_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/addContactPersonContactperson'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    delete:
      operationId: deleteContactPerson
      summary: Delete a contact person
      tags:
        - ContactPersons
      security:
        - bearerAuth: []
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
        - name: contact_person_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: string
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /countries:
    get:
      operationId: getCountries
      summary: Get list of countries supported in Apacta
      tags:
        - Countries
      security:
        - bearerAuth: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Country'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /countries/{country_id}:
    get:
      operationId: getCountry
      summary: Get details about one country
      tags:
        - Countries
      security:
        - bearerAuth: []
      parameters:
        - name: country_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/Country'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /currencies:
    get:
      operationId: getCurrencies
      summary: Get list of currencies supported in Apacta
      tags:
        - Currencies
      security:
        - bearerAuth: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Currency'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /currencies/{currency_id}:
    get:
      operationId: getCurrency
      summary: Get details about one currency
      tags:
        - Currencies
      security:
        - bearerAuth: []
      parameters:
        - name: currency_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/Currency'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /expense_lines:
    get:
      operationId: getExpenseLines
      summary: Show list of expense lines
      tags:
        - ExpenseLines
      security:
        - bearerAuth: []
      parameters:
        - name: created_by_id
          in: query
          schema:
            type: string
            format: uuid
        - name: currency_id
          in: query
          schema:
            type: string
            format: uuid
        - name: expense_id
          in: query
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ExpenseLine'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createExpenseLine
      summary: Add line to expense
      tags:
        - ExpenseLines
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                expense_id:
                  type: string
                  format: uuid
                currency_id:
                  type: string
                  format: uuid
                text:
                  type: string
                  maxLength: 255
                selling_price:
                  type: number
                  format: float
                buying_price:
                  type: number
                  format: float
                quantity:
                  type: integer
                  format: int32
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /expense_lines/{expense_line_id}:
    get:
      operationId: getExpenseLine
      summary: Show expense line
      tags:
        - ExpenseLines
      security:
        - bearerAuth: []
      parameters:
        - name: expense_line_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/ExpenseLine'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    put:
      operationId: updateExpenseLine
      summary: Edit expense line
      tags:
        - ExpenseLines
      security:
        - bearerAuth: []
      parameters:
        - name: expense_line_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/ExpenseLine'
        '401':
          description: Unauthorized
    delete:
      operationId: deleteExpenseLine
      summary: Delete expense line
      tags:
        - ExpenseLines
      security:
        - bearerAuth: []
      parameters:
        - name: expense_line_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/ExpenseLine'
        '401':
          description: Unauthorized
  /expenses:
    get:
      operationId: getExpenses
      summary: Show list of expenses
      tags:
        - Expenses
      security:
        - bearerAuth: []
      parameters:
        - name: created_by_id
          in: query
          schema:
            type: string
            format: uuid
        - name: company_id
          in: query
          schema:
            type: string
            format: uuid
        - name: contact_id
          in: query
          schema:
            type: string
            format: uuid
        - name: project_id
          in: query
          schema:
            type: string
            format: uuid
        - name: due_date
          in: query
          description: Filter by [valid=records in future including today], [exceeded=records in past] or [null=all records]
          schema:
            type: string
            format: string
            nullable: true
            enum:
              - valid
              - exceeded
        - name: gt_created
          in: query
          description: Created after date
          schema:
            type: string
            format: date
        - name: lt_created
          in: query
          description: Created before date
          schema:
            type: string
            format: date
        - name: status
          in: query
          description: Filter by status identifier. [null=all records]
          schema:
            type: string
            format: string
            nullable: true
            enum:
              - expired_subscription
              - approved
        - name: is_imported
          in: query
          schema:
            type: boolean
            default: true
        - name: min_amount
          in: query
          description: Expenses `total_selling_price` > `min_amount`
          schema:
            type: number
            format: float
        - name: max_amount
          in: query
          description: Expenses `total_selling_price` < `max_amount`
          schema:
            type: number
            format: float
        - name: projects
          in: query
          description: You can select `all projects`, `no projects` or select `multiple projects`
          schema:
            description: Use 'all', 'none', or comma-separated project IDs
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Expense'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createExpense
      summary: Create new expense
      tags:
        - Expenses
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contact_id:
                  type: string
                  format: uuid
                project_id:
                  type: string
                  format: uuid
                currency_id:
                  type: string
                  format: uuid
                delivery_date:
                  type: string
                  format: date
                short_text:
                  type: string
                  maxLength: 255
                supplier_invoice_number:
                  type: string
                  maxLength: 255
                reference:
                  type: string
                  maxLength: 8192
                description:
                  type: string
                  maxLength: 8192
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /expenses/{expense_id}:
    get:
      operationId: getExpense
      summary: Show expense
      tags:
        - Expenses
      security:
        - bearerAuth: []
      parameters:
        - name: expense_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/Expense'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    put:
      operationId: updateExpense
      summary: Edit expense
      tags:
        - Expenses
      security:
        - bearerAuth: []
      parameters:
        - name: expense_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/Expense'
        '401':
          description: Unauthorized
    delete:
      operationId: deleteExpense
      summary: Delete expense
      tags:
        - Expenses
      security:
        - bearerAuth: []
      parameters:
        - name: expense_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/Expense'
        '401':
          description: Unauthorized
  /forms:
    get:
      operationId: listForms
      summary: Retrieve array of forms
      tags:
        - Forms
      security:
        - bearerAuth: []
      parameters:
        - name: extended
          in: query
          description: Used to have extended details from the forms from the `Form`'s `FormFields`
          schema:
            type: boolean
        - name: date_from
          in: query
          description: Used in conjunction with `date_to` to only show forms within these dates - format like `2016-28-05`
          schema:
            type: string
            format: Y-m-d
        - name: date_to
          in: query
          description: Used in conjunction with `date_from` to only show forms within these dates - format like `2016-28-30`
          schema:
            type: string
            format: Y-m-d
        - name: show
          in: query
          description: Used to show forms with trashed
          schema:
            type: string
            format: with_trashed
        - name: project_id
          in: query
          description: Used to filter on the `project_id` of the forms
          schema:
            type: string
            format: uuid
        - name: created_by_id
          in: query
          description: Used to filter on the `created_by_id` of the forms
          required: false
          schema:
            type: string
        - name: form_template_id
          in: query
          description: Used to filter on the `form_template_id` of the forms. Accept single value and array.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: form_template_type
          in: query
          description: Filter by `form_templates.identifier` containing string passed in `form_template_type`. Accept strings like [`qa`, `dagseddel`]
          schema:
            type: string
        - name: employee_name
          in: query
          description: Used to filter forms by user's first or last name
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Form'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createForm
      summary: Add new form
      description: Used to add a form into the system
      tags:
        - Forms
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - project_id
                - form_template_id
              properties:
                project_id:
                  type: string
                  format: uuid
                form_template_id:
                  type: string
                  format: uuid
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /forms/{form_id}:
    get:
      operationId: getForm
      summary: View form
      tags:
        - Forms
      security:
        - bearerAuth: []
      parameters:
        - name: form_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/Form'
        '401':
          description: Unauthorized
    put:
      operationId: updateForm
      summary: Edit a form
      tags:
        - Forms
      security:
        - bearerAuth: []
      parameters:
        - name: form_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
        '401':
          description: Unauthorized
    delete:
      operationId: deleteForm
      summary: Delete a form
      description: You can only delete the forms that you've submitted yourself
      tags:
        - Forms
      security:
        - bearerAuth: []
      parameters:
        - name: form_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
        '401':
          description: Unauthorized
  /forms/undelete/{form_id}:
    get:
      operationId: getFormsUndelete
      summary: Undelete form and related entities to it
      tags:
        - Forms
      security:
        - bearerAuth: []
      parameters:
        - name: form_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptySuccessResponse'
        '401':
          description: Unauthorized
  /form_templates:
    get:
      operationId: listFormTemplates
      summary: Get array of form_templates for your company
      tags:
        - FormTemplates
      security:
        - bearerAuth: []
      parameters:
        - name: name
          in: query
          description: Used to filter on the `name` of the form_templates
          schema:
            type: string
        - name: identifier
          in: query
          description: Used to filter on the `identifier` of the form_templates
          required: false
          schema:
            type: string
        - name: pdf_template_identifier
          in: query
          description: Used to filter on the `pdf_template_identifier` of the form_templates
          schema:
            type: string
        - name: description
          in: query
          description: Used to filter on the `description` of the form_templates
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/FormTemplate'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
  /form_templates/{form_template_id}:
    get:
      operationId: getFormTemplate
      summary: View one form template
      tags:
        - FormTemplates
      security:
        - bearerAuth: []
      parameters:
        - name: form_template_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/FormTemplate'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /invoices:
    get:
      operationId: listInvoices
      summary: View list of invoices
      tags:
        - Invoices
      security:
        - bearerAuth: []
      parameters:
        - name: contact_id
          in: query
          description: Used to filter on the `contact_id` of the invoices
          schema:
            type: string
            format: uuid
        - name: project_id
          in: query
          description: Used to filter on the `project_id` of the invoices
          required: false
          schema:
            type: string
            format: uuid
        - name: invoice_number
          in: query
          description: Used to filter on the `invoice_number` of the invoices
          schema:
            type: string
        - name: is_draft
          in: query
          schema:
            type: integer
            enum:
              - 0
              - 1
        - name: is_locked
          in: query
          schema:
            type: integer
            enum:
              - 0
              - 1
        - name: is_fixed_price
          in: query
          schema:
            type: integer
            enum:
              - 0
              - 1
        - name: date_from
          in: query
          schema:
            type: string
            format: date
        - name: date_to
          in: query
          schema:
            type: string
            format: date
        - name: issued_date
          in: query
          schema:
            type: string
            format: date
        - name: sent_as_draft
          in: query
          description: Used to filter invoices which are sent as draft to integration
          schema:
            type: integer
        - name: erp_id
          in: query
          description: Search for invoices with a specific ERP id
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Invoice'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createInvoice
      summary: Add invoice
      tags:
        - Invoices
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contact_id:
                  type: string
                  format: uuid
                project_id:
                  type: string
                  format: uuid
                payment_term_id:
                  type: string
                  format: uuid
                invoice_number:
                  type: integer
                  format: int32
                  maxLength: 8
                offer_number:
                  type: integer
                  format: int32
                  maxLength: 8
                message:
                  type: string
                  maxLength: 8192
                reference:
                  type: string
                  maxLength: 255
                issued_date:
                  type: string
                  format: date
                created_or_modified_gte:
                  type: string
                  format: date
                payment_due_date:
                  type: string
                  format: date
                date_from:
                  type: string
                  format: date
                date_to:
                  type: string
                  format: date
                is_draft:
                  type: boolean
                is_offer:
                  type: boolean
                is_locked:
                  type: boolean
                vat_percent:
                  type: integer
                  format: int32
                  maxLength: 2
                erp_id:
                  type: string
                  maxLength: 255
                erp_payment_term_id:
                  type: string
                  maxLength: 255
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /invoices/{invoice_id}:
    get:
      operationId: getInvoice
      summary: View invoice
      tags:
        - Invoices
      security:
        - bearerAuth: []
      parameters:
        - name: invoice_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/Invoice'
        '401':
          description: Unauthorized
    put:
      operationId: updateInvoice
      summary: Edit invoice
      tags:
        - Invoices
      security:
        - bearerAuth: []
      parameters:
        - name: invoice_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contact_id:
                  type: string
                  format: uuid
                project_id:
                  type: string
                  format: uuid
                payment_term_id:
                  type: string
                  format: uuid
                invoice_number:
                  type: integer
                  format: int32
                  maxLength: 8
                message:
                  type: string
                  maxLength: 8192
                reference:
                  type: string
                  maxLength: 255
                issued_date:
                  type: string
                  format: date
                payment_due_date:
                  type: string
                  format: date
                date_from:
                  type: string
                  format: date
                date_to:
                  type: string
                  format: date
                is_draft:
                  type: boolean
                is_locked:
                  type: boolean
                vat_percent:
                  type: integer
                  format: int32
                  maxLength: 2
                erp_id:
                  type: string
                  maxLength: 255
                erp_payment_term_id:
                  type: string
                  maxLength: 255
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
    delete:
      operationId: deleteInvoice
      summary: Delete invoice
      tags:
        - Invoices
      security:
        - bearerAuth: []
      parameters:
        - name: invoice_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
  /invoice_lines:
    get:
      operationId: listInvoiceLines
      summary: View list of invoice lines
      tags:
        - InvoiceLines
      security:
        - bearerAuth: []
      parameters:
        - name: invoice_id
          in: query
          schema:
            type: string
            format: uuid
        - name: product_id
          in: query
          schema:
            type: string
            format: uuid
        - name: user_id
          in: query
          schema:
            type: string
            format: uuid
        - name: name
          in: query
          schema:
            type: string
        - name: discount_text
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InvoiceLine'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
  /invoice_lines/{invoice_line_id}:
    get:
      operationId: getInvoiceLine
      summary: View invoice line
      tags:
        - InvoiceLines
      security:
        - bearerAuth: []
      parameters:
        - name: invoice_line_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/InvoiceLine'
        '401':
          description: Unauthorized
  /ping:
    get:
      operationId: listPing
      summary: Check if API is up and API key works
      tags:
        - Ping
      security:
        - bearerAuth: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    default: ok
        '401':
          description: Unauthorized
  /products:
    post:
      operationId: createProduct
      summary: Add new product
      tags:
        - Products
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  maxLength: 255
                description:
                  type: string
                  maxLength: 8192
                product_number:
                  type: string
                  maxLength: 255
                barcode:
                  type: string
                  maxLength: 255
                buying_price:
                  type: number
                  format: double
                selling_price:
                  type: number
                  format: double
                erp_id:
                  type: string
                  maxLength: 255
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
    get:
      operationId: listProducts
      summary: List products
      tags:
        - Products
      security:
        - bearerAuth: []
      parameters:
        - name: name
          in: query
          description: Used to filter on the `name` of the products
          schema:
            type: string
        - name: product_number
          in: query
          description: Used to filter on the `product_number` of the products
          schema:
            type: string
            format: uuid
        - name: barcode
          in: query
          description: Used to filter on the `barcode` of the products
          schema:
            type: string
        - name: modified_gte
          in: query
          schema:
            type: string
            format: datetime
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Product'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
  /products/{product_id}:
    get:
      operationId: getProduct
      summary: View single product
      tags:
        - Products
      security:
        - bearerAuth: []
      parameters:
        - name: product_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/Product'
        '401':
          description: Unauthorized
    put:
      operationId: updateProduct
      summary: Edit a product
      tags:
        - Products
      security:
        - bearerAuth: []
      parameters:
        - name: product_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
    delete:
      operationId: deleteProduct
      summary: Delete a product
      tags:
        - Products
      security:
        - bearerAuth: []
      parameters:
        - name: product_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: string
        '401':
          description: Unauthorized
  /products/undelete/{product_id}:
    post:
      operationId: createProductsUndelete
      summary: Restore a deleted product
      tags:
        - Products
      security:
        - bearerAuth: []
      parameters:
        - name: product_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptySuccessResponse'
        '401':
          description: Unauthorized
  /projects:
    get:
      operationId: listProjects
      summary: View list of projects
      description: |
        Returns a paginated list of projects.

        ## Sub-Projects (Undersager)

        By default, sub-projects (projects with a `parent_id`) are **excluded** from results.
        To include sub-projects, you must pass `withChildProjects=true`.

        ### Finding sub-projects of a parent project
        ```
        GET /projects?parent_id={parent_project_uuid}&withChildProjects=true
        ```

        ### Searching sub-projects by erp_project_id
        ```
        GET /projects?erp_project_id={erp_id}&withChildProjects=true
        ```

        **Important:** If you create a sub-project and cannot find it immediately after,
        ensure you are passing `withChildProjects=true` in your search request.
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: show_all
          in: query
          description: Unless this is set to `true` only open projects will be shown
          required: false
          schema:
            type: boolean
            default: false
        - name: sort
          in: query
          description: Sort projects by `not_invoiced_amount`
          schema:
            type: string
        - name: direction
          in: query
          schema:
            type: string
        - name: contact_id
          in: query
          description: Used to filter on the `contact_id` of the projects
          schema:
            type: string
            format: uuid
        - name: company_id
          in: query
          description: Used to filter on the `company_id` of the projects
          schema:
            type: string
            format: uuid
        - name: project_status_id
          in: query
          description: Used to filter on the `project_status_id` of the projects
          schema:
            type: string
            format: uuid
        - name: project_status_ids
          in: query
          description: Used to filter on the `project_status_id` of the projects (match any of the provided values)
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: name
          in: query
          description: Used to search on the `name` of the projects
          schema:
            type: string
        - name: erp_project_id
          in: query
          description: Used to search on the `erp_project_id` of the projects
          schema:
            type: string
        - name: erp_task_id
          in: query
          description: Used to search on the `erp_task_id` of the projects
          schema:
            type: string
        - name: start_time_gte
          in: query
          description: Show projects with start time after than this value
          schema:
            type: string
        - name: start_time_lte
          in: query
          description: Show projects with start time before this value
          schema:
            type: string
        - name: start_time_eq
          in: query
          description: Show only projects with start time on specific date
          schema:
            type: string
        - name: event_start[][gt]
          in: query
          schema:
            type: string
            format: datetime
        - name: event_start[][lt]
          in: query
          schema:
            type: string
            format: datetime
        - name: event_start[][eq]
          in: query
          schema:
            type: string
            format: datetime
        - name: event_end[][gt]
          in: query
          schema:
            type: string
            format: datetime
        - name: event_end[][lt]
          in: query
          schema:
            type: string
            format: datetime
        - name: event_end[][eq]
          in: query
          schema:
            type: string
            format: datetime
        - name: parent_id
          in: query
          description: Filter to show only sub-projects of a specific parent project. Must be used with `withChildProjects=true`.
          schema:
            type: string
            format: uuid
        - name: withChildProjects
          in: query
          description: |
            By default, sub-projects (projects with a `parent_id`) are excluded from search results.
            Set to `true` to include sub-projects in the results.

            **Required** when:
            - Searching by `erp_project_id` for sub-projects
            - Using `parent_id` filter to find child projects
            - Looking for recently created sub-projects
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Project'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createProject
      summary: Add a project
      tags:
        - Projects
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                contact_id:
                  type: string
                  format: uuid
                parent_id:
                  description: |
                    UUID of the parent project to create this as a sub-project.

                    **Validation requirements:**
                    - The parent project must exist and belong to the same company
                    - A project cannot be its own parent

                    If validation fails, the response will have `success: false` with details in the `errors` object:
                    ```json
                    {
                      "success": false,
                      "data": {
                        "code": 422,
                        "message": "A validation error occurred",
                        "errors": {
                          "parent_id": ["Project does not exist."]
                        }
                      }
                    }
                    ```

                    **Note:** After creating a sub-project, you must use `withChildProjects=true` when searching to find it.
                  type: string
                  format: uuid
                city_id:
                  type: string
                  format: uuid
                project_status_id:
                  type: string
                  format: uuid
                name:
                  type: string
                  maxLength: 255
                description:
                  type: string
                  maxLength: 8192
                street_name:
                  type: string
                  maxLength: 255
                start_time:
                  type: string
                  format: datetime
                erp_project_id:
                  type: string
                  maxLength: 255
                erp_task_id:
                  type: string
                  maxLength: 255
                child_projects:
                  type: array
                  items:
                    type: object
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /projects/{project_id}:
    get:
      operationId: getProject
      summary: View specific project
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/Project'
        '401':
          description: Unauthorized
    put:
      operationId: updateProject
      summary: Edit a project
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                contact_id:
                  type: string
                  format: uuid
                project_status_id:
                  type: string
                  format: uuid
                name:
                  type: string
                  maxLength: 255
                description:
                  type: string
                  maxLength: 8192
                street_name:
                  type: string
                  maxLength: 255
                start_time:
                  type: string
                  format: datetime
                erp_project_id:
                  type: string
                  maxLength: 255
                erp_task_id:
                  type: string
                  maxLength: 255
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
    delete:
      operationId: deleteProject
      summary: Delete a project
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: string
        '401':
          description: Unauthorized
  /projects/{project_id}/all_files:
    get:
      operationId: listProjectsAllFiles
      summary: Show list of all files uploaded to project
      description: Used to show files uploaded to a project from form, expense and project
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      type: string
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
  /projects/{project_id}/files:
    get:
      operationId: listProjectsFiles
      summary: Show list of files uploaded to project
      description: Used to show files uploaded to a project from wall post or form
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: array
                    items:
                      type: string
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
  /projects/{project_id}/files/{file_id}:
    get:
      operationId: getProjectsFiles
      summary: Show file
      description: Show file uploaded to a project from wall post or form
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
        - name: file_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    put:
      operationId: updateProjectsFiles
      summary: Edit file
      description: Edit file uploaded to a project from wall post or form
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: file_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
        '401':
          description: Unauthorized
    delete:
      operationId: deleteProjectsFiles
      summary: Delete file
      description: Delete file uploaded to a project from wall post or form
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: file_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
        '401':
          description: Unauthorized
  /projects/{project_id}/users:
    get:
      operationId: listProjectsUsers
      summary: Show list of users added to project
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createProjectsUsers
      summary: Add user to project
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - user_id
              properties:
                user_id:
                  type: string
                  format: uuid
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /projects/{project_id}/users/{user_id}:
    get:
      operationId: getProjectsUsers
      summary: View specific user assigned to project
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/User'
        '401':
          description: Unauthorized
    delete:
      operationId: deleteProjectsUsers
      summary: Delete user from project
      tags:
        - Projects
      security:
        - bearerAuth: []
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
  /projects/has_projects_with_custom_statuses:
    get:
      operationId: listProjectsHasProjectsWithCustomStatuses
      summary: Check if the company has projects with custom statuses
      tags:
        - ProjectStatuses
        - Projects
      security:
        - bearerAuth: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  has_custom_statuses:
                    type: boolean
        '401':
          description: Unauthorized
  /project_statuses:
    get:
      operationId: listProjectStatuses
      summary: Get list of project statuses
      tags:
        - ProjectStatuses
      security:
        - bearerAuth: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProjectStatus'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createProjectStatuse
      summary: Create a new project status
      tags:
        - ProjectStatuses
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_status_type_id:
                  type: string
                  format: uuid
                name:
                  type: string
                  maxLength: 255
                description:
                  type: string
                  maxLength: 8192
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSuccessResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /project_statuses/{project_status_id}:
    get:
      operationId: getProjectStatuse
      summary: Get a single project status
      tags:
        - ProjectStatuses
      security:
        - bearerAuth: []
      parameters:
        - name: project_status_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    $ref: '#/components/schemas/ProjectStatus'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    put:
      operationId: updateProjectStatuse
      summary: Edit a project status
      tags:
        - ProjectStatuses
      security:
        - bearerAuth: []
      parameters:
        - name: project_status_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptySuccessResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Record Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
    delete:
      operationId: deleteProjectStatuse
      summary: Delete a project status
      tags:
        - ProjectStatuses
      security:
        - bearerAuth: []
      parameters:
        - name: project_status_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptySuccessResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Record not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
  /project_statuses/add_default:
    post:
      operationId: createProjectStatusesAddDefault
      summary: Add default project statuses to company
      tags:
        - DefaultProjectStatuses
      security:
        - bearerAuth: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddDefaultProjectStatusesError'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddDefaultProjectStatusesSuccess'
  /time_entries:
    post:
      operationId: createTimeEntrie
      summary: Add new time entry
      tags:
        - TimeEntries
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - user_id
                - time_entry_type_id
              properties:
                user_id:
                  type: string
                  format: uuid
                form_id:
                  type: string
                  format: uuid
                project_id:
                  type: string
                  format: uuid
                time_entry_type_id:
                  type: string
                  format: uuid
                from_time:
                  type: string
                  format: dateTime
                to_time:
                  type: string
                  format: dateTime
                sum:
                  description: Amount of seconds - should only be included when using is_all_day, otherwise will be calculated from from_time and to_time
                  type: integer
                  format: int32
                is_all_day:
                  type: boolean
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
    get:
      operationId: listTimeEntries
      summary: List time entries
      tags:
        - TimeEntries
      security:
        - bearerAuth: []
      parameters:
        - name: user_id
          in: query
          schema:
            type: string
        - name: form_id
          in: query
          schema:
            type: string
        - name: project_id
          in: query
          schema:
            type: string
        - name: gt_from_time
          in: query
          schema:
            type: string
        - name: lt_from_time
          in: query
          schema:
            type: string
        - name: gt_to_time
          in: query
          schema:
            type: string
        - name: lt_to_time
          in: query
          schema:
            type: string
        - name: lt_sum
          in: query
          schema:
            type: string
        - name: gt_sum
          in: query
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/TimeEntry'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
  /time_entries/{time_entry_id}:
    get:
      operationId: getTimeEntrie
      summary: View time entry
      tags:
        - TimeEntries
      security:
        - bearerAuth: []
      parameters:
        - name: time_entry_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/TimeEntry'
        '401':
          description: Unauthorized
    put:
      operationId: updateTimeEntrie
      summary: Edit time entry
      tags:
        - TimeEntries
      security:
        - bearerAuth: []
      parameters:
        - name: time_entry_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
    delete:
      operationId: deleteTimeEntrie
      summary: Delete time entry
      tags:
        - TimeEntries
      security:
        - bearerAuth: []
      parameters:
        - name: time_entry_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
  /time_entry_types:
    post:
      operationId: createTimeEntryType
      summary: Add new time entry type
      tags:
        - TimeEntryTypes
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - time_entry_interval_id
                - time_entry_value_type_id
                - name
              properties:
                time_entry_interval_id:
                  type: string
                  format: uuid
                time_entry_value_type_id:
                  type: string
                  format: uuid
                name:
                  type: string
                  maxLength: 255
                description:
                  type: string
                  maxLength: 8192
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
    get:
      operationId: listTimeEntryTypes
      summary: List time entries types
      tags:
        - TimeEntryTypes
      security:
        - bearerAuth: []
      parameters:
        - name: erp_id
          in: query
          description: Search for time entry types with a specific ERP id
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/TimeEntryType'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
  /time_entry_types/{time_entry_type_id}:
    get:
      operationId: getTimeEntryType
      summary: View time entry type
      tags:
        - TimeEntryTypes
      security:
        - bearerAuth: []
      parameters:
        - name: time_entry_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/TimeEntryType'
        '401':
          description: Unauthorized
    put:
      operationId: updateTimeEntryType
      summary: Edit time entry type
      tags:
        - TimeEntryTypes
      security:
        - bearerAuth: []
      parameters:
        - name: time_entry_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
    delete:
      operationId: deleteTimeEntryType
      summary: Delete time entry type
      tags:
        - TimeEntryTypes
      security:
        - bearerAuth: []
      parameters:
        - name: time_entry_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
  /users:
    get:
      operationId: listUsers
      summary: Get list of users in company
      tags:
        - Users
      security:
        - bearerAuth: []
      parameters:
        - name: first_name
          in: query
          description: Used to filter on the `first_name` of the users
          required: false
          schema:
            type: string
        - name: last_name
          in: query
          description: Used to filter on the `last_name` of the users
          required: false
          schema:
            type: string
        - name: email
          in: query
          description: Used to filter on the `email` of the users
          schema:
            type: string
        - name: is_active
          in: query
          description: Filters active/inactive users
          schema:
            type: boolean
        - name: erp_id
          in: query
          description: Search for users with a specific ERP id
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Unauthorized
    post:
      operationId: createUser
      summary: Add user to company
      tags:
        - Users
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - first_name
              properties:
                city_id:
                  type: string
                  format: uuid
                language_id:
                  type: string
                  format: uuid
                email:
                  type: string
                  format: email
                  maxLength: 255
                password:
                  type: string
                  format: password
                  maxLength: 255
                first_name:
                  type: string
                  maxLength: 255
                initials:
                  type: string
                  maxLength: 3
                last_name:
                  type: string
                  maxLength: 255
                street_name:
                  type: string
                  maxLength: 255
                phone:
                  type: string
                  maxLength: 32
                phone_countrycode:
                  type: string
                  maxLength: 8
                mobile:
                  type: string
                  maxLength: 32
                mobile_countrycode:
                  type: string
                  maxLength: 8
                cost_price:
                  description: Cost of salaries
                  type: number
                  format: float
                sale_price:
                  description: The price this employee costs per hour when working
                  type: number
                  format: float
                extra_price:
                  description: Additional cost on this employee (pension, vacation etc.)
                  type: number
                  format: float
                is_active:
                  type: boolean
                receive_form_mails:
                  description: If `true` the employee will receive an email receipt of every form submitted
                  type: boolean
                hide_address:
                  type: boolean
                hide_phone:
                  type: boolean
                expected_billable_hours:
                  type: number
                  format: float
                roles:
                  type: object
                  properties:
                    _ids:
                      type: array
                      items:
                        type: string
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /users/{user_id}:
    get:
      operationId: getUser
      summary: View user
      tags:
        - Users
      security:
        - bearerAuth: []
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/User'
        '401':
          description: Unauthorized
    put:
      operationId: updateUser
      summary: Edit user
      tags:
        - Users
      security:
        - bearerAuth: []
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
    delete:
      operationId: deleteUser
      summary: Delete user
      tags:
        - Users
      security:
        - bearerAuth: []
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized
  /users/{user_id}/uploadImage:
    post:
      operationId: createUsersUploadImage
      summary: Upload a new image to a user
      tags:
        - Users
      security:
        - bearerAuth: []
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: binary
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSuccessResponse'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
    parameters:
      - name: user_id
        in: path
        required: true
        schema:
          type: string
  /users/resendWelcomeSms:
    get:
      operationId: listUsersResendWelcomeSms
      summary: Resend Welcome SMS to the user
      tags:
        - Users
      security:
        - bearerAuth: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                      - error
                  data:
                    type: object
                    properties:
                      message:
                        type: string
        '401':
          description: Unauthorized
  /wall_comments:
    post:
      operationId: createWallComment
      summary: Add wall comment
      tags:
        - WallComments
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - wall_post_id
                - message
              properties:
                wall_post_id:
                  type: string
                  format: uuid
                message:
                  type: string
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /wall_posts:
    get:
      operationId: listWallPosts
      summary: View list of wall posts
      tags:
        - WallPosts
      security:
        - bearerAuth: []
      parameters:
        - name: project_id
          in: query
          schema:
            type: string
            format: uuid
        - name: user_id
          in: query
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/WallPost'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Not authorized to access project
        '404':
          description: Project not found
    post:
      operationId: createWallPost
      summary: Add a wall post
      tags:
        - WallPosts
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - project_id
                - message
              properties:
                project_id:
                  type: string
                  format: uuid
                message:
                  type: string
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorValidation'
  /wall_posts/{wall_post_id}/wall_comments:
    get:
      operationId: listWallPostsWallComments
      summary: See wall comments to a wall post
      tags:
        - WallPosts
      security:
        - bearerAuth: []
      parameters:
        - name: wall_post_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/WallComment'
                  pagination:
                    $ref: '#/components/schemas/PaginationDetails'
        '401':
          description: Not authorized to access project
        '404':
          description: Wall post not found
  /products/{product_id}/uploadImage:
    parameters:
      - name: product_id
        in: path
        required: true
        schema:
          type: string
    post:
      operationId: uploadOrDeleteProductImage
      summary: Upload or delete product image
      description: Upload or delete product image
      tags:
        - Products
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: binary
      responses:
        '200':
          description: OK
        '401':
          description: Unauthorized
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Use the Authorization header with format "Bearer <token>"
  requestBodies:
    Contact:
      content:
        application/json:
          schema:
            type: object
            properties:
              city_id:
                type: string
                format: uuid
              name:
                type: string
                maxLength: 255
              description:
                type: string
                maxLength: 8192
              address:
                description: Street address
                type: string
                maxLength: 255
              email:
                type: string
                maxLength: 255
              website:
                type: string
                maxLength: 255
              phone:
                description: Format like eg. `28680133` or `046158971404`
                type: string
                maxLength: 32
              cvr:
                type: string
                maxLength: 255
              erp_id:
                description: If company has integration to an ERP system, and the contacts are synchronized, this will be the ERP-systems ID of this contact
                type: string
                maxLength: 255
    Activity:
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
                maxLength: 255
              hex_code:
                type: string
                maxLength: 6
              erp_id:
                description: Used by 3rd party integrations to store an external identifier for this activity
                type: string
                nullable: true
                maxLength: 255
      required: true
    addContactPersonContactperson:
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
                maxLength: 255
              title:
                type: string
                maxLength: 255
              email:
                type: string
                maxLength: 255
              phone:
                type: string
                maxLength: 32
  schemas:
    ClockingRecord:
      type: object
      properties:
        id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        modified_by_id:
          type: string
          format: uuid
        checked_in:
          type: string
          format: dateTime
        checked_out:
          type: string
          format: dateTime
        checkin_longitude:
          type: string
        checkin_latitude:
          type: string
        checkout_longitude:
          type: string
        checkout_latitude:
          type: string
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    CompanySettings:
      type: object
      properties:
        id:
          type: string
          format: uuid
        company_settings_category_id:
          type: string
          format: uuid
        feature_id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
          readOnly: true
        modified_by_id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        description:
          type: string
          maxLength: 8192
        identifier:
          type: string
          maxLength: 255
        options:
          type: string
          maxLength: 255
        default_value:
          type: string
          maxLength: 255
        type:
          type: string
          maxLength: 255
        placement:
          type: integer
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    Contact:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_by_id:
          description: Read-only
          type: string
          format: uuid
        country_id:
          type: string
          format: uuid
        city_id:
          type: string
          format: uuid
        company_id:
          description: Only filled out if this represents another company within Apacta (used for partners)
          type: string
          format: uuid
        name:
          type: string
          maxLength: 255
        description:
          type: string
          maxLength: 8192
        address:
          description: Street address
          type: string
          maxLength: 255
        email:
          type: string
          maxLength: 255
        website:
          type: string
          maxLength: 255
        phone:
          description: Format like eg. `28680133` or `046158971404`
          type: string
          maxLength: 32
        cvr:
          type: string
          maxLength: 255
        erp_id:
          description: If company has integration to an ERP system, and the contacts are synchronized, this will be the ERP-systems ID of this contact
          type: string
          maxLength: 255
        tripletex_id:
          type: string
          maxLength: 255
        centiga_id:
          type: string
          maxLength: 255
        pogo_id:
          type: string
          maxLength: 255
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    Currency:
      type: object
      properties:
        id:
          type: string
          format: uuid
        identifier:
          type: string
          maxLength: 255
        currency_sign:
          type: string
          maxLength: 8
        name:
          type: string
          maxLength: 255
        description:
          type: string
          maxLength: 8192
        tripletex_id:
          type: string
          maxLength: 255
        centiga_id:
          type: string
          maxLength: 255
        pogo_id:
          type: string
          maxLength: 255
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    Expense:
      type: object
      properties:
        id:
          description: Read-only
          type: string
          format: uuid
        company_id:
          description: Read-only
          type: string
          format: uuid
        created_by_id:
          description: Read-only
          type: string
          format: uuid
        contact_id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        currency_id:
          type: string
          format: uuid
        activity_id:
          type: string
          format: uuid
        roger_id:
          type: string
          format: uuid
        delivery_date:
          type: string
          format: date
        due_date:
          type: string
          format: date
        short_text:
          type: string
          maxLength: 255
        supplier_invoice_number:
          type: string
          maxLength: 255
        order_number:
          type: string
          maxLength: 8192
        reference:
          type: string
          maxLength: 8192
        description:
          type: string
          maxLength: 8192
        file_reference:
          type: string
          maxLength: 255
        is_excluded_from_erp_sync:
          type: boolean
        status:
          type: string
          maxLength: 255
        comment:
          type: string
          maxLength: 8192
        is_imported:
          type: string
          maxLength: 8192
        sent_to_email:
          type: string
          maxLength: 8192
        readsoft_id:
          type: string
          maxLength: 255
        total_buying_price:
          description: Sum of all `buying_price` from expense lines
          type: number
          format: float
        total_selling_price:
          description: Sum of all `selling_price` from expense lines
          type: number
          format: float
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    ExpenseLine:
      type: object
      properties:
        id:
          description: Read-only
          type: string
          format: uuid
        created_by_id:
          description: Read-only
          type: string
          format: uuid
        expense_id:
          type: string
          format: uuid
        currency_id:
          type: string
          format: uuid
        text:
          type: string
          maxLength: 255
        selling_price:
          type: number
          format: float
        buying_price:
          type: number
          format: float
        is_invoiced:
          type: string
          format: dateTime
          default: null
        quantity:
          type: integer
          format: int32
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    Form:
      type: object
      properties:
        id:
          description: Read-only
          type: string
          format: uuid
        created_by_id:
          description: Read-only
          type: string
          format: uuid
        company_id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        form_template_id:
          type: string
          format: uuid
        mass_form_id:
          type: string
          format: uuid
        approved_by_id:
          type: string
          format: uuid
        form_date:
          type: string
          format: date
        is_invoiced:
          type: string
          format: dateTime
          default: null
        is_draft:
          type: boolean
          default: false
        is_shared:
          type: boolean
          default: false
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    FormTemplate:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        form_category_id:
          type: string
          format: uuid
        form_overview_category_id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 255
        identifier:
          type: string
          maxLength: 255
        pdf_template_identifier:
          type: string
          maxLength: 255
        description:
          type: string
          maxLength: 8192
        is_active:
          type: boolean
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    Invoice:
      type: object
      properties:
        id:
          type: string
          format: uuid
        contact_id:
          type: string
          format: uuid
        vendor_id:
          type: string
          format: uuid
        order_line_group_id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        currency_id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        payment_term_id:
          type: string
          format: uuid
        company_id:
          type: string
          format: uuid
        integration_id:
          type: string
          format: uuid
        invoice_number:
          type: integer
          format: int32
          maxLength: 8
        offer_number:
          type: integer
          format: int32
          maxLength: 8
        title:
          type: string
          maxLength: 255
        message:
          type: string
          maxLength: 8192
        reference:
          type: string
          maxLength: 255
        issued_date:
          type: string
          format: date
        payment_due_date:
          type: string
          format: date
        date_from:
          type: string
          format: date
        date_to:
          type: string
          format: date
        gross_payment:
          type: number
          format: float
        total_cost_price:
          type: number
          format: float
        net_payment:
          type: number
          format: float
        is_draft:
          type: boolean
        is_offer:
          type: boolean
        is_locked:
          type: boolean
        eu_customer:
          type: boolean
        vat_percent:
          type: integer
          format: int32
          maxLength: 2
        erp_id:
          type: string
          maxLength: 255
        erp_payment_term_id:
          type: string
          maxLength: 255
        project_overview_attached:
          type: boolean
        downloaded:
          type: string
          format: dateTime
        include_invoiced_lines:
          type: boolean
        all_products_one_line:
          type: boolean
        show_prices_products_and_hours:
          type: boolean
        show_product_images:
          type: boolean
        show_price_product_bundle:
          type: boolean
        show_employee_name:
          type: boolean
        group_by_forms:
          type: boolean
        is_final_invoice:
          type: boolean
        total_discount_percent:
          type: number
          format: float
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    InvoiceLine:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        invoice_id:
          type: string
          format: uuid
        form_id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - normal
            - text
            - bundle
        parent_id:
          type: string
          format: uuid
        product_id:
          type: string
          format: uuid
        ean_product_id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        product_bundle_id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 2048
        description:
          type: string
          maxLength: 8192
        selling_price:
          type: number
          format: float
        discount_text:
          type: string
          maxLength: 255
        discount_percent:
          type: integer
          format: int32
        quantity:
          type: integer
          format: int32
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    Product:
      type: object
      properties:
        id:
          type: string
          format: uuid
        company_id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        project_status_type_id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 255
        description:
          type: string
          maxLength: 8192
        product_number:
          type: string
          maxLength: 255
        barcode:
          type: string
          maxLength: 255
        buying_price:
          type: number
          format: double
        selling_price:
          type: number
          format: double
        erp_id:
          type: string
          maxLength: 255
        tripletex_id:
          type: string
          maxLength: 255
        centiga_id:
          type: string
          maxLength: 255
        pogo_id:
          type: string
          maxLength: 255
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
        average_cost_price:
          type: number
          format: double
    Project:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
        company_id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        contact_id:
          type: string
          format: uuid
        parent_id:
          type: string
          format: uuid
        city_id:
          type: string
          format: uuid
        project_status_id:
          type: string
          format: uuid
        pre_calculation_id:
          type: string
          format: uuid
        offer_id:
          type: string
          format: uuid
        shared_project_id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 255
        thumbnail:
          type: string
        full_name:
          description: Project number + name
          type: string
          maxLength: 255
        has_final_invoice:
          description: Is there at least one final invoice
          type: boolean
        is_offer:
          description: Is the project was offer
          type: string
          format: boolean
        description:
          type: string
          maxLength: 8192
        project_number:
          type: number
        street_name:
          type: string
          maxLength: 255
        latitude:
          type: string
          maxLength: 255
        longitude:
          type: string
          maxLength: 255
        erp_project_id:
          type: string
          maxLength: 255
        erp_task_id:
          type: string
          maxLength: 255
        working_hours_total_cost_price:
          type: number
          format: float
        products_total_cost_price:
          type: number
          format: float
        total_sales_price:
          type: number
          format: float
        not_invoiced_amount:
          type: number
          format: float
        project_image_url:
          type: string
        is_fixed_price:
          type: boolean
        is_rotten:
          description: Last form date - read-only
          type: string
          format: datetime
        start_time:
          type: string
          format: datetime
        end_time:
          type: string
          format: datetime
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    ProjectStatus:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 255
        description:
          type: string
          maxLength: 8192
        identifier:
          description: One of 3 values
          type: string
          enum:
            - ready_for_billing
            - open
            - closed
          maxLength: 255
        is_custom:
          type: boolean
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    TimeEntry:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        modified_by_id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        form_id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        time_entry_type_id:
          type: string
          format: uuid
        from_time:
          type: string
          format: dateTime
        to_time:
          type: string
          format: dateTime
        sum:
          description: Amount of seconds
          type: integer
          format: int32
        is_all_day:
          type: boolean
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    TimeEntryType:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        modified_by_id:
          type: string
          format: uuid
        company_id:
          type: string
          format: uuid
        time_entry_interval_id:
          type: string
          format: uuid
        time_entry_value_type_id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 255
        description:
          type: string
          maxLength: 8192
        erp_id:
          description: Used by 3rd party integrations to store an external identifier for this time entry type
          type: string
          nullable: true
          maxLength: 255
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    User:
      type: object
      properties:
        id:
          type: string
          format: uuid
        company_id:
          type: string
          format: uuid
        city_id:
          type: string
          format: uuid
        language_id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        email:
          type: string
          format: email
          maxLength: 255
        password:
          type: string
          format: password
          maxLength: 255
        first_name:
          type: string
          maxLength: 255
        last_name:
          type: string
          maxLength: 255
        full_name:
          description: READ-ONLY
          type: string
        initials:
          type: string
          maxLength: 3
        street_name:
          type: string
          maxLength: 255
        website:
          type: string
          maxLength: 255
        phone:
          type: string
          maxLength: 32
        phone_countrycode:
          type: string
          maxLength: 8
        mobile:
          type: string
          maxLength: 32
        mobile_countrycode:
          type: string
          maxLength: 8
        cost_price:
          description: Cost of salaries
          type: number
          format: float
        sale_price:
          description: The price this employee costs per hour when working
          type: number
          format: float
        extra_price:
          description: Additional cost on this employee (pension, vacation etc.)
          type: number
          format: float
        is_active:
          type: boolean
        api_key:
          type: string
          format: uuid
        receive_form_mails:
          description: If `true` the employee will receive an email receipt of every form submitted
          type: boolean
        hide_address:
          type: boolean
        hide_phone:
          type: boolean
        expected_billable_hours:
          type: number
          format: float
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    WallComment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        wall_post_id:
          type: string
          format: uuid
        user_id:
          type: string
          maxLength: 255
        message:
          type: string
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    WallPost:
      type: object
      properties:
        id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        project_id:
          type: string
          format: uuid
        message:
          type: string
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    PaginationDetails:
      type: object
      properties:
        page_count:
          type: string
        current_page:
          type: string
        has_next_page:
          type: boolean
        has_prev_page:
          type: boolean
        count:
          type: integer
        limit:
          type: integer
    created:
      type: string
      format: date-time
      readOnly: true
    deleted:
      type: string
      format: date-time
      readOnly: true
      description: Only present if it's a deleted object
      nullable: true
    modified:
      type: string
      format: date-time
      readOnly: true
    EmptySuccessResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: array
          items:
            type: string
    AddDefaultProjectStatusesSuccess:
      type: object
      properties:
        success:
          type: boolean
    AddDefaultProjectStatusesError:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
    ErrorValidation:
      type: object
      properties:
        success:
          type: boolean
          default: false
        data:
          type: object
          properties:
            code:
              description: The HTTP status code
              type: integer
            url:
              description: The url from which this originated
              type: string
            message:
              description: Error message
              type: string
              default: A validation error occurred
            errorCount:
              description: The amount of validation errors
              type: integer
            errors:
              description: Object that contains details information about which properties failed validation and what rules they failed.
              type: object
    ErrorNotFound:
      type: object
      properties:
        success:
          type: boolean
          default: false
        data:
          type: object
          properties:
            code:
              description: The HTTP status code
              type: integer
              default: 404
            url:
              description: The url from which this originated
              type: string
            message:
              description: Error message
              type: string
              default: Record not found
    ForbiddenError:
      type: object
      properties:
        success:
          type: boolean
          default: false
        data:
          type: object
          properties:
            code:
              description: The HTTP status code
              type: integer
              default: 403
            url:
              description: The url from which this originated
              type: string
            message:
              description: Error message
              type: string
              default: Forbidden
    CreateSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          default: true
        data:
          type: object
          properties:
            id:
              type: string
              format: uuid
    SubscriptionSelfServiceRequestBody:
      title: SubscriptionSelfServiceRequestBody
      type: object
      properties:
        subscription_self_service_url:
          type: string
    Activity:
      type: object
      required:
        - id
        - company_id
        - hex_code
        - name
        - created
        - modified
      properties:
        id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
        company_id:
          type: string
          format: uuid
        hex_code:
          type: string
          minLength: 6
          maxLength: 6
        name:
          type: string
          minLength: 0
          maxLength: 255
        erp_id:
          type: string
          maxLength: 255
          nullable: true
          description: Used by 3rd party integrations to store an external identifier for this activity
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    Country:
      type: object
      required:
        - id
        - identifier
        - name
      properties:
        id:
          type: string
          format: uuid
        identifier:
          type: string
          maxLength: 255
        currency_id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 255
        phone_code:
          type: string
          maxLength: 10
        time_zone:
          type: string
          maxLength: 255
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    City:
      type: object
      properties:
        id:
          type: string
          format: uuid
        zip_code:
          type: integer
        name:
          type: string
          maxLength: 255
        country:
          $ref: '#/components/schemas/Country'
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
    BaseEntity:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
    ImageUrls:
      type: object
      properties:
        large:
          type: string
        medium:
          type: string
        small:
          type: string
        thumbnail:
          type: string
        original:
          type: string
    BaseFile:
      type: object
      required:
        - id
        - name
        - original_filename
        - file_url
        - download_url
      allOf:
        - $ref: '#/components/schemas/BaseEntity'
        - type: object
          properties:
            original_filename:
              type: string
            file_url:
              type: string
            download_url:
              type: string
            mime_type:
              description: Naive guess on mime type based on file extension
              type: string
              nullable: true
            is_standard_file:
              type: boolean
            standard_file_id:
              type: string
              format: uuid
              nullable: true
            image_urls:
              $ref: '#/components/schemas/ImageUrls'
            created:
              $ref: '#/components/schemas/created'
            modified:
              $ref: '#/components/schemas/modified'
            deleted:
              $ref: '#/components/schemas/deleted'
    Company:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_by_id:
          description: Read-only
          type: string
          format: uuid
        contact_person_id:
          type: string
          format: uuid
        country_id:
          type: string
          format: uuid
        city_id:
          type: string
          format: uuid
        file_id:
          type: string
          format: uuid
        language_id:
          type: string
          format: uuid
        cvr:
          type: string
          maxLength: 255
        name:
          type: string
          maxLength: 255
        street_name:
          type: string
          maxLength: 255
        invoice_email:
          type: string
          format: email
          maxLength: 255
        contact_email:
          type: string
          format: email
          maxLength: 255
        receive_form_mails:
          type: string
          format: email
          nullable: true
          maxLength: 255
        phone_countrycode:
          description: Format like eg. `45` or `49`
          type: string
          maxLength: 3
        phone:
          description: Format like eg. `28680133` or `046158971404`
          type: string
          maxLength: 32
        website:
          type: string
          maxLength: 255
        vat_percent:
          type: integer
          format: int32
        next_invoice_number:
          type: integer
          format: int32
        next_project_number:
          type: integer
          format: int32
        next_offer_number:
          type: integer
          format: int32
        expired:
          type: string
          format: date-time
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
        city:
          $ref: '#/components/schemas/City'
        file:
          $ref: '#/components/schemas/BaseFile'
    ContactPerson:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
        created_by_id:
          type: string
          format: uuid
          readOnly: true
        contact_id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 255
        email:
          type: string
          maxLength: 255
        phone:
          type: string
          maxLength: 32
        title:
          type: string
          maxLength: 255
        created:
          $ref: '#/components/schemas/created'
        modified:
          $ref: '#/components/schemas/modified'
        deleted:
          $ref: '#/components/schemas/deleted'
