openapi: 3.0.1
info:
  title: Sintetic GeoDB API
  description: |2-
      Web API for single item identification for forest production, protection and management.
      

      Please, notice that resource tags are ordered by dependency and/or place along the forest value chain.
      For instance, in order to create a _Forest Operation_, a respective _Forest Property_ must be created first.
  license:
    name: MIT
    url: https://opensource.org/license/mit/
  version: 0.2.0
servers:
  - url: https://api.geodb-staging.sintetic.iit.cnr.it
    description: Staging environment for testing
paths:
  /account/password:
    patch:
      tags:
        - Users
      summary: Updates the password of the current user.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                old_password:
                  type: string
                  format: password
                new_password:
                  type: string
                  format: password
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
  /auth/bearer_logins:
    get:
      tags:
        - Auth
      summary: List the current user's bearer logins
      description: Only the active bearer logins of the logged-in user are returned.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BearerLogin'
      security:
        - LoginAuth: []
    post:
      tags:
        - Auth
      summary: Create bear login token
      requestBody:
        description: Bearer login details.
        content:
          application/json:
            schema:
              type: object
              properties:
                bearer_login:
                  type: object
                  properties:
                    name:
                      type: string
                    scopes:
                      type: array
                      items:
                        type: string
        required: true
      responses:
        '200':
          description: Bearer login metadata.
          content:
            application/json:
              schema:
                required:
                  - bearer_login
                  - token
                type: object
                properties:
                  bearer_login:
                    $ref: '#/components/schemas/BearerLogin'
                  token:
                    type: string
                    description: >-
                      Bearer login token to be used in autenticated requests.
                      **Must be stored safely.**
        '400':
          description: Bad Request.
        '403':
          description: Forbidden.
      security:
        - LoginAuth: []
  /auth/bearer_logins/{bearer_login_id}:
    get:
      tags:
        - Auth
      summary: Get bearer login
      description: Retrieves only bearer logins from the current user
      parameters:
        - name: bearer_login_id
          in: path
          required: true
          schema:
            type: string
          example: bearer_login_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BearerLogin'
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - LoginAuth: []
    delete:
      tags:
        - Auth
      summary: Delete bearer login
      description: Revokes a bearer login token by deleting.
      parameters:
        - name: bearer_login_id
          in: path
          required: true
          schema:
            type: string
          example: bearer_login_id
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '403':
          description: Forbidden.
      security:
        - LoginAuth: []
  /auth/login:
    post:
      tags:
        - Auth
      summary: Log in using email and password
      requestBody:
        description: Login credentials.
        content:
          application/json:
            schema:
              type: object
              properties:
                login:
                  type: object
                  properties:
                    email:
                      type: string
                      format: email
                    password:
                      type: string
                      format: password
        required: true
      responses:
        '200':
          description: Login metadata.
          content:
            application/json:
              schema:
                required:
                  - login
                type: object
                properties:
                  login:
                    type: object
                    properties:
                      token:
                        type: string
                        description: >-
                          Bearer token to be used in requests authenticated via
                          login. **Must be stored safely.**
                      expiry:
                        type: string
                        description: >-
                          Datetime at which the login token will become
                          inactive.
                        format: date-time
                      user_id:
                        type: number
                        description: ID of the user to which this login token belongs.
        '403':
          description: Forbidden.
    delete:
      tags:
        - Auth
      summary: Log out current user
      responses:
        '204':
          description: No Content
        '403':
          description: Forbidden.
  /auth/password_resets:
    post:
      tags:
        - Auth
      summary: Creates password reset
      description: >-
        A message with instructions on how to reset the passwrod will be sent to
        the given email address.
      requestBody:
        description: Pasword reset token.
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
    patch:
      tags:
        - Auth
      summary: Reset user password
      description: >-
        Update password of the user associated to the password reset token, if
        valid.
      requestBody:
        description: Pasword reset token.
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                password_reset:
                  type: object
                  properties:
                    password:
                      type: string
                      format: password
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '403':
          description: Forbidden.
  /auth/password_resets/token/verify:
    post:
      tags:
        - Auth
      summary: Verify password reset token
      requestBody:
        description: Pasword reset token.
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
        required: true
      responses:
        '200':
          description: >-
            The email address (obfuscated for security reasons) of the user to
            which the verified pasword reset token belongs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                    format: email
        '400':
          description: Bad Request.
        '403':
          description: Forbidden.
  /auth/url_signatures:
    post:
      tags:
        - Auth
      summary: Create a URL signature in JWT format
      description: |
        Bearer token with scope `read` required.
        Token expires after 10 minutes.
      responses:
        '200':
          description: OK
          content:
            application/jwt:
              schema:
                type: string
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
      security:
        - BearerLoginAuth: []
  /board_classs:
    get:
      tags:
        - Board Classes
      summary: List board classes
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: group_name
          in: query
          description: Search by group name
          required: false
          schema:
            type: string
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date or name
          required: false
          schema:
            enum:
              - newest
              - oldest
              - name
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BoardClass'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Board Classes
      summary: Create board class
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BoardClass'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /board_classs/{board_class_id}:
    get:
      tags:
        - Board Classes
      summary: Get board class
      parameters:
        - name: board_class_id
          in: path
          required: true
          schema:
            type: string
          example: board_class_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BoardClass'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Board Classes
      summary: Update board class
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: board_class_id
          in: path
          required: true
          schema:
            type: string
          example: board_class_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BoardClass'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Board Classes
      summary: Delete board class
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: board_class_id
          in: path
          required: true
          schema:
            type: string
          example: board_class_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /boards:
    get:
      tags:
        - Boards
      summary: List boards
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: tree_log_id
          in: query
          description: Filter by tree log ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: sawmill_batch_id
          in: query
          description: Filter by sawmill batch ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: board_class_id
          in: query
          description: Filter by board class ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: external_id
          in: query
          description: Filter by external identifier ID
          required: false
          schema:
            type: string
        - name: external_id_type
          in: query
          description: Filter by external identifier type
          required: false
          schema:
            enum:
              - other
              - rfid
              - hammer
              - barcode
              - paint
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Board'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Boards
      summary: Create board
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Board'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /boards/{board_id}:
    get:
      tags:
        - Boards
      summary: Get board
      parameters:
        - name: board_id
          in: path
          required: true
          schema:
            type: string
          example: board_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Board'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Boards
      summary: Update board
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: board_id
          in: path
          required: true
          schema:
            type: string
          example: board_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Board'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Boards
      summary: Delete board
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: board_id
          in: path
          required: true
          schema:
            type: string
          example: board_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /cutting_instruction_items:
    get:
      tags:
        - Cutting Instruction Items
      summary: List cutting instruction items
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: set_id
          in: query
          description: Filter by cutting instruction set ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CuttingInstructionItem'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Cutting Instruction Items
      summary: Create cutting instruction item
      description: Bearer token with scope `harvest_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CuttingInstructionItem'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /cutting_instruction_items/{cutting_instruction_item_id}:
    get:
      tags:
        - Cutting Instruction Items
      summary: Get cutting instruction item
      parameters:
        - name: cutting_instruction_item_id
          in: path
          required: true
          schema:
            type: string
          example: cutting_instruction_item_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CuttingInstructionItem'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Cutting Instruction Items
      summary: Update cutting instruction item
      description: Bearer token with scope `harvest_write` required.
      parameters:
        - name: cutting_instruction_item_id
          in: path
          required: true
          schema:
            type: string
          example: cutting_instruction_item_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CuttingInstructionItem'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Cutting Instruction Items
      summary: Delete cutting instruction item
      description: |
        Bearer token with scope `harvest_write` required.
      parameters:
        - name: cutting_instruction_item_id
          in: path
          required: true
          schema:
            type: string
          example: cutting_instruction_item_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /cutting_instruction_sets:
    get:
      tags:
        - Cutting Instruction Sets
      summary: List cutting instruction sets
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: tree_log_product_definition_id
          in: query
          description: Filter by tree log product definition ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CuttingInstructionSet'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Cutting Instruction Sets
      summary: Create cutting instruction set
      description: Bearer token with scope `harvest_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CuttingInstructionSet'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /cutting_instruction_sets/{cutting_instruction_set_id}:
    get:
      tags:
        - Cutting Instruction Sets
      summary: Get cutting instruction set
      parameters:
        - name: cutting_instruction_set_id
          in: path
          required: true
          schema:
            type: string
          example: cutting_instruction_set_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CuttingInstructionSet'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Cutting Instruction Sets
      summary: Update cutting instruction set
      description: Bearer token with scope `harvest_write` required.
      parameters:
        - name: cutting_instruction_set_id
          in: path
          required: true
          schema:
            type: string
          example: cutting_instruction_set_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CuttingInstructionSet'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Cutting Instruction Sets
      summary: Delete cutting instruction set
      description: |
        Bearer token with scope `harvest_write` required.
      parameters:
        - name: cutting_instruction_set_id
          in: path
          required: true
          schema:
            type: string
          example: cutting_instruction_set_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /forest_operation_attachments:
    get:
      tags:
        - Forest Operation Attachments
      summary: List forest operation attachments
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: forest_operation_id
          in: query
          description: Filter by forest operation ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: Filter by type
          required: false
          schema:
            type: string
        - name: category
          in: query
          description: Filter by category
          required: false
          schema:
            enum:
              - office
              - image
              - geo_vector
              - geo_raster
              - data_exchange
              - archive
            type: string
        - name: tag
          in: query
          description: Filter by tag
          required: false
          schema:
            type: string
        - name: sort_by
          in: query
          description: Sort results
          required: false
          schema:
            enum:
              - newest
              - oldest
              - type
              - name
              - largest
              - smallest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ForestOperationAttachment'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Forest Operation Attachments
      summary: Create forest operation attachment
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - attachment:forest_operation_id
                - attachment:file
              type: object
              properties:
                attachment:forest_operation_id:
                  type: string
                  format: uuid
                attachment:name:
                  type: string
                  description: If missing it will default to the filename without extension
                attachment:tags:
                  type: array
                  items:
                    type: string
                  example:
                    - tag1
                    - tag2
                attachment:description:
                  type: string
                attachment:file:
                  type: string
                  format: binary
            encoding:
              tags:
                style: form
                explode: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForestOperationAttachment'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
        '413':
          description: Payload Too Large.
      security:
        - BearerLoginAuth: []
  /forest_operation_attachments/files/{forest_operation_attachment_id}:
    get:
      tags:
        - Forest Operation Attachments
      summary: Download attachment file
      parameters:
        - name: forest_operation_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: forest_operation_attachment_id
      responses:
        '200':
          description: File with media type based on attachment type.
        '401':
          description: Unauthorized
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
        - URLSignatureAuth: []
  /forest_operation_attachments/{forest_operation_attachment_id}:
    get:
      tags:
        - Forest Operation Attachments
      summary: Get forest operation attachment
      parameters:
        - name: forest_operation_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: forest_operation_attachment_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForestOperationAttachment'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Forest Operation Attachments
      summary: Delete forest operation attachment
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: forest_operation_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: forest_operation_attachment_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
    patch:
      tags:
        - Forest Operation Attachments
      summary: Update forest operation attachment
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: forest_operation_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: forest_operation_attachment_id
      requestBody:
        content:
          application/json:
            schema:
              required:
                - attachment
              type: object
              properties:
                attachment:
                  type: object
                  properties:
                    name:
                      type: string
                    description:
                      type: string
                    tags:
                      type: array
                      items:
                        type: string
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
  /forest_operations:
    get:
      tags:
        - Forest Operations
      summary: List forest operations
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: forest_property_id
          in: query
          description: Filter by forest property ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: type
          in: query
          description: Filter by type
          required: false
          schema:
            enum:
              - thinning
              - clearfell
              - continuous_cover_forestry
            type: string
        - name: status
          in: query
          description: Filter by status
          required: false
          schema:
            enum:
              - planned
              - in_progress
              - on_hold
              - complete
            type: string
        - name: start_date
          in: query
          description: Filter by start date
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: end_date
          in: query
          description: Filter by end date
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: manager
          in: query
          description: Search by manager
          required: false
          schema:
            type: string
        - name: bbox
          in: query
          description: Filter by intersection of location and bounding box
          required: false
          style: form
          explode: false
          schema:
            title: BoundingBox
            type: array
            items:
              type: number
            example:
              - 11.1
              - 43.2
              - 12.8
              - 44.9
        - name: origin_property_id
          in: query
          description: Filter by the ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_owner_id
          in: query
          description: Filter by the owner ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_country_iso
          in: query
          description: >-
            Filter by the country (ISO 3166-1 alpha-2) of the forest property of
            origin
          required: false
          schema:
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date or name
          required: false
          schema:
            enum:
              - newest
              - oldest
              - name
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ForestOperation'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Forest Operations
      summary: Create forest operation
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForestOperation'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /forest_operations/{forest_operation_id}:
    get:
      tags:
        - Forest Operations
      summary: Get forest operation
      parameters:
        - name: forest_operation_id
          in: path
          required: true
          schema:
            type: string
          example: forest_operation_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForestOperation'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Forest Operations
      summary: Update forest operation
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: forest_operation_id
          in: path
          required: true
          schema:
            type: string
          example: forest_operation_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForestOperation'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Forest Operations
      summary: Delete forest operation
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: forest_operation_id
          in: path
          required: true
          schema:
            type: string
          example: forest_operation_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /forest_properties:
    get:
      tags:
        - Forest Properties
      summary: List forest properties
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: country_iso
          in: query
          description: Filter by country (ISO 3166-1 alpha-2)
          required: false
          schema:
            type: string
        - name: owner_id
          in: query
          description: Filter by forest property owner ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: ownership_type
          in: query
          description: Filter by ownership type
          required: false
          schema:
            enum:
              - public
              - private
            type: string
        - name: bbox
          in: query
          description: Filter by intersection of location and bounding box
          required: false
          style: form
          explode: false
          schema:
            title: BoundingBox
            type: array
            items:
              type: number
            example:
              - 11.1
              - 43.2
              - 12.8
              - 44.9
        - name: sort_by
          in: query
          description: Sort results by creation date or name
          required: false
          schema:
            enum:
              - newest
              - oldest
              - name
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ForestProperty'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Forest Properties
      summary: Create forest property
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForestProperty'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /forest_properties/{forest_property_id}:
    get:
      tags:
        - Forest Properties
      summary: Get forest property
      parameters:
        - name: forest_property_id
          in: path
          required: true
          schema:
            type: string
          example: forest_property_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForestProperty'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Forest Properties
      summary: Update forest property
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: forest_property_id
          in: path
          required: true
          schema:
            type: string
          example: forest_property_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForestProperty'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Forest Properties
      summary: Delete forest property
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: forest_property_id
          in: path
          required: true
          schema:
            type: string
          example: forest_property_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /forest_property_owners:
    get:
      tags:
        - Forest Property Owners
      summary: List forest property owners
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: Filter by forest property owner
          required: false
          schema:
            enum:
              - legal_entity
              - person
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date or name
          required: false
          schema:
            enum:
              - newest
              - oldest
              - name
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ForestPropertyOwner'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Forest Property Owners
      summary: Create forest property owner
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForestPropertyOwner'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /forest_property_owners/{forest_property_owner_id}:
    get:
      tags:
        - Forest Property Owners
      summary: Get forest property owner
      parameters:
        - name: forest_property_owner_id
          in: path
          required: true
          schema:
            type: string
          example: forest_property_owner_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForestPropertyOwner'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Forest Property Owners
      summary: Update forest property owner
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: forest_property_owner_id
          in: path
          required: true
          schema:
            type: string
          example: forest_property_owner_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForestPropertyOwner'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Forest Property Owners
      summary: Delete forest property owner
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: forest_property_owner_id
          in: path
          required: true
          schema:
            type: string
          example: forest_property_owner_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /harvested_trees:
    get:
      tags:
        - Harvested Trees
      summary: List harvested trees
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: tree_species_id
          in: query
          description: Filter by tree species ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: external_id
          in: query
          description: Filter by external identifier ID
          required: false
          schema:
            type: string
        - name: external_id_type
          in: query
          description: Filter by external identifier type
          required: false
          schema:
            enum:
              - other
              - rfid
              - hammer
              - barcode
              - paint
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/HarvestedTree'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Harvested Trees
      summary: Create harvested tree
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HarvestedTree'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /harvested_trees/{harvested_tree_id}:
    get:
      tags:
        - Harvested Trees
      summary: Get harvested tree
      parameters:
        - name: harvested_tree_id
          in: path
          required: true
          schema:
            type: string
          example: harvested_tree_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HarvestedTree'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Harvested Trees
      summary: Update harvested tree
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: harvested_tree_id
          in: path
          required: true
          schema:
            type: string
          example: harvested_tree_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HarvestedTree'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Harvested Trees
      summary: Delete harvested tree
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: harvested_tree_id
          in: path
          required: true
          schema:
            type: string
          example: harvested_tree_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /harvesting_reports:
    get:
      tags:
        - Harvesting Reports
      summary: List harvesting reports
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: forest_reportable_type
          in: query
          description: Filter by forest reportable type
          required: false
          schema:
            enum:
              - forest_operation
              - sample_plot
              - subcompartment
            type: string
        - name: forest_operation_id
          in: query
          description: Filter by forest operation ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: subcompartment_id
          in: query
          description: Filter by subcompartment ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: sample_plot_id
          in: query
          description: Filter by sample plot ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: tree_species_id
          in: query
          description: Filter by tree species ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_id
          in: query
          description: Filter by the ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_owner_id
          in: query
          description: Filter by the owner ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_country_iso
          in: query
          description: >-
            Filter by the country (ISO 3166-1 alpha-2) of the forest property of
            origin
          required: false
          schema:
            type: string
        - name: tree_processor_id
          in: query
          description: Filter by tree processor ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/HarvestingReport'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Harvesting Reports
      summary: Create harvesting report
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HarvestingReport'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /harvesting_reports/{harvesting_report_id}:
    get:
      tags:
        - Harvesting Reports
      summary: Get harvesting report
      parameters:
        - name: harvesting_report_id
          in: path
          required: true
          schema:
            type: string
          example: harvesting_report_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HarvestingReport'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Harvesting Reports
      summary: Update harvesting report
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: harvesting_report_id
          in: path
          required: true
          schema:
            type: string
          example: harvesting_report_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HarvestingReport'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Harvesting Reports
      summary: Delete harvesting report
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: harvesting_report_id
          in: path
          required: true
          schema:
            type: string
          example: harvesting_report_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /inventory_reports:
    get:
      tags:
        - Inventory Reports
      summary: List inventory reports
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: forest_reportable_type
          in: query
          description: Filter by forest reportable type
          required: false
          schema:
            enum:
              - forest_operation
              - sample_plot
              - subcompartment
            type: string
        - name: forest_operation_id
          in: query
          description: Filter by forest operation ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: subcompartment_id
          in: query
          description: Filter by subcompartment ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: sample_plot_id
          in: query
          description: Filter by sample plot ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: tree_species_id
          in: query
          description: Filter by tree species ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_id
          in: query
          description: Filter by the ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_owner_id
          in: query
          description: Filter by the owner ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_country_iso
          in: query
          description: >-
            Filter by the country (ISO 3166-1 alpha-2) of the forest property of
            origin
          required: false
          schema:
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InventoryReport'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Inventory Reports
      summary: Create inventory report
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InventoryReport'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /inventory_reports/{inventory_report_id}:
    get:
      tags:
        - Inventory Reports
      summary: Get inventory report
      parameters:
        - name: inventory_report_id
          in: path
          required: true
          schema:
            type: string
          example: inventory_report_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InventoryReport'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Inventory Reports
      summary: Update inventory report
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: inventory_report_id
          in: path
          required: true
          schema:
            type: string
          example: inventory_report_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InventoryReport'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Inventory Reports
      summary: Delete inventory report
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: inventory_report_id
          in: path
          required: true
          schema:
            type: string
          example: inventory_report_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /inventory_trees:
    get:
      tags:
        - Inventory Trees
      summary: List inventory trees
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: tree_species_id
          in: query
          description: Filter by tree species ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: sample_plot_id
          in: query
          description: Filter by sample plot ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: harvested_tree_id
          in: query
          description: Filter by harvested tree ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: measured_at
          in: query
          description: Filter by measurement datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: external_id
          in: query
          description: Filter by external identifier ID
          required: false
          schema:
            type: string
        - name: external_id_type
          in: query
          description: Filter by external identifier type
          required: false
          schema:
            enum:
              - other
              - rfid
              - hammer
              - barcode
              - paint
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InventoryTree'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Inventory Trees
      summary: Create inventory tree
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InventoryTree'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /inventory_trees/{inventory_tree_id}:
    get:
      tags:
        - Inventory Trees
      summary: Get inventory tree
      parameters:
        - name: inventory_tree_id
          in: path
          required: true
          schema:
            type: string
          example: inventory_tree_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InventoryTree'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Inventory Trees
      summary: Update inventory tree
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: inventory_tree_id
          in: path
          required: true
          schema:
            type: string
          example: inventory_tree_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InventoryTree'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Inventory Trees
      summary: Delete inventory tree
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: inventory_tree_id
          in: path
          required: true
          schema:
            type: string
          example: inventory_tree_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /organizations:
    get:
      tags:
        - Organizations
      summary: Retrieves all organizations
      description: |-
        All organizations are returned, including those soft deleted.
        Available only for ***administrators***.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Organization'
      security:
        - LoginAuth: []
    post:
      tags:
        - Organizations
      summary: Creates an organization
      description: Available only for ***administrators***.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Organization'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - LoginAuth: []
  /organizations/{organization_id}:
    get:
      tags:
        - Organizations
      summary: Retrieves an organization
      description: Available only for ***administrators***.
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
          example: organization_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organization'
        '404':
          description: Not Found.
      security:
        - LoginAuth: []
    put:
      tags:
        - Organizations
      summary: Updates an organization
      description: Available only for ***administrators***.
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
          example: organization_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Organization'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - LoginAuth: []
    delete:
      tags:
        - Organizations
      summary: Soft deletes an organization
      description: >-
        All of the organization's users will be soft deleted and their
        respective login tokens will be deactivated.

        Soft deletion is used to maintain data integrity and for accountability
        reasons.

        Deletion of the current logged-in user's organization is not allowed.

        If an organization is already soft deleted this operation has no effect.

        Available only for ***administrators***.
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
          example: organization_id
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
      security:
        - LoginAuth: []
  /organizations/{organization_id}/restore:
    post:
      tags:
        - Organizations
      summary: Restores an organization
      description: >-
        If an organization has not been soft deleted this operation has no
        effect.

        Available only for ***administrators***.
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
          example: organization_id
      requestBody:
        content:
          application/json: {}
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - LoginAuth: []
  /quality_indicator_items:
    get:
      tags:
        - Quality Indicator Items
      summary: List quality indicator items
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: qualifiable_type
          in: query
          description: Filter by qualifiable type
          required: false
          schema:
            enum:
              - inventory_tree
              - harvested_tree
              - tree_log
              - board
            type: string
        - name: harvested_tree_id
          in: query
          description: Filter by harvested tree ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: inventory_tree_id
          in: query
          description: Filter by inventory tree ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: tree_log_id
          in: query
          description: Filter by tree log ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: board_id
          in: query
          description: Filter by board ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/QualityIndicatorItem'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Quality Indicator Items
      summary: Create quality indicator item
      description: Bearer token with scope `quality_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QualityIndicatorItem'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /quality_indicator_items/{quality_indicator_item_id}:
    get:
      tags:
        - Quality Indicator Items
      summary: Get quality indicator item
      parameters:
        - name: quality_indicator_item_id
          in: path
          required: true
          schema:
            type: string
          example: quality_indicator_item_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QualityIndicatorItem'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Quality Indicator Items
      summary: Update quality indicator item
      description: Bearer token with scope `quality_write` required.
      parameters:
        - name: quality_indicator_item_id
          in: path
          required: true
          schema:
            type: string
          example: quality_indicator_item_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QualityIndicatorItem'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Quality Indicator Items
      summary: Delete quality indicator item
      description: |
        Bearer token with scope `quality_write` required.
      parameters:
        - name: quality_indicator_item_id
          in: path
          required: true
          schema:
            type: string
          example: quality_indicator_item_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /quality_indicators:
    get:
      tags:
        - Quality Indicators
      summary: List quality indicators
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: kind
          in: query
          description: Filter by indicator kind
          required: false
          schema:
            enum:
              - tree
              - tree_log
              - board
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date or name
          required: false
          schema:
            enum:
              - newest
              - oldest
              - name
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/QualityIndicator'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Quality Indicators
      summary: Create quality indicator
      description: Bearer token with scope `quality_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QualityIndicator'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /quality_indicators/{quality_indicator_id}:
    get:
      tags:
        - Quality Indicators
      summary: Get quality indicator
      parameters:
        - name: quality_indicator_id
          in: path
          required: true
          schema:
            type: string
          example: quality_indicator_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QualityIndicator'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Quality Indicators
      summary: Delete quality indicator
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: quality_indicator_id
          in: path
          required: true
          schema:
            type: string
          example: quality_indicator_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
    patch:
      tags:
        - Quality Indicators
      summary: Update quality indicator
      description: Bearer token with scope `quality_write` required.
      parameters:
        - name: quality_indicator_id
          in: path
          required: true
          schema:
            type: string
          example: quality_indicator_id
      requestBody:
        content:
          application/json:
            schema:
              required:
                - quality_indicator
              type: object
              properties:
                quality_indicator:
                  type: object
                  properties:
                    name:
                      type: string
                    description:
                      type: string
        required: true
      responses:
        '204':
          description: No Content
  /sample_plots:
    get:
      tags:
        - Sample Plots
      summary: List sample plots
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: forest_operation_id
          in: query
          description: Filter by forest operation ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: measured_at
          in: query
          description: Filter by measurement datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: bbox
          in: query
          description: Filter by intersection of location and bounding box
          required: false
          style: form
          explode: false
          schema:
            title: BoundingBox
            type: array
            items:
              type: number
            example:
              - 11.1
              - 43.2
              - 12.8
              - 44.9
        - name: origin_property_id
          in: query
          description: Filter by the ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_owner_id
          in: query
          description: Filter by the owner ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_country_iso
          in: query
          description: >-
            Filter by the country (ISO 3166-1 alpha-2) of the forest property of
            origin
          required: false
          schema:
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date or name
          required: false
          schema:
            enum:
              - newest
              - oldest
              - name
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SamplePlot'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Sample Plots
      summary: Create sample plot
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SamplePlot'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /sample_plots/{sample_plot_id}:
    get:
      tags:
        - Sample Plots
      summary: Get sample plot
      parameters:
        - name: sample_plot_id
          in: path
          required: true
          schema:
            type: string
          example: sample_plot_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SamplePlot'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Sample Plots
      summary: Update sample plot
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: sample_plot_id
          in: path
          required: true
          schema:
            type: string
          example: sample_plot_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SamplePlot'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Sample Plots
      summary: Delete sample plot
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: sample_plot_id
          in: path
          required: true
          schema:
            type: string
          example: sample_plot_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /sawline_attachments:
    get:
      tags:
        - Sawline Attachments
      summary: List sawline attachments
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: sawline_id
          in: query
          description: Filter by sawline ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: Filter by type
          required: false
          schema:
            type: string
        - name: category
          in: query
          description: Filter by category
          required: false
          schema:
            enum:
              - office
              - image
              - geo_vector
              - geo_raster
              - data_exchange
              - archive
            type: string
        - name: tag
          in: query
          description: Filter by tag
          required: false
          schema:
            type: string
        - name: sort_by
          in: query
          description: Sort results
          required: false
          schema:
            enum:
              - newest
              - oldest
              - type
              - name
              - largest
              - smallest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SawlineAttachment'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Sawline Attachments
      summary: Create sawline attachment
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - attachment:sawline_id
                - attachment:file
              type: object
              properties:
                attachment:sawline_id:
                  type: string
                  format: uuid
                attachment:name:
                  type: string
                  description: If missing it will default to the filename without extension
                attachment:tags:
                  type: array
                  items:
                    type: string
                  example:
                    - tag1
                    - tag2
                attachment:description:
                  type: string
                attachment:file:
                  type: string
                  format: binary
            encoding:
              tags:
                style: form
                explode: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SawlineAttachment'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
        '413':
          description: Payload Too Large.
      security:
        - BearerLoginAuth: []
  /sawline_attachments/files/{sawline_attachment_id}:
    get:
      tags:
        - Sawline Attachments
      summary: Download attachment file
      parameters:
        - name: sawline_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: sawline_attachment_id
      responses:
        '200':
          description: File with media type based on attachment type.
        '401':
          description: Unauthorized
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
        - URLSignatureAuth: []
  /sawline_attachments/{sawline_attachment_id}:
    get:
      tags:
        - Sawline Attachments
      summary: Get sawline attachment
      parameters:
        - name: sawline_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: sawline_attachment_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SawlineAttachment'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Sawline Attachments
      summary: Delete sawline attachment
      description: |
        Bearer token with scope `sawmill_write` required.
      parameters:
        - name: sawline_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: sawline_attachment_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
    patch:
      tags:
        - Sawline Attachments
      summary: Update sawline attachment
      description: Bearer token with scope `sawmill_write` required.
      parameters:
        - name: sawline_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: sawline_attachment_id
      requestBody:
        content:
          application/json:
            schema:
              required:
                - attachment
              type: object
              properties:
                attachment:
                  type: object
                  properties:
                    name:
                      type: string
                    description:
                      type: string
                    tags:
                      type: array
                      items:
                        type: string
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
  /sawlines:
    get:
      tags:
        - Sawlines
      summary: List sawlines
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: Search by type
          required: false
          schema:
            type: string
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: sawmill_site_id
          in: query
          description: Filter by sawmill site ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Sawline'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Sawlines
      summary: Create sawline
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Sawline'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /sawlines/{sawline_id}:
    get:
      tags:
        - Sawlines
      summary: Get sawline
      parameters:
        - name: sawline_id
          in: path
          required: true
          schema:
            type: string
          example: sawline_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sawline'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Sawlines
      summary: Update sawline
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: sawline_id
          in: path
          required: true
          schema:
            type: string
          example: sawline_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Sawline'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Sawlines
      summary: Delete sawline
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: sawline_id
          in: path
          required: true
          schema:
            type: string
          example: sawline_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /sawmill_batchs:
    get:
      tags:
        - Sawmill Batches
      summary: List sawmill batches
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: sawmill_site_id
          in: query
          description: Filter by sawmill site ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: external_id
          in: query
          description: Filter by external identifier ID
          required: false
          schema:
            type: string
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SawmillBatch'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Sawmill Batches
      summary: Create sawmill batch
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SawmillBatch'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /sawmill_batchs/{sawmill_batch_id}:
    get:
      tags:
        - Sawmill Batches
      summary: Get sawmill batch
      parameters:
        - name: sawmill_batch_id
          in: path
          required: true
          schema:
            type: string
          example: sawmill_batch_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SawmillBatch'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Sawmill Batches
      summary: Update sawmill batch
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: sawmill_batch_id
          in: path
          required: true
          schema:
            type: string
          example: sawmill_batch_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SawmillBatch'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Sawmill Batches
      summary: Delete sawmill batch
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: sawmill_batch_id
          in: path
          required: true
          schema:
            type: string
          example: sawmill_batch_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /sawmill_companys:
    get:
      tags:
        - Sawmill Companies
      summary: List sawmill companies
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date or name
          required: false
          schema:
            enum:
              - newest
              - oldest
              - name
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SawmillCompany'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Sawmill Companies
      summary: Create sawmill company
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SawmillCompany'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /sawmill_companys/{sawmill_company_id}:
    get:
      tags:
        - Sawmill Companies
      summary: Get sawmill company
      parameters:
        - name: sawmill_company_id
          in: path
          required: true
          schema:
            type: string
          example: sawmill_company_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SawmillCompany'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Sawmill Companies
      summary: Update sawmill company
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: sawmill_company_id
          in: path
          required: true
          schema:
            type: string
          example: sawmill_company_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SawmillCompany'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Sawmill Companies
      summary: Delete sawmill company
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: sawmill_company_id
          in: path
          required: true
          schema:
            type: string
          example: sawmill_company_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /sawmill_sites:
    get:
      tags:
        - Sawmill Sites
      summary: List sawmill sites
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: company_id
          in: query
          description: Filter by sawmill company ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: bbox
          in: query
          description: Filter by intersection of location and bounding box
          required: false
          style: form
          explode: false
          schema:
            title: BoundingBox
            type: array
            items:
              type: number
            example:
              - 11.1
              - 43.2
              - 12.8
              - 44.9
        - name: sort_by
          in: query
          description: Sort results by creation date or name
          required: false
          schema:
            enum:
              - newest
              - oldest
              - name
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SawmillSite'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Sawmill Sites
      summary: Create sawmill site
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SawmillSite'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /sawmill_sites/{sawmill_site_id}:
    get:
      tags:
        - Sawmill Sites
      summary: Get sawmill site
      parameters:
        - name: sawmill_site_id
          in: path
          required: true
          schema:
            type: string
          example: sawmill_site_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SawmillSite'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Sawmill Sites
      summary: Update sawmill site
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: sawmill_site_id
          in: path
          required: true
          schema:
            type: string
          example: sawmill_site_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SawmillSite'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Sawmill Sites
      summary: Delete sawmill site
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: sawmill_site_id
          in: path
          required: true
          schema:
            type: string
          example: sawmill_site_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /stanford_attachments:
    get:
      tags:
        - StanForD Attachments
      summary: List StanForD attachments
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: forest_operation_id
          in: query
          description: Filter by forest operation ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: tree_processor_id
          in: query
          description: Filter by tree processor ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: Filter by type
          required: false
          schema:
            type: string
        - name: classic
          in: query
          description: Filter by classic StanForD (true) or StanForD 2010 (false)
          required: false
          schema:
            type: boolean
        - name: compressed
          in: query
          description: Filter by file compression (available only for StanForD 2010)
          required: false
          schema:
            type: boolean
        - name: tag
          in: query
          description: Filter by tag
          required: false
          schema:
            type: string
        - name: sort_by
          in: query
          description: Sort results
          required: false
          schema:
            enum:
              - newest
              - oldest
              - type
              - name
              - largest
              - smallest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/StanfordAttachment'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - StanForD Attachments
      summary: Create StanForD attachment
      description: Bearer token with scope `harvest_write` required.
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - attachment:forest_operation_id
                - attachment:tree_processor_id
                - attachment:file
              type: object
              properties:
                attachment:forest_operation_id:
                  type: string
                  format: uuid
                attachment:tree_processor_id:
                  type: string
                  format: uuid
                attachment:file:
                  type: string
                  format: binary
                attachment:name:
                  type: string
                  description: If missing it will default to the filename without extension
                attachment:tags:
                  type: array
                  items:
                    type: string
                  example:
                    - tag1
                    - tag2
                attachment:description:
                  type: string
            encoding:
              attachment:tags:
                style: form
                explode: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StanfordAttachment'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
        '413':
          description: Payload Too Large.
      security:
        - BearerLoginAuth: []
  /stanford_attachments/files/{stanford_attachment_id}:
    get:
      tags:
        - StanForD Attachments
      summary: Download attachment file
      parameters:
        - name: stanford_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: stanford_attachment_id
      responses:
        '200':
          description: File with media type based on attachment type.
        '401':
          description: Unauthorized
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
        - URLSignatureAuth: []
  /stanford_attachments/{stanford_attachment_id}:
    get:
      tags:
        - StanForD Attachments
      summary: Get StanForD attachment
      parameters:
        - name: stanford_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: stanford_attachment_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StanfordAttachment'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - StanForD Attachments
      summary: Delete StanForD attachment
      description: |
        Bearer token with scope `harvest_write` required.
      parameters:
        - name: stanford_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: stanford_attachment_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
    patch:
      tags:
        - StanForD Attachments
      summary: Update StanForD attachment
      description: Bearer token with scope `harvest_write` required.
      parameters:
        - name: stanford_attachment_id
          in: path
          required: true
          schema:
            type: string
          example: stanford_attachment_id
      requestBody:
        content:
          application/json:
            schema:
              required:
                - attachment
              type: object
              properties:
                attachment:
                  type: object
                  properties:
                    name:
                      type: string
                    description:
                      type: string
                    tags:
                      type: array
                      items:
                        type: string
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
  /subcompartments:
    get:
      tags:
        - Subcompartments
      summary: List subcompartments
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: subcompartmentable_type
          in: query
          description: Filter by subcompartmentable type
          required: false
          schema:
            enum:
              - forest_operation
              - forest_property
            type: string
        - name: forest_property_id
          in: query
          description: Filter by forest property ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: forest_operation_id
          in: query
          description: Filter by forest operation ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: bbox
          in: query
          description: Filter by intersection of boundaries and bounding box
          required: false
          style: form
          explode: false
          schema:
            title: BoundingBox
            type: array
            items:
              type: number
            example:
              - 11.1
              - 43.2
              - 12.8
              - 44.9
        - name: origin_property_id
          in: query
          description: Filter by the ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_owner_id
          in: query
          description: Filter by the owner ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_country_iso
          in: query
          description: >-
            Filter by the country (ISO 3166-1 alpha-2) of the forest property of
            origin
          required: false
          schema:
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date or name
          required: false
          schema:
            enum:
              - newest
              - oldest
              - name
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Subcompartment'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Subcompartments
      summary: Create subcompartment
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Subcompartment'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /subcompartments/{subcompartment_id}:
    get:
      tags:
        - Subcompartments
      summary: Get subcompartment
      parameters:
        - name: subcompartment_id
          in: path
          required: true
          schema:
            type: string
          example: subcompartment_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subcompartment'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Subcompartments
      summary: Update subcompartment
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: subcompartment_id
          in: path
          required: true
          schema:
            type: string
          example: subcompartment_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Subcompartment'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Subcompartments
      summary: Delete subcompartment
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: subcompartment_id
          in: path
          required: true
          schema:
            type: string
          example: subcompartment_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_log_locations:
    get:
      tags:
        - Tree Log Locations
      summary: List tree log locations
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: recorded_at
          in: query
          description: Filter by original record datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: bbox
          in: query
          description: Filter by intersection of location and bounding box
          required: false
          style: form
          explode: false
          schema:
            title: BoundingBox
            type: array
            items:
              type: number
            example:
              - 11.1
              - 43.2
              - 12.8
              - 44.9
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TreeLogLocation'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Tree Log Locations
      summary: Create tree log location
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeLogLocation'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_log_locations/{tree_log_location_id}:
    get:
      tags:
        - Tree Log Locations
      summary: Get tree log location
      parameters:
        - name: tree_log_location_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_location_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreeLogLocation'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Tree Log Locations
      summary: Update tree log location
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: tree_log_location_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_location_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeLogLocation'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Tree Log Locations
      summary: Delete tree log location
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: tree_log_location_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_location_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_log_product_definitions:
    get:
      tags:
        - Tree Log Product Definitions
      summary: List tree log product definitions
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: tree_species_id
          in: query
          description: Filter by tree species ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TreeLogProductDefinition'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Tree Log Product Definitions
      summary: Create tree log product definition
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeLogProductDefinition'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_log_product_definitions/{tree_log_product_definition_id}:
    get:
      tags:
        - Tree Log Product Definitions
      summary: Get tree log product definition
      parameters:
        - name: tree_log_product_definition_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_product_definition_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreeLogProductDefinition'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Tree Log Product Definitions
      summary: Update tree log product definition
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: tree_log_product_definition_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_product_definition_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeLogProductDefinition'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Tree Log Product Definitions
      summary: Delete tree log product definition
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: tree_log_product_definition_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_product_definition_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_log_reports:
    get:
      tags:
        - Tree Log Reports
      summary: List tree log reports
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: forest_reportable_type
          in: query
          description: Filter by forest reportable type
          required: false
          schema:
            enum:
              - forest_operation
              - sample_plot
              - subcompartment
            type: string
        - name: forest_operation_id
          in: query
          description: Filter by forest operation ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: subcompartment_id
          in: query
          description: Filter by subcompartment ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: sample_plot_id
          in: query
          description: Filter by sample plot ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: tree_species_id
          in: query
          description: Filter by tree species ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_id
          in: query
          description: Filter by the ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_owner_id
          in: query
          description: Filter by the owner ID of the forest property of origin
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: origin_property_country_iso
          in: query
          description: >-
            Filter by the country (ISO 3166-1 alpha-2) of the forest property of
            origin
          required: false
          schema:
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TreeLogReport'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Tree Log Reports
      summary: Create tree log report
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeLogReport'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_log_reports/{tree_log_report_id}:
    get:
      tags:
        - Tree Log Reports
      summary: Get tree log report
      parameters:
        - name: tree_log_report_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_report_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreeLogReport'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Tree Log Reports
      summary: Update tree log report
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: tree_log_report_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_report_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeLogReport'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Tree Log Reports
      summary: Delete tree log report
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: tree_log_report_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_report_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_log_sawmill_measurements:
    get:
      tags:
        - Tree Log Sawmill Measurements
      summary: List tree log sawmill measurements
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: sawmill_batch_id
          in: query
          description: Filter by sawmill batch ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: processed_at
          in: query
          description: Filter by processing datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TreeLogSawmillMeasurement'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Tree Log Sawmill Measurements
      summary: Create tree log sawmill measurement
      description: Bearer token with scope `sawmill_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeLogSawmillMeasurement'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_log_sawmill_measurements/{tree_log_id}:
    get:
      tags:
        - Tree Log Sawmill Measurements
      summary: Get tree log sawmill measurement
      parameters:
        - name: tree_log_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_id
        - name: expand_related
          in: query
          description: >-
            Include expanded related associations; otherwise, only a summary is
            provided in `related_overview`
          required: true
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreeLogSawmillMeasurement'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
  /tree_log_sawmill_measurements/{tree_log_sawmill_measurement_id}:
    put:
      tags:
        - Tree Log Sawmill Measurements
      summary: Update tree log sawmill measurement
      description: Bearer token with scope `sawmill_write` required.
      parameters:
        - name: tree_log_sawmill_measurement_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_sawmill_measurement_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeLogSawmillMeasurement'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Tree Log Sawmill Measurements
      summary: Delete tree log sawmill measurement
      description: |
        Bearer token with scope `sawmill_write` required.
      parameters:
        - name: tree_log_sawmill_measurement_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_sawmill_measurement_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_logs:
    get:
      tags:
        - Tree Logs
      summary: List tree logs
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: simulated
          in: query
          description: Filter by the given tree log being simulated or not
          required: false
          schema:
            type: boolean
        - name: harvested_tree_id
          in: query
          description: Filter by harvested tree ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: inventory_tree_id
          in: query
          description: Filter by inventory tree ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: tree_processor_id
          in: query
          description: Filter by tree processor ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: product_definition_id
          in: query
          description: Filter by tree log production definition ID
          required: false
          schema:
            title: Universally unique identitifier
            type: string
            format: uuid
        - name: measured_at
          in: query
          description: Filter by the measurement datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: external_id
          in: query
          description: Filter by external identifier ID
          required: false
          schema:
            type: string
        - name: external_id_type
          in: query
          description: Filter by external identifier type
          required: false
          schema:
            enum:
              - other
              - rfid
              - hammer
              - barcode
              - paint
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date
          required: false
          schema:
            enum:
              - newest
              - oldest
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TreeLog'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Tree Logs
      summary: Create tree log
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeLog'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_logs/{tree_log_id}:
    get:
      tags:
        - Tree Logs
      summary: Get tree log
      parameters:
        - name: tree_log_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreeLog'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Tree Logs
      summary: Update tree log
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: tree_log_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeLog'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Tree Logs
      summary: Delete tree log
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: tree_log_id
          in: path
          required: true
          schema:
            type: string
          example: tree_log_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_processors:
    get:
      tags:
        - Tree Processors
      summary: List tree processors
      parameters:
        - name: page
          in: query
          description: Page number
          required: false
          schema:
            type: integer
            default: 1
        - name: per_page
          in: query
          description: Maximum number of items per page, with an upper limit of 100
          required: false
          schema:
            type: integer
            default: 25
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: created_at
          in: query
          description: Filter by creation datetime interval
          required: false
          schema:
            title: TimeInterval
            type: string
        - name: sort_by
          in: query
          description: Sort results by creation date or name
          required: false
          schema:
            enum:
              - newest
              - oldest
              - name
            type: string
            default: newest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TreeProcessor'
        '422':
          description: Unprocessable Entity.
      security:
        - BearerLoginAuth: []
    post:
      tags:
        - Tree Processors
      summary: Create tree processor
      description: Bearer token with scope `inventory_write` required.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeProcessor'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_processors/{tree_processor_id}:
    get:
      tags:
        - Tree Processors
      summary: Get tree processor
      parameters:
        - name: tree_processor_id
          in: path
          required: true
          schema:
            type: string
          example: tree_processor_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreeProcessor'
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    put:
      tags:
        - Tree Processors
      summary: Update tree processor
      description: Bearer token with scope `inventory_write` required.
      parameters:
        - name: tree_processor_id
          in: path
          required: true
          schema:
            type: string
          example: tree_processor_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeProcessor'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - BearerLoginAuth: []
    delete:
      tags:
        - Tree Processors
      summary: Delete tree processor
      description: |
        Bearer token with scope `inventory_write` required.
      parameters:
        - name: tree_processor_id
          in: path
          required: true
          schema:
            type: string
          example: tree_processor_id
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
        '409':
          description: Conflict.
      security:
        - BearerLoginAuth: []
  /tree_species:
    get:
      tags:
        - Tree Species
      summary: List tree species
      parameters:
        - name: name
          in: query
          description: Search by name
          required: false
          schema:
            type: string
        - name: common_name
          in: query
          description: Search by common name
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TreeSpecies'
    post:
      tags:
        - Tree Species
      summary: Create tree species
      description: Available only for ***administrators***.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeSpecies'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
      security:
        - LoginAuth: []
  /tree_species/{tree_species_id}:
    get:
      tags:
        - Tree Species
      summary: Get tree species
      description: Available only for ***administrators***.
      parameters:
        - name: tree_species_id
          in: path
          required: true
          schema:
            type: string
          example: tree_species_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreeSpecies'
        '404':
          description: Not Found.
    put:
      tags:
        - Tree Species
      summary: Update tree species
      description: Available only for ***administrators***.
      parameters:
        - name: tree_species_id
          in: path
          required: true
          schema:
            type: string
          example: tree_species_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeSpecies'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - LoginAuth: []
    delete:
      tags:
        - Tree Species
      summary: Delete tree species
      description: >-
        If the tree species is already used elsewhere in the database the
        deletion will fail.

        Available only for ***administrators***.
      parameters:
        - name: tree_species_id
          in: path
          required: true
          schema:
            type: string
          example: tree_species_id
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - LoginAuth: []
  /users:
    get:
      tags:
        - Users
      summary: Retrieves all users
      description: |-
        All users are returned, including those soft deleted.
        Available only for ***administrators***.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
      security:
        - LoginAuth: []
    post:
      tags:
        - Users
      summary: Creates a user
      description: Available only for ***administrators***.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegistrationUser'
        required: true
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
      security:
        - LoginAuth: []
  /users/{user_id}:
    get:
      tags:
        - Users
      summary: Retrieves a user
      description: Available when logged in as the requested user or as an administrator.
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
          example: user_id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - LoginAuth: []
    put:
      tags:
        - Users
      summary: Updates a user
      description: Available only for ***administrators***.
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
          example: user_id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - LoginAuth: []
    delete:
      tags:
        - Users
      summary: Soft deletes a single user
      description: >-
        All of the user's login tokens will be deactivated.

        Soft deletion is used to maintain data integrity and for accountability
        reasons.

        Self-deletion is not possible, i.e., the currently logged-in user cannot
        delete themself.

        If a user is already soft deleted this operation has no effect.  

        Available only for ***administrators***.
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
          example: user_id
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
      security:
        - LoginAuth: []
  /users/{user_id}/restore:
    post:
      tags:
        - Users
      summary: Restores a user
      description: |-
        If a user has not been soft deleted this operation has no effect.
        Available only for ***administrators***.
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
          example: user_id
      requestBody:
        content:
          application/json: {}
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not Found.
      security:
        - LoginAuth: []
components:
  schemas:
    WKB_Point:
      title: GeoJSONPoint
      required:
        - type
        - coordinates
      type: object
      properties:
        type:
          enum:
            - Point
          type: string
        coordinates:
          maxItems: 2
          minItems: 2
          type: array
          items:
            type: number
    WKB_Polygon:
      title: GeoJSONPolygon
      required:
        - type
        - coordinates
      type: object
      properties:
        type:
          enum:
            - Polygon
          type: string
        coordinates:
          minItems: 1
          type: array
          items:
            minItems: 4
            type: array
            items:
              maxItems: 2
              minItems: 2
              type: array
              items:
                type: number
    BearerLogin:
      required:
        - name
        - scopes
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
        scopes:
          type: array
          items:
            type: string
        active_at:
          type: string
          format: date-time
          readOnly: true
        inactive_at:
          type: string
          format: date-time
          readOnly: true
    Board:
      required:
        - id
        - measured_at
        - thickness
        - width
        - length
        - external_identifiers
        - tree_log_id
        - sawmill_batch_id
        - board_class_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        measured_at:
          type: string
          format: date-time
        thickness:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        width:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        length:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        external_identifiers:
          type: array
          items:
            $ref: '#/components/schemas/ExternalIdentifier'
        tree_log_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        tree_log:
          allOf:
            - $ref: '#/components/schemas/TreeLog'
          description: _Expanded related association_
          readOnly: true
        sawmill_batch_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        sawmill_batch:
          allOf:
            - $ref: '#/components/schemas/SawmillBatch'
          description: _Expanded related association_
          readOnly: true
        board_class_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        board_class:
          allOf:
            - $ref: '#/components/schemas/BoardClass'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    BoardClass:
      required:
        - id
        - name
        - group_name
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        group_name:
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    CuttingInstructionItem:
      required:
        - id
        - weightings
        - set_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        sed_classes:
          type: array
          items:
            type: number
        weightings:
          type: array
          items:
            type: number
        set_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        set:
          allOf:
            - $ref: '#/components/schemas/CuttingInstructionSet'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    CuttingInstructionSet:
      required:
        - id
        - name
        - tree_log_product_definition_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        source:
          type: string
        tree_log_product_definition_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        tree_log_product_definition:
          allOf:
            - $ref: '#/components/schemas/TreeLogProductDefinition'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    Error:
      required:
        - title
        - status
      type: object
      properties:
        title:
          type: string
        status:
          type: integer
        type:
          type: string
        details:
          type: string
        param:
          type: string
    ExternalIdentifier:
      required:
        - id
        - type
      type: object
      properties:
        id:
          type: string
        type:
          enum:
            - other
            - rfid
            - hammer
            - barcode
            - paint
          type: string
    ForestOperation:
      required:
        - id
        - name
        - area
        - forest_property_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        status:
          enum:
            - planned
            - in_progress
            - on_hold
            - complete
          type: string
        type:
          enum:
            - thinning
            - clearfell
            - continuous_cover_forestry
          type: string
        manager:
          type: string
        start_date:
          type: string
          format: date
        end_date:
          type: string
          format: date
        location:
          $ref: '#/components/schemas/WKB_Point'
        area:
          type: number
          description: 'Unit: hectare (ha).'
        productive_area:
          type: number
          description: 'Unit: hectare (ha).'
        harvested_area:
          type: number
          description: 'Unit: hectare (ha).'
        related_overview:
          allOf:
            - $ref: '#/components/schemas/ForestOperationRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        forest_property_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        forest_property:
          allOf:
            - $ref: '#/components/schemas/ForestProperty'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    ForestOperationAttachment:
      required:
        - id
        - name
        - type
        - category
        - size
        - url
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        type:
          type: string
        category:
          enum:
            - office
            - image
            - geo_vector
            - geo_raster
            - data_exchange
            - archive
          type: string
        size:
          type: integer
          description: 'Unit: byte (by).'
        url:
          type: string
          description: File URL
        description:
          type: string
        tags:
          type: array
          items:
            type: string
          description: 'Note: always in lower case.'
        related_overview:
          allOf:
            - $ref: '#/components/schemas/ForestOperationAttachmentRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    ForestOperationAttachmentRelatedOverview:
      required:
        - forest_operation
      type: object
      properties:
        forest_operation:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
    ForestOperationRelatedOverview:
      required:
        - forest_property
        - origin_property
      type: object
      properties:
        forest_property:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        origin_property:
          required:
            - id
            - name
            - owner_id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
            owner_id:
              title: Universally unique identitifier
              type: string
              format: uuid
            country_iso:
              type: string
    ForestProperty:
      required:
        - name
        - location
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        location:
          allOf:
            - $ref: '#/components/schemas/WKB_Point'
          description: Centroid of associated forest operation boundaries.
        ownership_type:
          enum:
            - public
            - private
          type: string
        country_iso:
          type: string
          description: Uppercase country code (ISO 3166-1 alpha-2).
          example: IT
        subdivision_iso:
          type: string
          description: Uppercase administrative subsivision (ISO 3166-2).
          example: IT-52
        description:
          type: string
        related_overview:
          allOf:
            - $ref: '#/components/schemas/ForestPropertyRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        owner_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        owner:
          allOf:
            - $ref: '#/components/schemas/ForestPropertyOwner'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    ForestPropertyOwner:
      required:
        - id
        - name
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        type:
          enum:
            - legal_entity
            - person
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    ForestPropertyRelatedOverview:
      required:
        - owner
      type: object
      properties:
        owner:
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
    HarvestedTree:
      required:
        - id
        - external_identifiers
        - tree_species_id
        - subcompartment_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        field_mark:
          type: string
        planted_at:
          type: string
          format: date-time
        location:
          $ref: '#/components/schemas/WKB_Point'
        dbh:
          type: number
          description: 'Unit: centimeter (cm).'
        biomass:
          type: number
          description: 'Unit: cubic meter (m3).'
        volume:
          type: number
          description: 'Unit: cubic meter (m3).'
        height:
          type: number
          description: 'Unit: meter (m).'
        external_identifiers:
          type: array
          items:
            $ref: '#/components/schemas/ExternalIdentifier'
        tree_species_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        tree_species:
          allOf:
            - $ref: '#/components/schemas/TreeSpecies'
          description: _Expanded related association_
          readOnly: true
        subcompartment_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        subcompartment:
          allOf:
            - $ref: '#/components/schemas/Subcompartment'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    HarvestingReport:
      required:
        - id
        - forest_reportable_id
        - forest_reportable_type
        - tree_processor_id
      type: object
      properties:
        tree_species:
          allOf:
            - $ref: '#/components/schemas/TreeSpecies'
          readOnly: true
        forest_reportable:
          oneOf:
            - $ref: '#/components/schemas/ForestOperation'
            - $ref: '#/components/schemas/SamplePlot'
            - $ref: '#/components/schemas/Subcompartment'
          description: _Expanded related association_
          readOnly: true
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        tree_species_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        forest_reportable_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        forest_reportable_type:
          enum:
            - forest_operation
            - sample_plot
            - subcompartment
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        stem_count:
          type: integer
        mean_height:
          type: number
          description: 'Unit: meter (m).'
        mean_dbh:
          type: number
          description: 'Unit: centimeter (cm).'
        volume:
          type: number
          description: 'Unit: cubic meter (m3).'
        biomass:
          type: number
          description: 'Unit: tonne (t).'
        additional_info:
          type: object
          additionalProperties: true
        related_overview:
          allOf:
            - $ref: '#/components/schemas/HarvestingReportRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        tree_processor_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        tree_processor:
          allOf:
            - $ref: '#/components/schemas/TreeProcessor'
          description: _Expanded related association_
          readOnly: true
    HarvestingReportRelatedOverview:
      required:
        - tree_processor
      type: object
      properties:
        forest_operation:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        sample_plot:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        subcompartment:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        origin_property:
          required:
            - id
            - name
            - owner_id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
            owner_id:
              title: Universally unique identitifier
              type: string
              format: uuid
            country_iso:
              type: string
        tree_species:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        tree_processor:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
    InventoryReport:
      required:
        - id
        - forest_reportable_id
        - forest_reportable_type
      type: object
      properties:
        tree_species:
          allOf:
            - $ref: '#/components/schemas/TreeSpecies'
          readOnly: true
        forest_reportable:
          oneOf:
            - $ref: '#/components/schemas/ForestOperation'
            - $ref: '#/components/schemas/SamplePlot'
            - $ref: '#/components/schemas/Subcompartment'
          description: _Expanded related association_
          readOnly: true
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        tree_species_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        forest_reportable_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        forest_reportable_type:
          enum:
            - forest_operation
            - sample_plot
            - subcompartment
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        age:
          type: number
          description: 'Unit: year (a).'
        stem_count:
          type: integer
        mean_height:
          type: number
          description: 'Unit: meter (m).'
        mean_dbh:
          type: number
          description: 'Unit: centimeter (cm).'
        volume:
          type: number
          description: 'Unit: cubic meter (m3).'
        biomass:
          type: number
          description: 'Unit: tonne (t).'
        additional_info:
          type: object
          additionalProperties: true
        related_overview:
          allOf:
            - $ref: '#/components/schemas/InventoryReportRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
    InventoryReportRelatedOverview:
      type: object
      properties:
        forest_operation:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        sample_plot:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        subcompartment:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        origin_property:
          required:
            - id
            - name
            - owner_id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
            owner_id:
              title: Universally unique identitifier
              type: string
              format: uuid
            country_iso:
              type: string
        tree_species:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
    InventoryTree:
      required:
        - id
        - tree_species_id
        - external_identifiers
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        tree_species_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        harvested_tree_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        sample_plot_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        measured_at:
          type: string
          format: date-time
        planted_at:
          type: string
          format: date-time
        location:
          $ref: '#/components/schemas/WKB_Point'
        dbh:
          type: number
          description: 'Unit: centimeter (cm).'
        biomass:
          type: number
          description: 'Unit: cubic meter (m3).'
        volume:
          type: number
          description: 'Unit: cubic meter (m3).'
        height:
          type: number
          description: 'Unit: meter (m).'
        tree_species:
          allOf:
            - $ref: '#/components/schemas/TreeSpecies'
          description: _Expanded related association_
          readOnly: true
        harvested_tree:
          allOf:
            - $ref: '#/components/schemas/HarvestedTree'
          description: _Expanded related association_
          readOnly: true
        sample_plot:
          allOf:
            - $ref: '#/components/schemas/SamplePlot'
          description: _Expanded related association_
          readOnly: true
        external_identifiers:
          type: array
          items:
            $ref: '#/components/schemas/ExternalIdentifier'
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    Organization:
      required:
        - name
        - abbreviation
        - website
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
        abbreviation:
          type: string
        website:
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        soft_deleted_at:
          type: string
          format: date-time
          readOnly: true
    QualityIndicator:
      required:
        - id
        - name
        - description
        - kind
        - value_schema
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        kind:
          enum:
            - tree
            - tree_log
            - board
          type: string
        value_schema:
          type: object
          additionalProperties: true
          description: JSON Schema object
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    QualityIndicatorItem:
      required:
        - id
        - value
        - qualifiable_id
        - qualifiable_type
        - indicator_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        value:
          type: object
          additionalProperties: true
        start_position:
          type: number
        end_position:
          type: number
        qualifiable_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        qualifiable_type:
          enum:
            - inventory_tree
            - harvested_tree
            - tree_log
            - board
          type: string
        related_overview:
          allOf:
            - $ref: '#/components/schemas/QualityIndicatorItemRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        indicator_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        indicator:
          allOf:
            - $ref: '#/components/schemas/QualityIndicator'
          description: _Expanded related association_
          readOnly: true
        qualifiable:
          oneOf:
            - $ref: '#/components/schemas/InventoryTree'
            - $ref: '#/components/schemas/HarvestedTree'
            - $ref: '#/components/schemas/TreeLog'
            - $ref: '#/components/schemas/Board'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    QualityIndicatorItemRelatedOverview:
      required:
        - indicator
      type: object
      properties:
        indicator:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
        harvested_tree:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
        inventory_tree:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
        tree_log:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
        board:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
    RegistrationUser:
      required:
        - email
        - name
        - password
        - organization_id
      type: object
      properties:
        email:
          type: string
        name:
          type: string
        password:
          type: string
        organization_id:
          type: integer
    SamplePlot:
      required:
        - id
        - location
        - shape
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        measured_at:
          type: string
          description: Timestamp of measurement in the field.
          format: date-time
        location:
          $ref: '#/components/schemas/WKB_Point'
        shape:
          enum:
            - circle
            - rectangle
            - polygon
          type: string
        boundaries:
          allOf:
            - $ref: '#/components/schemas/WKB_Polygon'
          description: Required if shape is `polygon`.
        radius:
          type: number
          description: Required if shape is `circle`.
        length:
          type: number
          description: Required if shape is `rectangle`.
        width:
          type: number
          description: Required if shape is `rectangle`.
        sample_area:
          type: number
          description: 'Unit: hectare (ha).'
        additional_info:
          type: object
          additionalProperties: true
        related_overview:
          allOf:
            - $ref: '#/components/schemas/SamplePlotRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        forest_operation_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        forest_operation:
          allOf:
            - $ref: '#/components/schemas/ForestOperation'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    SamplePlotRelatedOverview:
      required:
        - forest_operation
        - origin_property
      type: object
      properties:
        forest_operation:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        origin_property:
          required:
            - id
            - name
            - owner_id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
            owner_id:
              title: Universally unique identitifier
              type: string
              format: uuid
            country_iso:
              type: string
    Sawline:
      required:
        - id
        - name
        - type
        - sawmill_site_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        type:
          type: string
        sawmill_site_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        sawmill_site:
          allOf:
            - $ref: '#/components/schemas/SawmillSite'
          description: _Expanded related association_
          readOnly: true
        related_overview:
          allOf:
            - $ref: '#/components/schemas/SawlineRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    SawlineAttachment:
      required:
        - id
        - name
        - type
        - category
        - size
        - url
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        type:
          type: string
        category:
          enum:
            - office
            - image
            - geo_vector
            - geo_raster
            - data_exchange
            - archive
          type: string
        size:
          type: integer
          description: 'Unit: byte (by).'
        url:
          type: string
          description: File URL
        description:
          type: string
        tags:
          type: array
          items:
            type: string
          description: 'Note: always in lower case.'
        related_overview:
          allOf:
            - $ref: '#/components/schemas/SawlineAttachmentRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    SawlineAttachmentRelatedOverview:
      required:
        - sawline
      type: object
      properties:
        sawline:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
    SawlineRelatedOverview:
      required:
        - sawmill_site
      type: object
      properties:
        sawmill_site:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
    SawmillBatch:
      required:
        - id
        - sawmill_site_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        external_id:
          type: string
        related_overview:
          allOf:
            - $ref: '#/components/schemas/SawmillBatchRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        sawmill_site_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        sawmill_site:
          allOf:
            - $ref: '#/components/schemas/SawmillSite'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    SawmillBatchRelatedOverview:
      required:
        - sawmill_site
      type: object
      properties:
        sawmill_site:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
    SawmillCompany:
      required:
        - id
        - name
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    SawmillSite:
      required:
        - id
        - name
        - company_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        location:
          $ref: '#/components/schemas/WKB_Point'
        country_iso:
          type: string
          description: Uppercase country code (ISO 3166-1 alpha-2).
          example: IT
        related_overview:
          allOf:
            - $ref: '#/components/schemas/SawmillSiteRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        company_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        company:
          allOf:
            - $ref: '#/components/schemas/SawmillCompany'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    SawmillSiteRelatedOverview:
      required:
        - company
      type: object
      properties:
        company:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
    StanfordAttachment:
      required:
        - id
        - name
        - type
        - size
        - url
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        type:
          type: string
        size:
          type: integer
          description: 'Unit: byte (by).'
        url:
          type: string
          description: File URL
        description:
          type: string
        tags:
          type: array
          items:
            type: string
          description: 'Note: always in lower case.'
        related_overview:
          allOf:
            - $ref: '#/components/schemas/StanfordAttachmentRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    StanfordAttachmentRelatedOverview:
      required:
        - forest_operation
        - tree_processor
      type: object
      properties:
        forest_operation:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
        tree_processor:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
    Subcompartment:
      required:
        - id
        - name
        - subcompartmentable_id
        - subcompartmentable_type
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        boundaries:
          $ref: '#/components/schemas/WKB_Polygon'
        area:
          type: number
          description: 'Unit: hectare (ha).'
        productive_area:
          type: number
          description: 'Unit: hectare (ha).'
        harvested_area:
          type: number
          description: 'Unit: hectare (ha).'
        altitude:
          type: number
          description: 'Unit: meter (m).'
        exposition:
          type: string
        slope:
          type: number
        variety:
          type: string
          description: 'Unit: percent of slope (%[slope]).'
        co2_capture:
          type: number
          description: 'Unit: tonne (t).'
        distance_to_road:
          type: number
        biomass:
          type: number
        subcompartmentable_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        subcompartmentable_type:
          enum:
            - forest_operation
            - forest_property
          type: string
        related_overview:
          allOf:
            - $ref: '#/components/schemas/SubcompartmentRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        subcompartmentable:
          oneOf:
            - $ref: '#/components/schemas/ForestOperation'
            - $ref: '#/components/schemas/ForestProperty'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    SubcompartmentRelatedOverview:
      required:
        - origin_property
      type: object
      properties:
        forest_operation:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        forest_property:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        origin_property:
          required:
            - id
            - name
            - owner_id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
            owner_id:
              title: Universally unique identitifier
              type: string
              format: uuid
            country_iso:
              type: string
    TreeLog:
      required:
        - id
        - measured_at
        - simulated
        - external_identifiers
        - tree_processor_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        measured_at:
          type: string
          format: date-time
        simulated:
          type: boolean
          description: True if not an actually harvested tree log.
        log_part:
          type: integer
          description: Log's position within the standing tree, from bottom to top.
        forced_cutting_reason:
          enum:
            - automatic
            - decay
            - damage
            - crook
            - sweep
            - grade_break
            - pulpwood_grade
            - top_break
            - spinning
            - other_manual
          type: string
        length:
          type: number
          description: 'Unit: meter (m).'
        small_end_diameter:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        middle_end_diameter:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        large_end_diameter:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        bottom_height:
          type: number
          description: 'Unit: meter (m). Log bottom height in the stem.'
        top_height:
          type: number
          description: 'Unit: meter (m). Log top height in the stem.'
        biomass:
          type: number
          description: 'Unit: cubic meter (m3).'
        volume_ab:
          type: number
          description: 'Unit: cubic meter (m3). Total volume above bark (e.g. Smaliana).'
        volume_bb:
          type: number
          description: 'Unit: cubic meter (m3). Total volume below bark (e.g. Smaliana).'
        sweep:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        taper:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        external_identifiers:
          type: array
          items:
            $ref: '#/components/schemas/ExternalIdentifier'
        tree_processor_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        tree_processor:
          allOf:
            - $ref: '#/components/schemas/TreeProcessor'
          description: _Expanded related association_
          readOnly: true
        harvested_tree_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        harvested_tree:
          allOf:
            - $ref: '#/components/schemas/HarvestedTree'
          description: _Expanded related association_
          readOnly: true
        inventory_tree_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        inventory_tree:
          allOf:
            - $ref: '#/components/schemas/InventoryTree'
          description: _Expanded related association_
          readOnly: true
        product_definition_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        product_definition:
          allOf:
            - $ref: '#/components/schemas/TreeLogProductDefinition'
          description: _Expanded related association_
          readOnly: true
    TreeLogLocation:
      required:
        - id
        - location
        - recorded_at
        - tree_log_id
        - tree_processor_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        location:
          $ref: '#/components/schemas/WKB_Point'
        recorded_at:
          type: string
          format: date-time
        related_overview:
          allOf:
            - $ref: '#/components/schemas/TreeLogLocationRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        tree_log_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        tree_log:
          allOf:
            - $ref: '#/components/schemas/TreeLog'
          description: _Expanded related association_
          readOnly: true
        tree_processor_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        tree_processor:
          allOf:
            - $ref: '#/components/schemas/TreeProcessor'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    TreeLogLocationRelatedOverview:
      required:
        - tree_log
        - tree_processor
      type: object
      properties:
        tree_log:
          required:
            - id
            - simulated
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            simulated:
              type: boolean
        tree_processor:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            operator_label:
              type: string
    TreeLogProductDefinition:
      required:
        - id
        - name
        - tree_species_id
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        max_sweep:
          type: number
          description: 'Unit: millimeter per meter (mm/m).'
        max_length:
          type: number
          description: 'Unit: meter (m).'
        min_length:
          type: number
          description: 'Unit: meter (m).'
        min_small_end_diameter:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        max_small_end_diameter:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        min_large_end_diameter:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        max_large_end_diameter:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        related_overview:
          allOf:
            - $ref: '#/components/schemas/TreeLogProductDefinitionRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        tree_species_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        tree_species:
          allOf:
            - $ref: '#/components/schemas/TreeSpecies'
          description: _Expanded related association_
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    TreeLogProductDefinitionRelatedOverview:
      required:
        - tree_species
      type: object
      properties:
        tree_species:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
    TreeLogReport:
      required:
        - id
        - forest_reportable_id
        - forest_reportable_type
        - tree_log_count
      type: object
      properties:
        tree_species:
          allOf:
            - $ref: '#/components/schemas/TreeSpecies'
          readOnly: true
        forest_reportable:
          oneOf:
            - $ref: '#/components/schemas/ForestOperation'
            - $ref: '#/components/schemas/SamplePlot'
            - $ref: '#/components/schemas/Subcompartment'
          description: _Expanded related association_
          readOnly: true
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        tree_species_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        forest_reportable_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        forest_reportable_type:
          enum:
            - forest_operation
            - sample_plot
            - subcompartment
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        volume:
          type: number
          description: 'Unit: cubic meter (m3).'
        mean_length:
          type: number
          description: 'Unit: meter (m).'
        mean_sed:
          type: number
          description: 'Unit: tenth of millimeter (mm/10).'
        summed_sed:
          type: number
          description: 'Unit: tenth of millimeter (mm/10).'
        sed_histogram:
          type: object
          additionalProperties: true
        tree_log_count:
          type: integer
        additional_info:
          type: object
          additionalProperties: true
        related_overview:
          allOf:
            - $ref: '#/components/schemas/TreeLogReportRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        tree_processor_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        tree_processor:
          allOf:
            - $ref: '#/components/schemas/TreeProcessor'
          description: _Expanded related association_
          readOnly: true
        cutting_instruction_set_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        cutting_instruction_set:
          allOf:
            - $ref: '#/components/schemas/CuttingInstructionSet'
          description: _Expanded related association_
          readOnly: true
    TreeLogReportRelatedOverview:
      required:
        - cutting_instruction_set
      type: object
      properties:
        forest_operation:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        sample_plot:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        subcompartment:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        origin_property:
          required:
            - id
            - name
            - owner_id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
            owner_id:
              title: Universally unique identitifier
              type: string
              format: uuid
            country_iso:
              type: string
        tree_species:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        tree_processor:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
        cutting_instruction_set:
          required:
            - id
            - name
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
            name:
              type: string
    TreeLogSawmillMeasurement:
      required:
        - tree_log_id
        - processed_at
      type: object
      properties:
        tree_log_id:
          title: Universally unique identitifier
          type: string
          format: uuid
        processed_at:
          type: string
          format: date-time
        length:
          type: number
          description: 'Unit: meter (m).'
        small_end_diameter:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        middle_end_diameter:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        large_end_diameter:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        volume_ab:
          type: number
          description: 'Unit: cubic meter (m3). Total volume above bark (e.g. Smaliana).'
        volume_bb:
          type: number
          description: 'Unit: cubic meter (m3). Total volume below bark (e.g. Smaliana).'
        sweep:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        taper:
          type: integer
          description: 'Unit: tenth of millimeter (mm/10).'
        related_overview:
          allOf:
            - $ref: '#/components/schemas/TreeLogSawmillMeasurementRelatedOverview'
          description: _Main attributes of related associations_
          readOnly: true
        sawmill_batch_id:
          title: Universally unique identitifier
          type: string
          format: uuid
          writeOnly: true
        sawmill_batch:
          allOf:
            - $ref: '#/components/schemas/SawmillBatch'
          description: _Expanded related association_
          readOnly: true
    TreeLogSawmillMeasurementRelatedOverview:
      type: object
      properties:
        sawmill_batch:
          required:
            - id
          type: object
          properties:
            id:
              title: Universally unique identitifier
              type: string
              format: uuid
    TreeProcessor:
      required:
        - id
        - name
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
        name:
          type: string
        type:
          enum:
            - harvester
            - forwarder
            - manual
            - other
          type: string
        operator_label:
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    TreeSpecies:
      required:
        - name
      type: object
      properties:
        id:
          title: Universally unique identitifier
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
        common_name:
          type: string
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    User:
      required:
        - email
        - name
        - admin
        - organization_id
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        email:
          type: string
        name:
          type: string
        admin:
          type: boolean
          readOnly: true
        organization_id:
          type: integer
          writeOnly: true
        organization:
          allOf:
            - $ref: '#/components/schemas/Organization'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        soft_deleted_at:
          type: string
          format: date-time
          readOnly: true
  responses: {}
  parameters: {}
  examples: {}
  requestBodies: {}
  headers: {}
  securitySchemes:
    LoginAuth:
      type: http
      description: Bearer token obtained via authentication with email and password
      scheme: bearer
    BearerLoginAuth:
      type: http
      description: Bearer token obtained via bearer logins with scopes
      scheme: bearer
    URLSignatureAuth:
      type: apiKey
      description: >-
        URL signature in JWT format for authenticated requests without bearer
        token
      name: jwt
      in: query
  links: {}
  callbacks: {}
tags:
  - name: Organizations
    description: >-
      Participant organizations with programmatic access to the Sintetic GeoDB
      API.
  - name: Users
    description: >-
      Users who belong to a participant organization and have programmatic
      access to the Sintetic GeoDB API.
  - name: Auth
    description: User authentication and authorization.
  - name: Tree Species
    description: |
      Shared naming of tree species.

      Immediate associations:
      - *has many*: Inventory Trees
      - *has many*: Harvested Trees
      - *has many*: Inventory Reports
      - *has many*: Harvesting Reports
      - *has many*: Tree Log Reports
      - *has many*: Tree Log Product Definitions
  - name: Forest Property Owners
    description: |-
      Proprietors of forestland used for logging operations.

      Immediate associations:
      - *has_many*: Forest Properties
  - name: Forest Properties
    description: >-
      Forestland units used for logging operations.


      Immediate associations:

      - *belongs to*: Forest Property Owner

      - *has many*: Forest Operations

      - *has many*: Subcompartments
      `[`subcompartmentable_type=forest_property`]`
  - name: Forest Operations
    description: >-
      Operations break down forestland spatially and temporarily, easing
      management and reporting.


      Immediate associations:

      - <u>*belongs to*</u>: Forest Property

      - *has many*: Forest Operation Attachments

      - *has many*: Sample Plots

      - *has many*: Subcompartments `[`subcompartmentable=forest_operation`]`

      - *has many*: StanForD Attachments

      - *has many*: Inventory Reports `[`forest_reportable=forest_operation`]`

      - *has many*: Harvesting Reports `[`forest_reportable=forest_operation`]`

      - *has many*: Tree Log Reports `[`forest_reportable=forest_operation`]`
  - name: Forest Operation Attachments
    description: |-
      Generic attachment files for a forest operation.

      Immediate associations:
      - <u>*belongs to*</u>: Forest Operation
  - name: Subcompartments
    description: >
      Basic forest management units for mapping, display, and analysis as
      contextual references.


      Immediate associations:

      - <u>*belongs to*</u>: _subcompartmentable_ `{` Forest Property `|` Forest
      Operation `}`

      - *has many*: Harvested Trees

      - *has many*: Inventory Reports `[`forest_reportable=subcompartment`]`

      - *has many*: Harvesting Reports `[`forest_reportable=subcompartment`]`

      - *has many*: Tree Log Reports `[`forest_reportable=subcompartment`]`
  - name: Sample Plots
    description: |
      Plots of landforest samples used for inventory purposes.

      Immediate associations:
      - <u>*belongs to*</u>: Forest Operation
      - *has many*: Tree Logs
      - *has many*: Tree Log Reports
      - *has many*: Tree Log Locations
      - *has many*: Harvesting Reports
      - *has many*: StanForD Attachments
  - name: Tree Processors
    description: |
      Devices (e.g., harvesters, forwarders) used to process trees.

      Immediate associations:
      - *has many*: Inventory Trees
      - *has many*: Inventory Reports `[`forest_reportable=sample_plot`]`
      - *has many*: Harvesting Reports `[`forest_reportable=sample_plot`]`
      - *has many*: Tree Log Reports `[`forest_reportable=sample_plot`]`
  - name: StanForD Attachments
    description: >-
      Attachment files in the
      [StanForD](https://www.skogforsk.se/english/projects/stanford/) format,
      both the classic and 2010 editions.


      Immediate associations:

      - <u>*belongs to*</u>: Forest Operation

      - <u>*belongs to*</u>: Tree Processor
  - name: Tree Log Product Definitions
    description: |-
      Definitions of targeted log products in actual or simulated harvesting.

      Immediate associations:
      - <u>*belongs to*</u>: Tree Species
      - *has many*: Cutting Instruction Sets
  - name: Cutting Instruction Sets
    description: >-
      Groups of cutting instruction items related to a tree log product
      definition.


      Immediate associations:

      - <u>*belongs to*</u>: Tree Log Product Definition

      - *has many*: Cutting Instruction Items

      - *has many*: Tree Log Reports
  - name: Cutting Instruction Items
    description: Single cutting instructions with an assigned a weighting/priority.
  - name: Inventory Trees
    description: >-
      Trees within a sample plot used for forest inventory. After harvesting, a
      related harvested tree record should exist. Associated tree logs are
      **simulated**.


      Immediate associations:

      - <u>*belongs to*</u>: Sample Plot <span>

      - <u>*belongs to*</u>: Tree Species 

      - *belongs to*: Harvested Tree

      - *has many*: Tree Logs `[`simulated=true`]`

      - *has many*: Quality Indicator Items `[`qualifiable=harvested_tree`]`
  - name: Harvested Trees
    description: >-
      Trees already harvested and processed. They must belong to a forest
      operation subcompartment. If the given tree was part of a sample plot, a
      related inventory tree record should exist. Associated tree logs are
      non-simulated.


      Immediate associations:

      - <u>*belongs to*</u>: Subcompartment
      `[`subcompartmentable=forest_operation`]`

      - <u>*belongs to*</u>: Tree Species 

      - *has one*: Inventory Tree

      - *has many*: Tree Logs `[`simulated=false`]`

      - *has many*: Quality Indicator Items `[`qualifiable=harvested_tree`]`
  - name: Tree Logs
    description: >-
      A harvested log (related to a harvested tree) or a simulated log (related
      to an inventory tree) not yet harvested.


      Immediate associations:

      - <u>*belongs to*</u>: Tree Processor

      - *belongs_to*: Inventory Tree `(`simulated=true`)`

      - *belongs_to*: Harvested Tree `(`simulated=false`)`

      - *has many*: Tree Log Locations

      - *has one*: Tree Log Sawmill Measurement

      - *has many*: Boards

      - *has many*: Quality Indicator Items `[`qualifiable=tree_log`]`
  - name: Tree Log Locations
    description: >-
      Indicates the location of a tree log at a given moment as recorded by a
      given tree processor.


      Immediate associations:

      - <u>*belongs to*</u>: Tree Log
  - name: Sawmill Companies
    description: |
      Legal entities that manage sawing operations.

      Immediate associations:
      - *has many*: Sawmill Sites
  - name: Sawmill Sites
    description: |
      Industrial facilities focused on sawing operations.

      Immediate associations:
      - <u>*belongs to*</u>: Sawmill Company
      - *has many*: Sawlines
      - *has many*: Sawmill Batches
  - name: Sawlines
    description: >-
      At a sawline, tree logs are processed into lumber through a series of
      cutting and sorting operations.


      Immediate associations:

      - <u>*belongs to*</u>: Sawmill Site
  - name: Sawline Attachments
    description: |-
      Generic attachment files for a sawline.

      Immediate associations:
      - *belongs to*: Sawline
  - name: Sawmill Batches
    description: |-
      Sets of boards produced as a single group on a given sawmill site.

      Immediate associations:
      - <u>*belongs to*</u>: Sawmill Site
      - *has many*: Boards
  - name: Tree Log Sawmill Measurements
    description: |
      Measurements of a given log as part of a sawmill batch.

      Immediate associations:
      - <u>*belongs to*</u>: Tree Log `[`simulated=false`]`
  - name: Board Classes
    description: |
      Specific wood quality classes associated with boards.

      Immediate associations:
      - *has many*: Boards
  - name: Boards
    description: |
      Lumber boards belonging to a specific class and sawmill batch.

      Immediate associations:
      - <u>*belongs to*</u>: Sawmill Batch
      - <u>*belongs to*</u>: Board Class
      - <u>*belongs to*</u>: Tree Log
      - *has many*: Quality Indicator Items `[`qualifiable=board`]`
  - name: Quality Indicators
    description: |-
      Specification of a quality feature for trees, tree logs, or boards.

      Immediate associations:
      - *has many*: Quality Indicator Items
  - name: Quality Indicator Items
    description: >-
      Instance values of a quality indicator for a specific entity item.


      Immediate associations:

      - <u>*belongs to*</u>: Quality Indicator

      - <u>*belongs to*</u>: *qualifiable* `{` Harvested Tree `|` Inventory Tree
      `|` Tree Log  `|` Board `}` 
