openapi: 3.0.0
info:
  title: Coolset Data API
  description: >-
    Data ingestion layer: upload documents, run imports, query the RAG knowledge
    base, and submit financial transaction data.
  version: '1.0'
  contact:
    email: support@coolset.com
    url: https://coolset.com
  x-logo:
    url: https://www.coolset.com/images/coolset-logo.png
    altText: Coolset
    href: https://www.coolset.com/
servers:
  - url: https://developers-pulse.coolset.com/api
    description: Production server
paths:
  /documents:
    get:
      operationId: documents_list
      summary: List documents
      description: >-
        Returns all documents for the authenticated company, including file
        metadata, upload status, and associated entities.


        **Search** (`search`): full-text search across `name` and `description`.


        **Filters**:

        - `name`, `name__icontains`

        - `description__icontains`

        - `source`, `source__in`

        - `content_type`, `content_type__in`

        - `upload_status`

        - `identifiers__identifier`, `identifiers__identifier__in`,
        `identifiers__identifier__contains`

        - `uploaded_at`, `uploaded_at__gte`, `uploaded_at__lte`

        - `created_at`, `created_at__gte`, `created_at__lte`

        - `updated_at`, `updated_at__gte`, `updated_at__lte`


        **Ordering** (`ordering`): `name`, `source`, `content_type`,
        `upload_status`, `created_at`, `updated_at` (prefix with `-` for
        descending). Default: `-created_at`.
      parameters:
        - name: name
          in: query
          description: name
          required: false
          schema:
            type: string
        - name: name__icontains
          in: query
          description: name__icontains
          required: false
          schema:
            type: string
        - name: description__icontains
          in: query
          description: description__icontains
          required: false
          schema:
            type: string
        - name: source
          in: query
          description: source
          required: false
          schema:
            type: string
        - name: source__in
          in: query
          description: source__in
          required: false
          schema:
            type: string
        - name: identifiers__identifier
          in: query
          description: identifiers__identifier
          required: false
          schema:
            type: string
        - name: identifiers__identifier__in
          in: query
          description: identifiers__identifier__in
          required: false
          schema:
            type: string
        - name: identifiers__identifier__contains
          in: query
          description: identifiers__identifier__contains
          required: false
          schema:
            type: string
        - name: content_type
          in: query
          description: content_type
          required: false
          schema:
            type: string
        - name: content_type__in
          in: query
          description: content_type__in
          required: false
          schema:
            type: string
        - name: upload_status
          in: query
          description: upload_status
          required: false
          schema:
            type: string
            enum:
              - pending
              - uploading
              - completed
              - failed
        - name: uploaded_at
          in: query
          description: uploaded_at
          required: false
          schema:
            type: string
        - name: uploaded_at__gte
          in: query
          description: uploaded_at__gte
          required: false
          schema:
            type: string
        - name: uploaded_at__lte
          in: query
          description: uploaded_at__lte
          required: false
          schema:
            type: string
        - name: created_at
          in: query
          description: created_at
          required: false
          schema:
            type: string
        - name: created_at__gte
          in: query
          description: created_at__gte
          required: false
          schema:
            type: string
        - name: created_at__lte
          in: query
          description: created_at__lte
          required: false
          schema:
            type: string
        - name: updated_at
          in: query
          description: updated_at
          required: false
          schema:
            type: string
        - name: updated_at__gte
          in: query
          description: updated_at__gte
          required: false
          schema:
            type: string
        - name: updated_at__lte
          in: query
          description: updated_at__lte
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: A search term.
          required: false
          schema:
            type: string
        - name: ordering
          in: query
          description: Which field to use when ordering the results.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                required:
                  - count
                  - results
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                    nullable: true
                  previous:
                    type: string
                    format: uri
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/DocumentGCP'
      tags:
        - documents
    post:
      operationId: documents_create
      summary: Create a document and get upload URL
      description: >-
        Creates a new document record and returns a signed upload URL. After
        uploading the file to the signed URL, call the confirm_upload endpoint
        to mark the upload as complete.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentUploadRequest'
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentUploadRequest'
      tags:
        - documents
    parameters: []
    servers: &ref_0
      - url: https://developers-pulse.coolset.com/api
        description: Production server
  /documents/{id}:
    get:
      operationId: documents_read
      summary: Retrieve a document
      description: >-
        Returns metadata for a single document by ID (does not include file
        contents).
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentGCP'
      tags:
        - documents
    patch:
      operationId: documents_partial_update
      summary: Update document metadata
      description: Partially update a document's metadata fields (e.g. name, description).
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentUpdate'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentUpdate'
      tags:
        - documents
    delete:
      operationId: documents_delete
      summary: Delete a document
      description: Deletes the document record and its file from storage.
      responses:
        '204':
          description: ''
      tags:
        - documents
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /documents/{id}/confirm_upload:
    post:
      operationId: documents_confirm_upload
      summary: Confirm document upload
      description: >-
        Confirms that the file has been uploaded to the signed URL. Marks the
        document status as completed and triggers downstream processing.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentGCP'
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentGCP'
      tags:
        - documents
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /documents/{id}/download:
    get:
      operationId: documents_download
      summary: Get document download URL
      description: >-
        Generates a time-limited signed URL for downloading the document file.
        Only available for documents with completed uploads.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentGCP'
      tags:
        - documents
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /imports:
    get:
      operationId: imports_list
      summary: List data import runs
      description: >-
        Returns a paginated list of data import runs for the authenticated
        company, ordered by most recent first. Each run includes its status,
        source, and processing results.
      parameters:
        - name: ordering
          in: query
          description: Which field to use when ordering the results.
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: A search term.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                required:
                  - count
                  - results
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                    nullable: true
                  previous:
                    type: string
                    format: uri
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/DataExchangeRun'
      tags:
        - imports
    post:
      operationId: imports_create
      summary: Create a data import run
      description: Initiates a new data import run for bulk data ingestion.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataExchangeRunCreate'
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataExchangeRunCreate'
      tags:
        - imports
    parameters: []
    servers: *ref_0
  /imports/{id}:
    get:
      operationId: imports_read
      summary: Retrieve a data import run
      description: Returns a single data import run by ID with full processing details.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataExchangeRun'
      tags:
        - imports
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
    servers: *ref_0
  /rag/queries:
    post:
      operationId: rag_queries_create
      summary: Execute a RAG query
      description: >-
        Executes a retrieval or generation query against the authenticated
        company's corpus. Accepts query_text, mode (retrieval or generation),
        top_k, vector_distance_threshold, optional file_ids to scope the search
        by Vertex AI file name, and optional document_ids to scope the search by
        Document ID.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RagQueryRequest'
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RagQueryRequest'
      tags:
        - rag
    parameters: []
    servers: *ref_0
  /expenses/transactions:
    get:
      operationId: expenses_transactions_list
      summary: List transactions
      description: >-
        Returns a paginated list of financial transactions for the authenticated
        company. Transactions are the raw financial data that can be classified
        as carbon emissions. Use the 'search' parameter to search across
        vendor_name, ledger, and description. Filter with query parameters:

        - vendor_name: Filter by vendor name (supports exact, icontains,
        istartswith, iendswith, isnull)

        - ledger: Filter by ledger (supports exact, icontains, istartswith,
        iendswith)

        - journal: Filter by journal (supports exact, icontains, istartswith,
        iendswith, isnull)

        - description: Filter by description (supports exact, icontains,
        istartswith, iendswith, isnull)

        - source: Filter by source (exact match)

        - integration_id: Filter by integration ID (exact match)

        - integration__name: Filter by integration name (supports exact,
        icontains, istartswith, iendswith)

        - date: Filter by date (supports exact, gte, lte)

        - net_amount: Filter by net amount (supports exact, gt, lt, gte, lte)

        - tags: Filter by tag IDs (multi-value, conjoined — transaction must
        have ALL specified tags)

        - confidence_status: Filter by emission confidence status

        - classified: true to return only transactions with active emissions,
        false for unclassified transactions only

        Supports ordering by: vendor_name, ledger, description, total_co2_kg,
        date, net_amount. Default ordering: date descending.
      parameters:
        - name: id
          in: query
          description: id
          required: false
          schema:
            type: string
        - name: id__in
          in: query
          description: id__in
          required: false
          schema:
            type: string
        - name: vendor_name
          in: query
          description: vendor_name
          required: false
          schema:
            type: string
        - name: vendor_name__icontains
          in: query
          description: vendor_name__icontains
          required: false
          schema:
            type: string
        - name: vendor_name__istartswith
          in: query
          description: vendor_name__istartswith
          required: false
          schema:
            type: string
        - name: vendor_name__iendswith
          in: query
          description: vendor_name__iendswith
          required: false
          schema:
            type: string
        - name: vendor_name__isnull
          in: query
          description: vendor_name__isnull
          required: false
          schema:
            type: string
        - name: ledger
          in: query
          description: ledger
          required: false
          schema:
            type: string
        - name: ledger__icontains
          in: query
          description: ledger__icontains
          required: false
          schema:
            type: string
        - name: ledger__istartswith
          in: query
          description: ledger__istartswith
          required: false
          schema:
            type: string
        - name: ledger__iendswith
          in: query
          description: ledger__iendswith
          required: false
          schema:
            type: string
        - name: journal
          in: query
          description: journal
          required: false
          schema:
            type: string
        - name: journal__icontains
          in: query
          description: journal__icontains
          required: false
          schema:
            type: string
        - name: journal__istartswith
          in: query
          description: journal__istartswith
          required: false
          schema:
            type: string
        - name: journal__iendswith
          in: query
          description: journal__iendswith
          required: false
          schema:
            type: string
        - name: journal__isnull
          in: query
          description: journal__isnull
          required: false
          schema:
            type: string
        - name: description
          in: query
          description: description
          required: false
          schema:
            type: string
        - name: description__icontains
          in: query
          description: description__icontains
          required: false
          schema:
            type: string
        - name: description__istartswith
          in: query
          description: description__istartswith
          required: false
          schema:
            type: string
        - name: description__iendswith
          in: query
          description: description__iendswith
          required: false
          schema:
            type: string
        - name: description__isnull
          in: query
          description: description__isnull
          required: false
          schema:
            type: string
        - name: source
          in: query
          description: source
          required: false
          schema:
            type: string
            enum:
              - codat
              - chift
              - lune
              - regreener
              - csv
        - name: integration_id
          in: query
          description: integration_id
          required: false
          schema:
            type: string
        - name: integration__name
          in: query
          description: integration__name
          required: false
          schema:
            type: string
        - name: integration__name__icontains
          in: query
          description: integration__name__icontains
          required: false
          schema:
            type: string
        - name: integration__name__istartswith
          in: query
          description: integration__name__istartswith
          required: false
          schema:
            type: string
        - name: integration__name__iendswith
          in: query
          description: integration__name__iendswith
          required: false
          schema:
            type: string
        - name: date
          in: query
          description: date
          required: false
          schema:
            type: string
        - name: date__gte
          in: query
          description: date__gte
          required: false
          schema:
            type: string
        - name: date__lte
          in: query
          description: date__lte
          required: false
          schema:
            type: string
        - name: net_amount
          in: query
          description: net_amount
          required: false
          schema:
            type: string
        - name: net_amount__gt
          in: query
          description: net_amount__gt
          required: false
          schema:
            type: string
        - name: net_amount__lt
          in: query
          description: net_amount__lt
          required: false
          schema:
            type: string
        - name: net_amount__gte
          in: query
          description: net_amount__gte
          required: false
          schema:
            type: string
        - name: net_amount__lte
          in: query
          description: net_amount__lte
          required: false
          schema:
            type: string
        - name: tags
          in: query
          description: tags
          required: false
          schema:
            type: string
        - name: confidence_status
          in: query
          description: confidence_status
          required: false
          schema:
            type: string
            enum:
              - confident
              - needs_attention
        - name: classified
          in: query
          description: classified
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: A search term.
          required: false
          schema:
            type: string
        - name: ordering
          in: query
          description: Which field to use when ordering the results.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                required:
                  - count
                  - results
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                    nullable: true
                  previous:
                    type: string
                    format: uri
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/ETransaction'
      tags:
        - expenses
    parameters: []
    servers: &ref_1
      - url: https://developers.coolset.com/api
        description: Production server
  /expenses/transactions/charts:
    get:
      operationId: expenses_transactions_charts_list
      summary: List aggregated transaction chart data
      description: >-
        Returns transaction rows aggregated by one or more dimensions (ledger,
        vendor_name, journal, source, currency). Pair with
        `delimit_by=yearly|monthly|daily` to also bucket by a truncated `period`
        date. Use this endpoint to discover unique bundles of unclassified
        transactions before driving bulk classification: combine
        `classified=false` with a multi-valued `group_by` and `ordering=-count`
        to process the largest bundles first.
      parameters:
        - name: id
          in: query
          description: id
          required: false
          schema:
            type: string
        - name: id__in
          in: query
          description: id__in
          required: false
          schema:
            type: string
        - name: vendor_name
          in: query
          description: vendor_name
          required: false
          schema:
            type: string
        - name: vendor_name__icontains
          in: query
          description: vendor_name__icontains
          required: false
          schema:
            type: string
        - name: vendor_name__istartswith
          in: query
          description: vendor_name__istartswith
          required: false
          schema:
            type: string
        - name: vendor_name__iendswith
          in: query
          description: vendor_name__iendswith
          required: false
          schema:
            type: string
        - name: vendor_name__isnull
          in: query
          description: vendor_name__isnull
          required: false
          schema:
            type: string
        - name: ledger
          in: query
          description: ledger
          required: false
          schema:
            type: string
        - name: ledger__icontains
          in: query
          description: ledger__icontains
          required: false
          schema:
            type: string
        - name: ledger__istartswith
          in: query
          description: ledger__istartswith
          required: false
          schema:
            type: string
        - name: ledger__iendswith
          in: query
          description: ledger__iendswith
          required: false
          schema:
            type: string
        - name: journal
          in: query
          description: journal
          required: false
          schema:
            type: string
        - name: journal__icontains
          in: query
          description: journal__icontains
          required: false
          schema:
            type: string
        - name: journal__istartswith
          in: query
          description: journal__istartswith
          required: false
          schema:
            type: string
        - name: journal__iendswith
          in: query
          description: journal__iendswith
          required: false
          schema:
            type: string
        - name: journal__isnull
          in: query
          description: journal__isnull
          required: false
          schema:
            type: string
        - name: description
          in: query
          description: description
          required: false
          schema:
            type: string
        - name: description__icontains
          in: query
          description: description__icontains
          required: false
          schema:
            type: string
        - name: description__istartswith
          in: query
          description: description__istartswith
          required: false
          schema:
            type: string
        - name: description__iendswith
          in: query
          description: description__iendswith
          required: false
          schema:
            type: string
        - name: description__isnull
          in: query
          description: description__isnull
          required: false
          schema:
            type: string
        - name: source
          in: query
          description: source
          required: false
          schema:
            type: string
            enum:
              - codat
              - chift
              - lune
              - regreener
              - csv
        - name: integration_id
          in: query
          description: integration_id
          required: false
          schema:
            type: string
        - name: integration__name
          in: query
          description: integration__name
          required: false
          schema:
            type: string
        - name: integration__name__icontains
          in: query
          description: integration__name__icontains
          required: false
          schema:
            type: string
        - name: integration__name__istartswith
          in: query
          description: integration__name__istartswith
          required: false
          schema:
            type: string
        - name: integration__name__iendswith
          in: query
          description: integration__name__iendswith
          required: false
          schema:
            type: string
        - name: date
          in: query
          description: date
          required: false
          schema:
            type: string
        - name: date__gte
          in: query
          description: date__gte
          required: false
          schema:
            type: string
        - name: date__lte
          in: query
          description: date__lte
          required: false
          schema:
            type: string
        - name: net_amount
          in: query
          description: net_amount
          required: false
          schema:
            type: string
        - name: net_amount__gt
          in: query
          description: net_amount__gt
          required: false
          schema:
            type: string
        - name: net_amount__lt
          in: query
          description: net_amount__lt
          required: false
          schema:
            type: string
        - name: net_amount__gte
          in: query
          description: net_amount__gte
          required: false
          schema:
            type: string
        - name: net_amount__lte
          in: query
          description: net_amount__lte
          required: false
          schema:
            type: string
        - name: tags
          in: query
          description: tags
          required: false
          schema:
            type: string
        - name: confidence_status
          in: query
          description: confidence_status
          required: false
          schema:
            type: string
            enum:
              - confident
              - needs_attention
        - name: classified
          in: query
          description: classified
          required: false
          schema:
            type: string
        - name: group_by
          in: query
          description: Fields to group transactions by
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - ledger
                - vendor_name
                - journal
                - source
                - currency
            default:
              - ledger
        - name: delimit_by
          in: query
          description: Truncate transaction date into a period bucket
          schema:
            type: string
            enum:
              - yearly
              - monthly
              - daily
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          schema:
            type: integer
        - name: ordering
          in: query
          description: Field to order by (prefix with '-' for descending)
          schema:
            type: string
            enum:
              - count
              - '-count'
              - total_net_amount
              - '-total_net_amount'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                required:
                  - count
                  - results
                type: object
                properties:
                  count:
                    type: integer
                  next:
                    type: string
                    format: uri
                    nullable: true
                  previous:
                    type: string
                    format: uri
                    nullable: true
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/TransactionChart'
      tags:
        - expenses
    parameters: []
    servers: *ref_1
components:
  schemas:
    PromptSuggestion:
      required:
        - title
        - label
        - prompt
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          type: string
          maxLength: 255
          minLength: 1
        label:
          title: Label
          description: >-
            Short category descriptor shown above the prompt (e.g. 'Find
            valuable insights').
          type: string
          maxLength: 255
          minLength: 1
        prompt:
          title: Prompt
          description: The prompt text sent to the agent.
          type: string
          minLength: 1
        agent_config_name:
          title: Agent config name
          type: string
          readOnly: true
          minLength: 1
        tags:
          type: array
          items:
            type: string
          readOnly: true
    PulseParams:
      required:
        - identifier
        - model_identifier
      type: object
      properties:
        identifier:
          title: Identifier
          type: string
          minLength: 1
        model_identifier:
          title: Model identifier
          type: string
          minLength: 1
    ChatSession:
      required:
        - agent_name
      type: object
      properties:
        session_id:
          title: Session id
          type: string
          format: uuid
          readOnly: true
        agent_name:
          title: Agent name
          type: string
          maxLength: 255
          minLength: 1
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
    ChatSessionCreate:
      required:
        - agent_name
      type: object
      properties:
        session_id:
          title: Session id
          type: string
          format: uuid
          readOnly: true
        agent_name:
          title: Agent name
          type: string
          maxLength: 255
          minLength: 1
    Skill:
      required:
        - name
        - content
      type: object
      properties:
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        content:
          title: Content
          type: string
          minLength: 1
        is_public:
          title: Is public
          type: boolean
    Comment:
      required:
        - message
        - identifier
        - submitted_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        message:
          title: Message
          type: string
          minLength: 1
        identifier:
          title: Identifier
          type: string
          maxLength: 1024
          minLength: 1
        submitted_at:
          title: Submitted at
          type: string
          format: date-time
        return_url:
          title: Return url
          type: string
          format: uri
          maxLength: 200
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        is_edited:
          title: Is edited
          type: string
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
    CommentSearch:
      required:
        - identifiers
      type: object
      properties:
        identifiers:
          type: array
          items:
            type: string
            minLength: 1
    RiskAssessment:
      required:
        - identifier
        - assessment_type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        identifier:
          title: Identifier
          type: string
          maxLength: 1024
          minLength: 1
        display_name:
          title: Display name
          description: Human-readable display name for the assessment
          type: string
          readOnly: true
          minLength: 1
        assessment_type:
          title: Assessment type
          type: string
          enum:
            - eudr_origin_assessment
            - eudr_origin_harvest_assessment
            - eudr_company_maturity_self_assessment
            - eudr_supply_chain_assessment
            - eudr_order_item_assessment
            - eudr_order_assessment
            - eutr_origin_assessment
            - eutr_company_maturity_self_assessment
            - eutr_supply_chain_assessment
            - ppwr_packaging_assessment
            - ppwr_aggregate_packaging_assessment
        assessment_run_id:
          title: Assessment run id
          description: The UUID of the assessment run
          type: string
          format: uuid
        results:
          title: Results
          description: The output of the risk assessment
          type: object
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_date:
          title: Assessment date
          description: When this risk assessment was conducted
          type: string
          format: date-time
          readOnly: true
        analyzed_assessments:
          title: Analyzed assessments
          description: >-
            List of analyzed assessments (assessment runs) that contributed
            evidence to this assessment
          type: object
          readOnly: true
        assessable_objects:
          title: Assessable objects
          description: >-
            Snapshot of assessable object data at assessment creation time,
            keyed by pulse identifier. Same keys as `results`. Empty dict for
            assessments created before this field was added.
          type: object
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        metadata:
          title: Metadata
          description: >-
            Input parameters used to create this assessment (harvest_date,
            commodity, etc.)
          type: object
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    RiskAssessmentCreate:
      required:
        - identifier
        - assessment_type
      type: object
      properties:
        identifier:
          title: Identifier
          description: Pulse identifier of the object to assess
          type: string
          maxLength: 1024
          minLength: 1
        assessment_type:
          title: Assessment type
          description: Type of risk assessment to perform
          type: string
          enum:
            - eudr_origin_assessment
            - eudr_origin_harvest_assessment
            - eudr_company_maturity_self_assessment
            - eudr_supply_chain_assessment
            - eudr_order_item_assessment
            - eudr_order_assessment
            - eutr_origin_assessment
            - eutr_company_maturity_self_assessment
            - eutr_supply_chain_assessment
            - ppwr_packaging_assessment
            - ppwr_aggregate_packaging_assessment
        data_room_survey_submission_context:
          title: Data room survey submission context
          description: Context of the data room to assess
          type: object
        assessment_run_id:
          title: Assessment run id
          description: Assessment run ID
          type: string
          format: uuid
          readOnly: true
        results:
          title: Results
          description: Results of the risk assessment
          type: object
          default: {}
        assessment_date:
          title: Assessment date
          description: Date and time of the risk assessment
          type: string
          format: date-time
          default: '2026-05-01 11:42:06.106836+00:00'
        company_id:
          title: Company id
          description: Company ID
          type: integer
        metadata:
          title: Metadata
          description: Metadata of the risk assessment
          type: object
          default: {}
    Contributor:
      required:
        - type
        - contributor_id
        - identifier
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - assignee
            - reviewer
            - auditor
            - owner
        contributor_id:
          title: Contributor id
          type: integer
          maximum: 2147483647
          minimum: 0
        identifier:
          title: Identifier
          type: string
          maxLength: 1024
          minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        metadata:
          title: Metadata
          type: object
    BulkContributorCreate:
      required:
        - type
        - contributor_ids
        - identifiers
        - handle_existing_contributor_action
      type: object
      properties:
        type:
          title: Type
          type: string
          enum:
            - assignee
            - reviewer
            - auditor
            - owner
        contributor_ids:
          type: array
          items:
            type: integer
        identifiers:
          type: array
          items:
            type: string
            minLength: 1
        handle_existing_contributor_action:
          title: Handle existing contributor action
          type: string
          enum:
            - add
            - do_nothing
            - replace
        metadata:
          title: Metadata
          type: object
    BulkContributorCreateResponse:
      required:
        - created_count
      type: object
      properties:
        created_count:
          title: Created count
          type: integer
    ContributorBulkDelete:
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          type: string
          minLength: 1
        contributor_ids:
          type: array
          items:
            type: integer
        identifiers:
          type: array
          items:
            type: string
            minLength: 1
    ContributorBulkDeleteResponse:
      required:
        - deleted_count
      type: object
      properties:
        deleted_count:
          title: Deleted count
          type: integer
    ContributorSearch:
      type: object
      properties:
        type:
          title: Type
          type: string
          minLength: 1
        contributor_ids:
          type: array
          items:
            type: integer
        identifiers:
          type: array
          items:
            type: string
            minLength: 1
    DocumentIdentifierInline:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        identifier:
          title: Identifier
          type: string
          readOnly: true
          minLength: 1
        user_company_id:
          title: User company id
          type: integer
          readOnly: true
    DocumentGCP:
      required:
        - name
        - source
        - file_path
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 510
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
        source:
          title: Source
          type: string
          maxLength: 20
          minLength: 1
        file_path:
          title: File path
          description: 'GCS path: gs://bucket/path'
          type: string
          maxLength: 1024
          minLength: 1
        file_size:
          title: File size
          description: File size in bytes
          type: integer
          readOnly: true
          nullable: true
        content_type:
          title: Content type
          type: string
          maxLength: 255
          nullable: true
        upload_status:
          title: Upload status
          type: string
          enum:
            - pending
            - uploading
            - completed
            - failed
          readOnly: true
        uploaded_at:
          title: Uploaded at
          type: string
          format: date-time
          readOnly: true
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        user_company_id:
          title: User company id
          type: integer
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        identifiers:
          description: List of identifier strings
          type: array
          items:
            type: string
            minLength: 1
        identifiers_details:
          type: array
          items:
            $ref: '#/components/schemas/DocumentIdentifierInline'
          readOnly: true
    DocumentUploadRequest:
      required:
        - name
        - content_type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 510
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
        content_type:
          title: Content type
          description: Content type used to derive file extension
          type: string
          enum:
            - application/pdf
            - application/msword
            - >-
              application/vnd.openxmlformats-officedocument.wordprocessingml.document
            - application/vnd.ms-excel
            - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
            - application/vnd.ms-powerpoint
            - >-
              application/vnd.openxmlformats-officedocument.presentationml.presentation
            - image/jpeg
            - image/png
            - image/gif
            - image/webp
            - text/plain
            - text/csv
            - application/rtf
            - application/vnd.oasis.opendocument.text
            - application/vnd.oasis.opendocument.spreadsheet
            - application/vnd.oasis.opendocument.presentation
        source:
          title: Source
          type: string
          readOnly: true
          minLength: 1
        company_id:
          title: Company id
          type: integer
          readOnly: true
        user_company_id:
          title: User company id
          type: integer
          readOnly: true
        identifiers:
          description: List of identifier strings
          type: array
          items:
            type: string
            minLength: 1
    DocumentIdentifier:
      required:
        - identifier
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        identifier:
          title: Identifier
          type: string
          maxLength: 1024
          minLength: 1
        document:
          title: Document
          type: integer
          readOnly: true
    DocumentUpdate:
      required:
        - name
      type: object
      properties:
        name:
          title: Name
          type: string
          maxLength: 510
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
    RuleExecutionLog:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        rule:
          title: Rule
          description: The rule that was evaluated
          type: integer
          readOnly: true
        rule_name:
          title: Rule name
          type: string
          readOnly: true
          minLength: 1
        event_type:
          title: Event type
          description: Event topic that triggered evaluation
          type: string
          readOnly: true
          minLength: 1
        event_data:
          title: Event data
          description: Full event payload (optional, for debugging)
          type: object
          readOnly: true
          nullable: true
        conditions_met:
          title: Conditions met
          description: Whether the rule's conditions passed
          type: boolean
          readOnly: true
        actions_executed:
          title: Actions executed
          description: List of action execution results with status
          type: object
          readOnly: true
        success:
          title: Success
          description: Whether all actions published successfully
          type: boolean
          readOnly: true
        error_message:
          title: Error message
          description: Error details if something failed
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        execution_time_ms:
          title: Execution time ms
          description: How long the evaluation took in milliseconds
          type: integer
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
    DataExchangeRun:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        run_id:
          title: Run id
          description: Unique identifier for this data exchange run
          type: string
          format: uuid
          readOnly: true
        company_id:
          title: Company id
          description: ID of the company this data exchange run belongs to
          type: integer
          readOnly: true
        results:
          title: Results
          description: The output of the data exchange run
          type: object
        document:
          title: Document
          type: integer
          nullable: true
        model_identifier:
          title: Model identifier
          type: string
          readOnly: true
          minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    DataExchangeRunCreate:
      required:
        - results
        - document_id
        - model_identifier
      type: object
      properties:
        results:
          title: Results
          description: Results of the data exchange run
          type: object
        document_id:
          title: Document id
          description: Associated document ID
          type: integer
        model_identifier:
          title: Model identifier
          description: Associated model identifier
          type: string
          minLength: 1
        dry_run:
          title: Dry run
          description: Whether to run the data exchange run in dry run mode
          type: boolean
          default: true
        id:
          title: Id
          type: integer
          readOnly: true
        run_id:
          title: Run id
          type: string
          format: uuid
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    RagDocument:
      required:
        - display_name
        - file_type
        - gcs_uri
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        corpus:
          title: Corpus
          type: integer
          readOnly: true
        corpus_name:
          title: Corpus name
          type: string
          readOnly: true
          minLength: 1
        company_id:
          title: Company id
          description: Company this document belongs to
          type: integer
          readOnly: true
        display_name:
          title: Display name
          description: Human-readable document name
          type: string
          maxLength: 255
          minLength: 1
        source_uri:
          title: Source uri
          description: 'GCS URI: gs://bucket/path/file.pdf'
          type: string
          readOnly: true
          minLength: 1
        file_type:
          title: File type
          description: File extension (pdf, docx, txt, etc.)
          type: string
          maxLength: 50
          minLength: 1
        file_size:
          title: File size
          description: File size in bytes
          type: integer
          maximum: 9223372036854776000
          minimum: 0
          nullable: true
        status:
          title: Status
          description: Current import status
          type: string
          enum:
            - importing
            - active
            - failed
            - deleting
            - deleted
          readOnly: true
        chunk_size:
          title: Chunk size
          description: Chunk size used for document splitting
          type: integer
          maximum: 2147483647
          minimum: 0
        chunk_overlap:
          title: Chunk overlap
          description: Overlap between chunks
          type: integer
          maximum: 2147483647
          minimum: 0
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        document_id:
          title: Document id
          description: Optional ID of Document from documents app
          type: integer
          nullable: true
        gcs_uri:
          title: Gcs uri
          description: 'GCS URI: gs://bucket/path/file.pdf'
          type: string
          maxLength: 1024
          minLength: 1
    RagQueryRequest:
      required:
        - query_text
      type: object
      properties:
        query_text:
          title: Query text
          description: Natural language query
          type: string
          maxLength: 5000
          minLength: 1
        mode:
          title: Mode
          description: 'Query mode: retrieval_only or generation'
          type: string
          enum:
            - retrieval
            - generation
          default: retrieval
        top_k:
          title: Top k
          description: Number of chunks to retrieve
          type: integer
          default: 10
          maximum: 50
          minimum: 1
        vector_distance_threshold:
          title: Vector distance threshold
          description: Similarity threshold (0-1)
          type: number
          maximum: 1
          minimum: 0
          nullable: true
        file_ids:
          description: Optional list of Vertex AI file names to filter search
          type: array
          items:
            type: string
            minLength: 1
          nullable: true
        document_ids:
          description: >-
            Optional list of Document IDs to scope the search to specific
            documents
          type: array
          items:
            type: integer
          nullable: true
        model_name:
          title: Model name
          description: Gemini model to use for generation mode
          type: string
          default: gemini-2.5-flash
          minLength: 1
    RoutedDocument:
      required:
        - name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 510
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
        file:
          title: File
          type: string
          readOnly: true
          format: uri
        identifiers:
          description: List of identifier strings
          type: array
          items:
            type: string
            minLength: 1
        source:
          title: Source
          type: string
          readOnly: true
          minLength: 1
        file_path:
          title: File path
          description: 'GCS path: gs://bucket/path'
          type: string
          readOnly: true
          minLength: 1
        file_size:
          title: File size
          description: File size in bytes
          type: integer
          readOnly: true
          nullable: true
        content_type:
          title: Content type
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        upload_status:
          title: Upload status
          type: string
          enum:
            - pending
            - uploading
            - completed
            - failed
          readOnly: true
        uploaded_at:
          title: Uploaded at
          type: string
          format: date-time
          readOnly: true
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        user_company_id:
          title: User company id
          type: integer
          readOnly: true
    RuleList:
      required:
        - name
        - event_type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          description: Human-readable name for the rule
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Detailed description of the rule
          type: string
        event_type:
          title: Event type
          description: Event topic this rule listens to
          type: string
          maxLength: 255
          minLength: 1
        rule_type:
          title: Rule type
          description: GLOBAL (admin only) or COMPANY (customer rules)
          type: string
          enum:
            - GLOBAL
            - COMPANY
        is_active:
          title: Is active
          description: Whether the rule is currently active
          type: boolean
        test_mode:
          title: Test mode
          description: If True, evaluate conditions but don't execute actions (for testing)
          type: boolean
        priority:
          title: Priority
          description: Execution priority (lower number = higher priority)
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        company_id:
          title: Company id
          description: For COMPANY rules, which company this applies to (null for GLOBAL)
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        conditions_count:
          title: Conditions count
          type: string
          readOnly: true
        actions_count:
          title: Actions count
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    RuleCondition:
      required:
        - field_path
        - operator
        - value
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        field_path:
          title: Field path
          description: Dotted path to field (e.g., "order.seller_company.country")
          type: string
          maxLength: 255
          minLength: 1
        operator:
          title: Operator
          description: Comparison operator to use
          type: string
          enum:
            - equals
            - not_equals
            - gt
            - lt
            - gte
            - lte
            - contains
            - in_list
            - not_in
            - changed
            - changed_from
            - changed_to
            - changed_from_to
        value:
          title: Value
          description: Value to compare against (flexible JSON type)
          type: object
        condition_group:
          title: Condition group
          description: Group number for logical grouping (groups are joined by OR)
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        logical_operator:
          title: Logical operator
          description: How to combine with other conditions in same group
          type: string
          enum:
            - AND
            - OR
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    RuleAction:
      required:
        - action_type
        - target_object_path
        - field_mappings
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        action_type:
          title: Action type
          description: Name of the action (from action registry)
          type: string
          maxLength: 255
          minLength: 1
        target_object_path:
          title: Target object path
          description: Which object from event to operate on (e.g., "order.seller_company")
          type: string
          maxLength: 255
          minLength: 1
        field_mappings:
          title: Field mappings
          description: >-
            How to map event data to action payload (supports {{field.path}}
            templates)
          type: object
        execution_order:
          title: Execution order
          description: Order to execute multiple actions (lower = earlier)
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    Rule:
      required:
        - name
        - event_type
        - actions
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          description: Human-readable name for the rule
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Detailed description of the rule
          type: string
        event_type:
          title: Event type
          description: Event topic this rule listens to
          type: string
          maxLength: 255
          minLength: 1
        rule_type:
          title: Rule type
          description: GLOBAL (admin only) or COMPANY (customer rules)
          type: string
          enum:
            - GLOBAL
            - COMPANY
        is_active:
          title: Is active
          description: Whether the rule is currently active
          type: boolean
        test_mode:
          title: Test mode
          description: If True, evaluate conditions but don't execute actions (for testing)
          type: boolean
        priority:
          title: Priority
          description: Execution priority (lower number = higher priority)
          type: integer
          maximum: 2147483647
          minimum: -2147483648
        company_id:
          title: Company id
          description: For COMPANY rules, which company this applies to (null for GLOBAL)
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        created_by:
          title: Created by
          description: User who created the rule
          type: string
          maxLength: 255
        updated_by:
          title: Updated by
          description: User who last updated the rule
          type: string
          maxLength: 255
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/RuleCondition'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/RuleAction'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    Task:
      required:
        - string_id
        - type
        - requirement_string_id
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        string_id:
          title: String id
          description: >-
            Unique slugified identifier for this task (e.g.
            eudr-product-survey). Used by rules to reference which requirement
            to add or remove.
          type: string
          maxLength: 255
          minLength: 1
        type:
          title: Type
          description: The kind of requirement this task represents.
          type: string
          enum:
            - survey
            - assessment
        requirement_string_id:
          title: Requirement string id
          description: >-
            Identifier of the corresponding external requirement — a data room
            survey slug or a risk assessment type slug.
          type: string
          maxLength: 255
          minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    TaskInstance:
      required:
        - task_string_id
        - taskable_identifier
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        task:
          $ref: '#/components/schemas/Task'
        task_string_id:
          title: Task string id
          type: string
        taskable_identifier:
          title: Taskable identifier
          description: >-
            Pulse identifier of the object this requirement is attached to (e.g.
            scranton$Product$42). Uses the Pulsify identifier format.
          type: string
          maxLength: 255
          minLength: 1
        requirement_instance_identifier:
          title: Requirement instance identifier
          description: >-
            Pulse identifier of the concrete external instance — e.g.
            data_room$SurveySubmission$<pk> or compliance$RiskAssessment$<pk>.
            Written when the producer creates the submission or assessment run,
            used to match subsequent result events back to this instance.
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        result:
          title: Result
          description: >-
            Free-form JSON holding the outcome of this requirement. Shape
            depends on the Task type — e.g. assessment risk scores, survey
            submission state. Written by the producing service.
          type: object
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    DueDiligenceStatement:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          description: Type of Due Diligence Statement (EUDR, EUTR)
          type: string
          enum:
            - EUDR
            - EUTR
        dds_identifier:
          title: Dds identifier
          type: string
        dds_data:
          title: Dds data
          type: object
          readOnly: true
        orders:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    HSCode:
      type: object
      properties:
        hscode:
          title: Hscode
          type: string
          readOnly: true
          minLength: 1
        description:
          title: Description
          type: string
          readOnly: true
          minLength: 1
        section:
          title: Section
          type: object
          readOnly: true
          nullable: true
        parent:
          title: Parent
          type: string
          readOnly: true
          minLength: 1
        level:
          title: Level
          type: string
          readOnly: true
          minLength: 1
        is_chapter:
          title: Is chapter
          type: boolean
          readOnly: true
        is_heading:
          title: Is heading
          type: boolean
          readOnly: true
        is_subheading:
          title: Is subheading
          type: boolean
          readOnly: true
        standards:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        commodity:
          title: Commodity
          type: string
          readOnly: true
          minLength: 1
    HSSection:
      type: object
      properties:
        section:
          title: Section
          type: string
          readOnly: true
          minLength: 1
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        display_name:
          title: Display name
          type: string
          readOnly: true
          minLength: 1
    InformationRequest:
      type: object
      properties:
        order_id:
          title: Order id
          type: integer
        value_chain_id:
          title: Value chain id
          type: integer
        invitation_action:
          title: Invitation action
          type: string
          readOnly: true
          minLength: 1
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        type:
          title: Type
          type: string
          readOnly: true
          minLength: 1
        city:
          title: City
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        country:
          title: Country
          type: string
          readOnly: true
          minLength: 1
        primary_contact_id:
          title: Primary contact id
          type: integer
          readOnly: true
        primary_contact_email:
          title: Primary contact email
          type: string
          format: email
          readOnly: true
          minLength: 1
    InformationRequestItem:
      type: object
      properties:
        order_id:
          title: Order id
          type: integer
        value_chain_id:
          title: Value chain id
          type: integer
    InformationRequestBulk:
      required:
        - information_requests
      type: object
      properties:
        information_requests:
          description: List of information requests to create
          type: array
          items:
            $ref: '#/components/schemas/InformationRequestItem'
          maxItems: 100
          minItems: 1
    Country:
      type: object
      properties:
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        alpha_2:
          title: Alpha 2
          type: string
          readOnly: true
          minLength: 1
        alpha_3:
          title: Alpha 3
          type: string
          readOnly: true
          minLength: 1
        numeric:
          title: Numeric
          type: string
          readOnly: true
          minLength: 1
        official_name:
          title: Official name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        flag:
          title: Flag
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        eu_status:
          title: Eu status
          type: string
          readOnly: true
          minLength: 1
          nullable: true
    OwnershipPeriod:
      required:
        - valid_from_month
      type: object
      properties:
        valid_from_month:
          title: Valid from month
          type: string
          pattern: ^\d{4}-(0[1-9]|1[0-2])$
          minLength: 1
        valid_to_month:
          title: Valid to month
          type: string
          pattern: ^\d{4}-(0[1-9]|1[0-2])$
          minLength: 1
          nullable: true
        consolidation_approach:
          title: Consolidation approach
          type: string
          enum:
            - equity_share
            - operational_control
            - financial_control
          nullable: true
        ownership_percentage:
          title: Ownership percentage
          type: string
          format: decimal
          default: '100'
    OwnershipInformation:
      required:
        - ownership_periods
      type: object
      properties:
        ownership_periods:
          type: array
          items:
            $ref: '#/components/schemas/OwnershipPeriod'
        sector_code:
          title: Sector code
          type: string
          maxLength: 32
          nullable: true
        notes:
          title: Notes
          type: string
          nullable: true
      nullable: true
    ValueChain:
      required:
        - company_name
        - type
        - country_code
        - contact_name
        - contact_email
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_name:
          title: Company name
          type: string
          maxLength: 255
          minLength: 1
        type:
          title: Type
          type: string
          enum:
            - supplier
            - customer
            - investment
            - investor
            - franchise
            - franchisor
            - group_member
            - group_parent
        description:
          title: Description
          type: string
          nullable: true
        status:
          title: Status
          type: string
          enum:
            - revoked
            - not_invited_yet
            - invitation_sent
            - connected
        country_code:
          title: Country code
          type: string
          maxLength: 2
          minLength: 1
        country:
          $ref: '#/components/schemas/Country'
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        permission_granted:
          title: Permission granted
          type: boolean
        is_self_managed:
          title: Is self managed
          type: boolean
        contact_name:
          title: Contact name
          type: string
          maxLength: 255
          minLength: 1
        contact_email:
          title: Contact email
          type: string
          format: email
          maxLength: 254
          minLength: 1
        send_information_request:
          title: Send information request
          type: boolean
          default: false
        invitation_id:
          title: Invitation id
          type: string
          format: uuid
          nullable: true
        reciprocal_company_id:
          title: Reciprocal company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        has_account:
          title: Has account
          type: string
          readOnly: true
        is_invited:
          title: Is invited
          type: string
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        ownership_information:
          $ref: '#/components/schemas/OwnershipInformation'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
    CoolsetCompany:
      type: object
      properties:
        id:
          title: Id
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        slug:
          title: Slug
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        type:
          title: Type
          type: string
          readOnly: true
          minLength: 1
        city:
          title: City
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        country:
          title: Country
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        nr_of_employees:
          title: Nr of employees
          type: integer
          readOnly: true
          nullable: true
        nr_of_locations:
          title: Nr of locations
          type: integer
          readOnly: true
          nullable: true
        default_currency:
          title: Default currency
          type: string
          readOnly: true
          minLength: 1
        default_locale:
          title: Default locale
          type: string
          readOnly: true
          minLength: 1
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    ProductList:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        sku:
          title: Sku
          type: string
          readOnly: true
          minLength: 1
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        description:
          title: Description
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        scientific_name:
          title: Scientific name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        common_name:
          title: Common name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        type:
          title: Type
          type: string
          enum:
            - manufactured
            - produced
            - purchased
          readOnly: true
        hs_code:
          title: Hs code
          type: string
          readOnly: true
          minLength: 1
        commodity:
          title: Commodity
          type: string
          enum:
            - cattle
            - cocoa
            - coffee
            - palm_oil
            - rubber
            - soya
            - wood
          readOnly: true
        composition:
          title: Composition
          type: string
          enum:
            - simple
            - composite
          readOnly: true
        external_id:
          title: External id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        is_packaging:
          title: Is packaging
          type: boolean
          readOnly: true
        volume:
          title: Volume
          type: number
          readOnly: true
          nullable: true
        unit:
          title: Unit
          type: string
          enum:
            - mg
            - g
            - kg
            - tonne
            - ml
            - cl
            - l
            - oz
            - lb
          readOnly: true
          nullable: true
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    TracePayload:
      type: object
      properties:
        traced_orders:
          type: array
          items:
            type: integer
        traced_origins:
          type: array
          items:
            type: integer
    NestedOrderItem:
      required:
        - volume
        - unit
      type: object
      properties:
        id:
          title: Id
          type: integer
        order:
          title: Order
          type: integer
          readOnly: true
        buyer_product:
          title: Buyer product
          type: integer
          nullable: true
        buyer_product_detail:
          $ref: '#/components/schemas/ProductList'
        seller_product:
          title: Seller product
          type: integer
          nullable: true
        seller_product_detail:
          $ref: '#/components/schemas/ProductList'
        volume:
          title: Volume
          type: number
        unit:
          title: Unit
          type: string
          maxLength: 3
          minLength: 1
        line_number:
          title: Line number
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        trace:
          $ref: '#/components/schemas/TracePayload'
        is_complete_match:
          title: Is complete match
          type: string
          readOnly: true
        traced_order_count:
          title: Traced order count
          type: string
          readOnly: true
        traced_origin_count:
          title: Traced origin count
          type: string
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
    DueDiligenceStatementNested:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_id:
          title: Company id
          type: integer
          readOnly: true
        type:
          title: Type
          description: Type of Due Diligence Statement (EUDR, EUTR)
          type: string
          enum:
            - EUDR
            - EUTR
          readOnly: true
        dds_data:
          title: Dds data
          type: object
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    Order:
      required:
        - company_id
        - type
        - external_id
        - order_created_at
        - tags
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_id:
          title: Company id
          type: integer
          maximum: 2147483647
          minimum: 0
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        external_id:
          title: External id
          type: string
          maxLength: 255
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        value_chain_detail:
          $ref: '#/components/schemas/ValueChain'
        buyer_company_id:
          title: Buyer company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        seller_company_id:
          title: Seller company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedOrderItem'
          readOnly: true
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            $ref: '#/components/schemas/DueDiligenceStatementNested'
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        border_cross_country:
          $ref: '#/components/schemas/Country'
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    BatchOrder:
      required:
        - type
        - external_id
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        external_id:
          title: External id
          type: string
          maxLength: 255
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        value_chain:
          title: Value chain
          type: integer
          readOnly: true
          nullable: true
        seller_company_id:
          title: Seller company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedOrderItem'
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    NestedProductChain:
      description: Customer's order where I'm the seller (null if top of chain)
      required:
        - company_id
        - type
        - external_id
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_id:
          title: Company id
          type: integer
          maximum: 2147483647
          minimum: 0
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        external_id:
          title: External id
          type: string
          maxLength: 255
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
        assessment_summary:
          title: Assessment summary
          type: object
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        value_chain_detail:
          $ref: '#/components/schemas/ValueChain'
        buyer_company_id:
          title: Buyer company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        seller_company_id:
          title: Seller company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedOrderItem'
          readOnly: true
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
      nullable: true
    ProductChainList:
      type: object
      properties:
        product_chain_status:
          title: Product chain status
          description: >-
            Computed status: 'untraced' if no upstream, otherwise upstream's
            buyer_company_status
          type: string
          enum:
            - untraced
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
          readOnly: true
        downstream_product_chain:
          $ref: '#/components/schemas/NestedProductChain'
        upstream_product_chain:
          $ref: '#/components/schemas/NestedProductChain'
    NestedProductChainOrderItem:
      type: object
      properties:
        id:
          title: Id
          type: integer
        order:
          title: Order
          type: integer
          readOnly: true
        buyer_product:
          title: Buyer product
          type: integer
          nullable: true
        buyer_product_detail:
          $ref: '#/components/schemas/ProductList'
        seller_product_detail:
          $ref: '#/components/schemas/ProductList'
        line_number:
          title: Line number
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        trace:
          $ref: '#/components/schemas/TracePayload'
        traced_order_count:
          title: Traced order count
          type: string
          readOnly: true
        traced_origin_count:
          title: Traced origin count
          type: string
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
    ProductChainOrder:
      required:
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
          readOnly: true
        external_id:
          title: External id
          type: string
          readOnly: true
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        value_chain_detail:
          $ref: '#/components/schemas/ValueChain'
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedProductChainOrderItem'
        send_information_request:
          title: Send information request
          type: boolean
          default: false
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    ProductChainStatistics:
      required:
        - order_count
      type: object
      properties:
        order_count:
          title: Order count
          type: integer
        date:
          title: Date
          type: string
          format: date
        product_chain_status:
          title: Product chain status
          type: string
          minLength: 1
        assessment_status:
          title: Assessment status
          type: string
          minLength: 1
    PurchaseOrder:
      required:
        - type
        - external_id
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        external_id:
          title: External id
          type: string
          maxLength: 255
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        value_chain_detail:
          $ref: '#/components/schemas/ValueChain'
        seller_company_id:
          title: Seller company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedOrderItem'
        send_information_request:
          title: Send information request
          type: boolean
          default: false
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        border_cross_country:
          $ref: '#/components/schemas/Country'
        dds_identifiers:
          type: array
          items:
            type: string
            minLength: 1
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    SaleOrder:
      required:
        - type
        - external_id
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        external_id:
          title: External id
          type: string
          maxLength: 255
          minLength: 1
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
          readOnly: true
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        value_chain_detail:
          $ref: '#/components/schemas/ValueChain'
        buyer_company_id:
          title: Buyer company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NestedOrderItem'
        send_information_request:
          title: Send information request
          type: boolean
          default: false
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          nullable: true
        due_diligence_statements:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        dds_identifiers:
          type: array
          items:
            type: string
            minLength: 1
        border_cross_country_code:
          title: Border cross country code
          description: Country code of the border crossing country
          type: string
          maxLength: 2
          nullable: true
        border_cross_country:
          $ref: '#/components/schemas/Country'
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        tags:
          type: array
          items:
            type: string
            minLength: 1
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    OrderStatistics:
      required:
        - order_count
      type: object
      properties:
        order_count:
          title: Order count
          type: integer
        date:
          title: Date
          type: string
          format: date
        type:
          title: Type
          type: string
          minLength: 1
        buyer_company_status:
          title: Buyer company status
          type: string
          minLength: 1
        seller_company_status:
          title: Seller company status
          type: string
          minLength: 1
        assessment_status:
          title: Assessment status
          type: string
          minLength: 1
    OrderList:
      required:
        - type
        - order_created_at
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - order
            - produced_batch
            - manufactured_batch
            - product_chain
        buyer_external_id:
          title: Buyer external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        seller_external_id:
          title: Seller external id
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        order_created_at:
          title: Order created at
          type: string
          format: date
        order_arrival_at:
          title: Order arrival at
          type: string
          format: date
          nullable: true
        buyer_company_status:
          title: Buyer company status
          type: string
          enum:
            - draft
            - waiting_for_supplier
            - ready_for_review
            - statement_ready
            - completed
            - closed
        seller_company_status:
          title: Seller company status
          type: string
          enum:
            - draft
            - untraced
            - pending
            - passing
            - failing
            - completed
            - closed
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        value_chain:
          title: Value chain
          type: integer
          nullable: true
        buyer_company_id:
          title: Buyer company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        seller_company_id:
          title: Seller company id
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        company:
          $ref: '#/components/schemas/CoolsetCompany'
        buyer_company:
          $ref: '#/components/schemas/CoolsetCompany'
        seller_company:
          $ref: '#/components/schemas/CoolsetCompany'
        signed_off_at:
          title: Signed off at
          type: string
          format: date-time
          readOnly: true
          nullable: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    Origin:
      required:
        - name
        - country_code
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
        country_code:
          title: Country code
          type: string
          maxLength: 2
          minLength: 1
        country:
          $ref: '#/components/schemas/Country'
        location:
          title: Location
          type: object
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        open_atlas_external_id:
          title: Open atlas external id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        open_atlas_information:
          title: Open atlas information
          type: object
          readOnly: true
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
    RelatedOrderItem:
      required:
        - volume
        - unit
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        order:
          title: Order
          type: integer
          readOnly: true
        buyer_product:
          title: Buyer product
          type: integer
          nullable: true
        buyer_product_detail:
          $ref: '#/components/schemas/ProductList'
        seller_product:
          title: Seller product
          type: integer
          nullable: true
        seller_product_detail:
          $ref: '#/components/schemas/ProductList'
        volume:
          title: Volume
          type: number
        unit:
          title: Unit
          type: string
          maxLength: 3
          minLength: 1
        line_number:
          title: Line number
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        traced_orders_detail:
          type: array
          items:
            $ref: '#/components/schemas/OrderList'
          readOnly: true
        traced_origins_detail:
          type: array
          items:
            $ref: '#/components/schemas/Origin'
          readOnly: true
        is_complete_match:
          title: Is complete match
          type: string
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
    ProductComponent:
      required:
        - product
        - component_product
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        product:
          title: Product
          type: integer
        component_product:
          title: Component product
          type: integer
        component_product_detail:
          $ref: '#/components/schemas/ProductList'
        quantity:
          title: Quantity
          type: integer
          maximum: 2147483647
          minimum: 0
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        deleted_at:
          title: Deleted at
          type: string
          format: date-time
          nullable: true
    Product:
      required:
        - sku
        - name
        - type
        - hs_code
        - commodity
        - composition
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        sku:
          title: Sku
          type: string
          maxLength: 100
          minLength: 1
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          type: string
          nullable: true
        scientific_name:
          title: Scientific name
          type: string
          maxLength: 255
          nullable: true
        common_name:
          title: Common name
          type: string
          maxLength: 255
          nullable: true
        type:
          title: Type
          type: string
          enum:
            - manufactured
            - produced
            - purchased
        hs_code:
          title: Hs code
          type: string
          maxLength: 255
          minLength: 1
        commodity:
          title: Commodity
          type: string
          enum:
            - cattle
            - cocoa
            - coffee
            - palm_oil
            - rubber
            - soya
            - wood
        composition:
          title: Composition
          type: string
          enum:
            - simple
            - composite
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        is_packaging:
          title: Is packaging
          type: boolean
        volume:
          title: Volume
          type: number
          nullable: true
        unit:
          title: Unit
          type: string
          enum:
            - mg
            - g
            - kg
            - tonne
            - ml
            - cl
            - l
            - oz
            - lb
          nullable: true
        product_components:
          description: A list of product IDs to set as components.
          type: array
          items:
            description: A list of product IDs to set as components.
            type: integer
          uniqueItems: true
        product_components_detail:
          type: array
          items:
            $ref: '#/components/schemas/ProductComponent'
          readOnly: true
        tags:
          type: array
          items:
            type: string
            minLength: 1
        pulse_params:
          $ref: '#/components/schemas/PulseParams'
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    TraceList:
      required:
        - order
        - volume
        - unit
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        order:
          title: Order
          type: integer
        order_detail:
          $ref: '#/components/schemas/OrderList'
        buyer_product:
          title: Buyer product
          type: integer
          nullable: true
        buyer_product_detail:
          $ref: '#/components/schemas/ProductList'
        seller_product:
          title: Seller product
          type: integer
          nullable: true
        seller_product_detail:
          $ref: '#/components/schemas/ProductList'
        volume:
          title: Volume
          type: number
        unit:
          title: Unit
          type: string
          maxLength: 3
          minLength: 1
        line_number:
          title: Line number
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        traced_orders_detail:
          type: array
          items:
            $ref: '#/components/schemas/OrderList'
          readOnly: true
        traced_origins_detail:
          type: array
          items:
            $ref: '#/components/schemas/Origin'
          readOnly: true
        is_complete_match:
          title: Is complete match
          type: string
          readOnly: true
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        assessment_summary:
          title: Assessment summary
          type: object
          readOnly: true
        assessment_status:
          title: Assessment status
          type: string
          enum:
            - pending
            - passing
            - failing
            - mitigated
          readOnly: true
    APIKey:
      required:
        - name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          description: Descriptive name for this API key (e.g., 'Production Server')
          type: string
          maxLength: 255
          minLength: 1
        prefix:
          title: Prefix
          description: First 8 characters of key for identification
          type: string
          readOnly: true
          minLength: 1
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        last_used_at:
          title: Last used at
          type: string
          format: date-time
          readOnly: true
          nullable: true
        expires_at:
          title: Expires at
          description: Optional expiration date
          type: string
          format: date-time
          nullable: true
        is_active:
          title: Is active
          type: boolean
        scopes:
          title: Scopes
          description: List of permission scopes (e.g., ['read:data', 'write:data'])
          type: object
          default: []
        ip_whitelist:
          title: Ip whitelist
          description: Optional list of allowed IP addresses
          type: object
          default: []
        scope:
          title: Scope
          type: string
          enum:
            - workspace
            - user
          default: user
        company_id:
          title: Company id
          type: integer
          readOnly: true
        company_name:
          title: Company name
          type: string
          readOnly: true
        user_email:
          title: User email
          type: string
          readOnly: true
    BasicAuthRegistration:
      required:
        - email
        - password
        - first_name
        - last_name
        - user_invitation_id
      type: object
      properties:
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          nullable: true
        password:
          title: Password
          description: >-
            Minimum 10 characters. Consider using a passphrase (e.g. a short
            memorable sentence). Must not be similar to your personal
            information, must not be a commonly used password, and must not be
            entirely numeric.
          type: string
          minLength: 1
        first_name:
          title: First name
          type: string
          maxLength: 1024
          minLength: 1
        last_name:
          title: Last name
          type: string
          maxLength: 1024
          minLength: 1
        job_title:
          title: Job title
          type: string
          maxLength: 1024
          nullable: true
        user_invitation_id:
          title: User invitation id
          description: UUID of the user invitation
          type: string
          maxLength: 1024
          minLength: 1
    UserAuthInfo:
      type: object
      properties:
        id:
          title: Id
          type: integer
          readOnly: true
        email:
          title: Email
          type: string
          format: email
          readOnly: true
          minLength: 1
        first_name:
          title: First name
          type: string
          readOnly: true
          minLength: 1
        last_name:
          title: Last name
          type: string
          readOnly: true
          minLength: 1
        auth_type:
          title: Auth type
          type: string
          readOnly: true
          minLength: 1
    BasicAuthChangePassword:
      required:
        - old_password
        - new_password
      type: object
      properties:
        old_password:
          title: Old password
          type: string
          minLength: 1
        new_password:
          title: New password
          description: >-
            Minimum 10 characters. Consider using a passphrase (e.g. a short
            memorable sentence). Must not be similar to your personal
            information, must not be a commonly used password, and must not be
            entirely numeric.
          type: string
          minLength: 1
    BasicAuthConfirmResetPassword:
      required:
        - uid
        - token
        - new_password
      type: object
      properties:
        uid:
          title: Uid
          type: string
          minLength: 1
        token:
          title: Token
          type: string
          minLength: 1
        new_password:
          title: New password
          description: >-
            Minimum 10 characters. Consider using a passphrase (e.g. a short
            memorable sentence). Must not be similar to your personal
            information, must not be a commonly used password, and must not be
            entirely numeric.
          type: string
          minLength: 1
    BasicAuthLogin:
      required:
        - email
        - password
      type: object
      properties:
        email:
          title: Email
          type: string
          format: email
          minLength: 1
        password:
          title: Password
          type: string
          minLength: 1
        user_invitation_id:
          title: User invitation id
          description: 'Optional: UUID of user invitation to accept during login'
          type: string
          maxLength: 1024
    UserConfigResponse:
      required:
        - config
        - available_actions
        - company_type
      type: object
      properties:
        config:
          title: Config
          description: Current user configuration
          type: object
        available_actions:
          description: List of actions available to the user based on their current state
          type: array
          items:
            type: string
            minLength: 1
        company_type:
          title: Company type
          description: Type of company the user belongs to
          type: string
          minLength: 1
    UserConfigUpdate:
      type: object
      properties:
        sign_stakeholder_agreement:
          title: Sign stakeholder agreement
          description: Set to true to sign the stakeholder agreement
          type: boolean
    SimpleUserCompany:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        user_id:
          title: User id
          type: string
          readOnly: true
        company_id:
          title: Company id
          type: string
          readOnly: true
        auth_group_id:
          title: Auth group id
          type: string
          readOnly: true
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          maxLength: 1024
          nullable: true
        config:
          title: Config
          type: object
      nullable: true
    CompanyFlag:
      type: object
      properties:
        name:
          title: Name
          description: The human/computer readable name.
          type: string
          readOnly: true
          minLength: 1
    LegacyOptionalCompany:
      required:
        - name
        - country
        - default_currency
        - default_locale
        - flags
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 1024
          minLength: 1
        type:
          title: Type
          type: string
          enum:
            - active
            - inactive
            - test
            - demo
            - trial
            - stakeholder
          readOnly: true
        logo:
          title: Logo
          type: string
          readOnly: true
          format: uri
          nullable: true
        country:
          title: Country
          type: string
          maxLength: 2
          minLength: 1
        credits_used:
          title: Credits used
          type: string
          readOnly: true
        nr_of_employees:
          title: Nr of employees
          type: number
          readOnly: true
        nr_of_locations:
          title: Nr of locations
          type: number
          readOnly: true
        nr_of_transactions:
          title: Nr of transactions
          type: integer
          readOnly: true
        minimum_date_filter:
          title: Minimum date filter
          type: string
          format: date
          readOnly: true
        results_limit_earliest_year:
          title: Results limit earliest year
          type: string
          format: date
          readOnly: true
        results_limit_latest_year:
          title: Results limit latest year
          type: string
          format: date
          readOnly: true
          nullable: true
        min_transaction_date:
          title: Min transaction date
          type: string
          readOnly: true
        max_transaction_date:
          title: Max transaction date
          type: string
          readOnly: true
        public_page_url:
          title: Public page url
          type: string
          format: uri
          maxLength: 200
          nullable: true
        chift_consumer_id:
          title: Chift consumer id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        default_currency:
          title: Default currency
          type: string
          minLength: 1
        default_locale:
          title: Default locale
          type: string
          enum:
            - nl-NL
            - en-US
            - en-GB
            - fr-FR
            - fr-BE
            - sv-SE
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        information:
          title: Information
          type: object
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        flags:
          type: array
          items:
            $ref: '#/components/schemas/CompanyFlag'
    Permission:
      type: object
      properties:
        codename:
          title: Codename
          type: string
          readOnly: true
          minLength: 1
    Group:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
          readOnly: true
    UserMe:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        first_name:
          title: First name
          type: string
          readOnly: true
          minLength: 1
        last_name:
          title: Last name
          type: string
          readOnly: true
          minLength: 1
        email:
          title: Email
          type: string
          format: email
          readOnly: true
          minLength: 1
          nullable: true
        firebase_uid:
          title: Firebase uid
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        job_title:
          title: Job title
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        profile_picture:
          title: Profile picture
          type: string
          readOnly: true
          format: uri
          nullable: true
        is_mfa_enrolled:
          title: Is mfa enrolled
          type: boolean
          readOnly: true
        is_mfa_required:
          title: Is mfa required
          type: boolean
          readOnly: true
          nullable: true
        active_user_company_id:
          title: Active user company id
          type: integer
          readOnly: true
          nullable: true
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          readOnly: true
        pylon_email_hash:
          title: Pylon email hash
          type: string
          readOnly: true
        user_company:
          $ref: '#/components/schemas/SimpleUserCompany'
        company:
          $ref: '#/components/schemas/LegacyOptionalCompany'
        auth_group:
          $ref: '#/components/schemas/Group'
    Workspace:
      type: object
      properties:
        workspace_id:
          title: Workspace id
          type: integer
          readOnly: true
        workspace_name:
          title: Workspace name
          type: string
          readOnly: true
          minLength: 1
        workspace_logo:
          title: Workspace logo
          type: string
          readOnly: true
          format: uri
          nullable: true
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          readOnly: true
          minLength: 1
        logo:
          title: Logo
          type: string
          readOnly: true
          format: uri
          nullable: true
        type:
          title: Type
          type: string
          enum:
            - active
            - inactive
            - test
            - demo
            - trial
            - stakeholder
          readOnly: true
        country:
          title: Country
          type: string
          readOnly: true
          minLength: 1
        member_count:
          title: Member count
          type: integer
          readOnly: true
        is_mfa_enabled:
          title: Is mfa enabled
          type: boolean
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    ManualInput:
      required:
        - label
        - order
        - type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        label:
          title: Label
          type: string
          maxLength: 1000
          minLength: 1
        unit:
          title: Unit
          type: string
          readOnly: true
        order:
          title: Order
          type: integer
          maximum: 2147483647
          minimum: 1
        type:
          title: Type
          type: string
          enum:
            - dropdown
            - value
    BaseEmissionFactorCategory:
      required:
        - title
        - parent
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        icon:
          title: Icon
          description: SVG icon filename. Only set on top-level and sub-category levels.
          type: string
          readOnly: true
          format: uri
          nullable: true
        parent:
          title: Parent
          description: >-
            Parent category. Null for top-level categories. 3-level hierarchy:
            top-level → sub-category → classification.
          type: integer
          nullable: true
        category:
          title: Category
          type: integer
          readOnly: true
        manual_inputs:
          type: array
          items:
            $ref: '#/components/schemas/ManualInput'
    EmissionFactorCategory:
      required:
        - title
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        icon:
          title: Icon
          description: SVG icon filename. Only set on top-level and sub-category levels.
          type: string
          readOnly: true
          format: uri
          nullable: true
        parent:
          $ref: '#/components/schemas/BaseEmissionFactorCategory'
        category:
          title: Category
          type: integer
          readOnly: true
        manual_inputs:
          type: array
          items:
            $ref: '#/components/schemas/ManualInput'
    KgCO2eMultiplierUnit:
      required:
        - name
        - display_name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        display_name:
          title: Display name
          description: 'You can use HTML tags, e.g.: km&lt;sup&gt;2&lt;/sup&gt;'
          type: string
          maxLength: 255
          minLength: 1
    BaseEmissionFactor:
      required:
        - title
        - category
        - kg_co2e_multiplier
        - kg_co2e_multiplier_unit
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          description: Display name of the emission factor.
          type: string
          maxLength: 255
          minLength: 1
        category:
          $ref: '#/components/schemas/EmissionFactorCategory'
        company:
          title: Company
          description: Null for global EFs. Set for company-specific overrides.
          type: integer
          nullable: true
        kg_co2e_multiplier:
          title: Kg co2e multiplier
          description: CO2e conversion multiplier in kg per unit.
          type: number
        kg_co2e_multiplier_unit:
          $ref: '#/components/schemas/KgCO2eMultiplierUnit'
        year:
          title: Year
          description: Reference year for the emission factor data.
          type: string
          maxLength: 10
          nullable: true
        region:
          title: Region
          description: Geographic region. Mix of freetext and ISO-2 codes.
          type: string
          maxLength: 255
          nullable: true
    ActivityBasedTransactionsType:
      required:
        - count
        - sub_categories
      type: object
      properties:
        count:
          title: Count
          type: integer
        sub_categories:
          type: array
          items:
            $ref: '#/components/schemas/BaseEmissionFactorCategory'
    ManualInputTransactionsSubCategories:
      required:
        - open
        - completed
        - skipped
      type: object
      properties:
        open:
          $ref: '#/components/schemas/ActivityBasedTransactionsType'
        completed:
          $ref: '#/components/schemas/ActivityBasedTransactionsType'
        skipped:
          $ref: '#/components/schemas/ActivityBasedTransactionsType'
    ChartQueryParam:
      type: object
      properties:
        date_aggregation:
          title: Date aggregation
          type: string
          enum:
            - day
            - week
            - month
            - quarter
            - year
        date_gte:
          title: Date gte
          type: string
          format: date
        date_lte:
          title: Date lte
          type: string
          format: date
        group_by:
          title: Group by
          type: string
          enum:
            - category
            - parent_category
            - status
            - vendor_name
            - ledger
        relative_to:
          title: Relative to
          type: string
          enum:
            - absolute
            - per_employee
            - per_revenue_unit
        metric_label:
          title: Metric label
          type: string
          minLength: 1
        limit:
          title: Limit
          type: integer
        type:
          title: Type
          type: string
          enum:
            - pie
            - bar
            - line
            - area
            - dashed-line
            - dotted-line
            - tree-map
    TrendLineData:
      required:
        - date_aggregation
        - trend_line
      type: object
      properties:
        date_aggregation:
          title: Date aggregation
          type: string
          format: date-time
        trend_line:
          title: Trend line
          type: number
    TransactionEmissionClassificationUpdate:
      required:
        - emission_factor
      type: object
      properties:
        emission_factor:
          title: Emission factor
          type: integer
    LegacyCompany:
      required:
        - name
        - country
        - default_currency
        - default_locale
        - flags
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 1024
          minLength: 1
        type:
          title: Type
          type: string
          enum:
            - active
            - inactive
            - test
            - demo
            - trial
            - stakeholder
          readOnly: true
        logo:
          title: Logo
          type: string
          readOnly: true
          format: uri
          nullable: true
        country:
          title: Country
          type: string
          maxLength: 2
          minLength: 1
        credits_used:
          title: Credits used
          type: string
          readOnly: true
        nr_of_employees:
          title: Nr of employees
          type: number
          readOnly: true
        nr_of_locations:
          title: Nr of locations
          type: number
          readOnly: true
        nr_of_transactions:
          title: Nr of transactions
          type: integer
          readOnly: true
        minimum_date_filter:
          title: Minimum date filter
          type: string
          format: date
          readOnly: true
        results_limit_earliest_year:
          title: Results limit earliest year
          type: string
          format: date
          readOnly: true
        results_limit_latest_year:
          title: Results limit latest year
          type: string
          format: date
          readOnly: true
          nullable: true
        min_transaction_date:
          title: Min transaction date
          type: string
          readOnly: true
        max_transaction_date:
          title: Max transaction date
          type: string
          readOnly: true
        public_page_url:
          title: Public page url
          type: string
          format: uri
          maxLength: 200
          nullable: true
        chift_consumer_id:
          title: Chift consumer id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        default_currency:
          title: Default currency
          type: string
          minLength: 1
        default_locale:
          title: Default locale
          type: string
          enum:
            - nl-NL
            - en-US
            - en-GB
            - fr-FR
            - fr-BE
            - sv-SE
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        information:
          title: Information
          type: object
        pulse_params:
          title: Pulse params
          type: string
          readOnly: true
        flags:
          type: array
          items:
            $ref: '#/components/schemas/CompanyFlag'
    CompanyTag:
      required:
        - company
        - name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company:
          title: Company
          type: integer
        name:
          title: Name
          type: string
          maxLength: 20
          minLength: 1
    DataPointCreateRequest:
      required:
        - context
        - value
        - field_id
      type: object
      properties:
        context:
          title: Context
          type: object
          additionalProperties:
            type: string
            nullable: true
        value:
          title: Value
          type: string
        field_id:
          title: Field id
          type: string
          minLength: 1
    DataPointCreateStatusRequest:
      required:
        - context
        - field_id
        - status
      type: object
      properties:
        context:
          title: Context
          type: object
          additionalProperties:
            type: string
            nullable: true
        field_id:
          title: Field id
          type: string
          minLength: 1
        status:
          title: Status
          type: string
          enum:
            - not_started
            - in_progress
            - ready_for_review
            - ready_for_audit
            - suggested
    Export:
      required:
        - context
      type: object
      properties:
        export_template:
          title: Export template
          type: integer
        survey:
          title: Survey
          type: integer
        application_survey_id:
          title: Application survey id
          type: integer
        export_configuration:
          title: Export configuration
          type: object
          additionalProperties:
            type: string
            nullable: true
        context:
          title: Context
          type: object
          additionalProperties:
            type: string
            nullable: true
    QueryContext:
      required:
        - context_object
        - context_value
        - precision
      type: object
      properties:
        context_object:
          title: Context object
          type: string
          minLength: 1
        context_value:
          title: Context value
          type: string
          minLength: 1
        precision:
          title: Precision
          type: string
          enum:
            - exact
            - exclude
            - nearest
    SurveySubmissionCreate:
      required:
        - application_survey_id
        - query_context
      type: object
      properties:
        application_survey_id:
          title: Application survey id
          type: integer
        query_context:
          type: array
          items:
            $ref: '#/components/schemas/QueryContext'
    EmissionFactor:
      required:
        - title
        - category
        - classification_category
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title + region. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        title:
          title: Title
          description: Display name of the emission factor.
          type: string
          maxLength: 255
          minLength: 1
        category:
          $ref: '#/components/schemas/EmissionFactorCategory'
        classification_category:
          $ref: '#/components/schemas/EmissionFactorCategory'
        company:
          title: Company
          description: Null for global EFs. Set for company-specific overrides.
          type: integer
          nullable: true
        kg_co2e_multiplier:
          title: Kg co2e multiplier
          type: number
          readOnly: true
        kg_co2e_multiplier_unit:
          title: Kg co2e multiplier unit
          type: object
          readOnly: true
        region:
          title: Region
          description: Geographic region. Mix of freetext and ISO-2 codes.
          type: string
          maxLength: 255
          nullable: true
        is_activity_based:
          title: Is activity based
          description: True for activity-based EFs, false for spend-based.
          type: boolean
        is_required_transactions_input_classifier:
          title: Is required transactions input classifier
          description: >-
            Marks the EF whose category requires transaction input. Very few EFs
            are truthy.
          type: boolean
        year:
          title: Year
          description: Reference year for the emission factor data.
          type: string
          maxLength: 10
          nullable: true
        source:
          title: Source
          description: Data source (e.g. EXIOBASE, BEIS, EPA, CBAM).
          type: string
          maxLength: 255
          nullable: true
        deleted_at:
          title: Deleted at
          description: Soft-delete tombstone. Null means active.
          type: string
          format: date-time
          nullable: true
    CreateUpdateCompanyEmissionFactor:
      required:
        - kg_co2e_multiplier
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          description: Display name of the emission factor.
          type: string
          maxLength: 255
          minLength: 1
        kg_co2e_multiplier:
          title: Kg co2e multiplier
          description: CO2e conversion multiplier in kg per unit.
          type: number
    EmissionFilter:
      type: object
      properties:
        id:
          title: Id
          type: number
          nullable: true
        id__in:
          title: Id  in
          type: string
        journal:
          title: Journal
          type: string
        journal__icontains:
          title: Journal  icontains
          type: string
        journal__istartswith:
          title: Journal  istartswith
          type: string
        journal__iendswith:
          title: Journal  iendswith
          type: string
        journal__isnull:
          title: Journal  isnull
          type: boolean
          nullable: true
        title:
          title: Title
          type: string
        title__icontains:
          title: Title  icontains
          type: string
        title__istartswith:
          title: Title  istartswith
          type: string
        title__iendswith:
          title: Title  iendswith
          type: string
        description:
          title: Description
          type: string
        description__icontains:
          title: Description  icontains
          type: string
        description__istartswith:
          title: Description  istartswith
          type: string
        description__iendswith:
          title: Description  iendswith
          type: string
        description__isnull:
          title: Description  isnull
          type: boolean
          nullable: true
        vendor_name:
          title: Vendor name
          type: string
        vendor_name__icontains:
          title: Vendor name  icontains
          type: string
        vendor_name__istartswith:
          title: Vendor name  istartswith
          type: string
        vendor_name__iendswith:
          title: Vendor name  iendswith
          type: string
        vendor_name__isnull:
          title: Vendor name  isnull
          type: boolean
          nullable: true
        accounting_date:
          title: Accounting date
          type: string
          format: date-time
          nullable: true
        accounting_date__gte:
          title: Accounting date  gte
          type: string
          format: date-time
          nullable: true
        accounting_date__lte:
          title: Accounting date  lte
          type: string
          format: date-time
          nullable: true
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
          nullable: true
        classification_category_id:
          title: Classification category id
          type: string
        classification_category_name:
          title: Classification category name
          type: string
        classification_category_name__icontains:
          title: Classification category name  icontains
          type: string
        classification_category_name__istartswith:
          title: Classification category name  istartswith
          type: string
        classification_category_name__iendswith:
          title: Classification category name  iendswith
          type: string
        sub_category_id:
          title: Sub category id
          type: string
        category_id:
          title: Category id
          type: string
        ghg_category_id:
          title: Ghg category id
          type: string
        is_tag_along:
          title: Is tag along
          type: boolean
          nullable: true
        confidence_status:
          title: Confidence status
          type: string
        co2_kg:
          title: Co2 kg
          type: number
          nullable: true
        co2_kg__gt:
          title: Co2 kg  gt
          type: number
          nullable: true
        co2_kg__lt:
          title: Co2 kg  lt
          type: number
          nullable: true
        co2_kg__gte:
          title: Co2 kg  gte
          type: number
          nullable: true
        co2_kg__lte:
          title: Co2 kg  lte
          type: number
          nullable: true
        controlled_by_identifier:
          title: Controlled by identifier
          type: string
        controlled_by_identifier__icontains:
          title: Controlled by identifier  icontains
          type: string
        controlled_by_identifier__istartswith:
          title: Controlled by identifier  istartswith
          type: string
        controlled_by_identifier__iendswith:
          title: Controlled by identifier  iendswith
          type: string
        controlled_by_identifier__isnull:
          title: Controlled by identifier  isnull
          type: boolean
          nullable: true
        scope:
          type: array
          items:
            type: string
            minLength: 1
        company_tags:
          type: array
          items:
            type: integer
        flags_key_value:
          title: Flags key value
          type: string
    TransactionFilter:
      type: object
      properties:
        id:
          title: Id
          type: number
          nullable: true
        id__in:
          title: Id  in
          type: string
        vendor_name:
          title: Vendor name
          type: string
        vendor_name__icontains:
          title: Vendor name  icontains
          type: string
        vendor_name__istartswith:
          title: Vendor name  istartswith
          type: string
        vendor_name__iendswith:
          title: Vendor name  iendswith
          type: string
        vendor_name__isnull:
          title: Vendor name  isnull
          type: boolean
          nullable: true
        ledger:
          title: Ledger
          type: string
        ledger__icontains:
          title: Ledger  icontains
          type: string
        ledger__istartswith:
          title: Ledger  istartswith
          type: string
        ledger__iendswith:
          title: Ledger  iendswith
          type: string
        journal:
          title: Journal
          type: string
        journal__icontains:
          title: Journal  icontains
          type: string
        journal__istartswith:
          title: Journal  istartswith
          type: string
        journal__iendswith:
          title: Journal  iendswith
          type: string
        journal__isnull:
          title: Journal  isnull
          type: boolean
          nullable: true
        description:
          title: Description
          type: string
        description__icontains:
          title: Description  icontains
          type: string
        description__istartswith:
          title: Description  istartswith
          type: string
        description__iendswith:
          title: Description  iendswith
          type: string
        description__isnull:
          title: Description  isnull
          type: boolean
          nullable: true
        source:
          title: Source
          type: string
        integration_id:
          title: Integration id
          type: string
        integration__name:
          title: Integration  name
          type: string
        integration__name__icontains:
          title: Integration  name  icontains
          type: string
        integration__name__istartswith:
          title: Integration  name  istartswith
          type: string
        integration__name__iendswith:
          title: Integration  name  iendswith
          type: string
        date:
          title: Date
          type: string
          format: date-time
          nullable: true
        date__gte:
          title: Date  gte
          type: string
          format: date-time
          nullable: true
        date__lte:
          title: Date  lte
          type: string
          format: date-time
          nullable: true
        net_amount:
          title: Net amount
          type: number
          nullable: true
        net_amount__gt:
          title: Net amount  gt
          type: number
          nullable: true
        net_amount__lt:
          title: Net amount  lt
          type: number
          nullable: true
        net_amount__gte:
          title: Net amount  gte
          type: number
          nullable: true
        net_amount__lte:
          title: Net amount  lte
          type: number
          nullable: true
        tags:
          type: array
          items:
            type: integer
        confidence_status:
          title: Confidence status
          type: string
        classified:
          title: Classified
          type: boolean
          nullable: true
    ActivityData:
      required:
        - date
        - volume
        - volume_unit
        - title
      type: object
      properties:
        date:
          title: Date
          description: ISO 8601 date/datetime, e.g. '2024-01-15T00:00:00Z'
          type: string
          minLength: 1
        volume:
          title: Volume
          description: Volume of the activity, e.g. 150.0 (km, kWh, tonne, …)
          type: number
        volume_unit:
          title: Volume unit
          description: Unit matching the emission factor, e.g. 'km', 'kWh'
          type: string
          minLength: 1
        title:
          title: Title
          description: Short label for the activity, e.g. 'Business Travel - Q1'
          type: string
          minLength: 1
        end_date:
          title: End date
          description: ISO 8601 end date for range activities
          type: string
          minLength: 1
        journal:
          title: Journal
          description: Journal/reference code
          type: string
        description:
          title: Description
          description: Free-text description
          type: string
        vendor_name:
          title: Vendor name
          description: Vendor / supplier name
          type: string
    BulkEmissionClassificationOperation:
      type: object
      properties:
        emission_filters:
          $ref: '#/components/schemas/EmissionFilter'
        transaction_filters:
          $ref: '#/components/schemas/TransactionFilter'
        emission_factor_id:
          title: Emission factor id
          type: integer
        classification_category_id:
          title: Classification category id
          type: integer
        ghg_category_id:
          title: Ghg category id
          type: integer
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
        activity_data:
          $ref: '#/components/schemas/ActivityData'
    BulkEmissionClassificationRequest:
      required:
        - operations
      type: object
      properties:
        operations:
          type: array
          items:
            $ref: '#/components/schemas/BulkEmissionClassificationOperation'
    BulkEmissionClassificationOperationResult:
      required:
        - index
        - count
        - status
      type: object
      properties:
        index:
          title: Index
          description: Zero-based index of the operation in the request.
          type: integer
        count:
          title: Count
          description: Number of records matched and sent for classification.
          type: integer
        status:
          title: Status
          description: '''accepted'' when the operation was processed successfully.'
          type: string
          minLength: 1
        error:
          title: Error
          description: >-
            Error message if the operation failed during processing or
            validation.
          type: string
          minLength: 1
    BulkEmissionClassificationResponse:
      required:
        - results
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/BulkEmissionClassificationOperationResult'
    Classification:
      type: object
      properties:
        id:
          title: Id
          description: >-
            ID of an **existing emission** to reclassify. Omit to create a new
            emission.
          type: integer
        transaction_id:
          title: Transaction id
          description: ID of the transaction being classified.
          type: integer
        emission_factor_id:
          title: Emission factor id
          description: >-
            Specific emission factor ID. Takes priority over
            `classification_category_id` when both are supplied.
          type: integer
        classification_category_id:
          title: Classification category id
          description: >-
            Emission factor category (leaf node). Required unless
            `emission_factor_id` is given.
          type: integer
        ghg_category_id:
          title: Ghg category id
          description: GHG category ID. If omitted the category's default GHG is used.
          type: integer
        is_activity_based_emission:
          title: Is activity based emission
          description: >-
            Set `true` for activity-based (volume-driven) emissions. Requires
            `activity_data`.
          type: boolean
        activity_data:
          $ref: '#/components/schemas/ActivityData'
        controlled_by_identifier:
          title: Controlled by identifier
          type: string
          nullable: true
    LegacyEmissionClassificationRequest:
      required:
        - classifications
      type: object
      properties:
        classifications:
          type: array
          items:
            $ref: '#/components/schemas/Classification'
    EmissionChart:
      required:
        - transaction_count
        - emission_count
        - total_co2_kg
      type: object
      properties:
        transaction_count:
          title: Transaction count
          type: integer
        emission_count:
          title: Emission count
          type: integer
        total_co2_kg:
          title: Total co2 kg
          type: number
        date:
          title: Date
          type: string
          format: date-time
        main_emission:
          title: Main emission
          type: integer
        category:
          title: Category
          type: integer
        category_name:
          title: Category name
          type: string
          minLength: 1
        sub_category:
          title: Sub category
          type: integer
        sub_category_name:
          title: Sub category name
          type: string
          minLength: 1
        ghg_category:
          title: Ghg category
          type: integer
        ghg_category_name:
          title: Ghg category name
          type: string
          minLength: 1
        scope:
          title: Scope
          type: string
          minLength: 1
        title:
          title: Title
          type: string
          minLength: 1
        vendor_name:
          title: Vendor name
          type: string
          minLength: 1
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
    Emission:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company:
          title: Company
          type: integer
          readOnly: true
        company_name:
          title: Company name
          type: string
          readOnly: true
          minLength: 1
        company_tags:
          type: array
          items:
            type: integer
          readOnly: true
          uniqueItems: true
        emission_group_id:
          title: Emission group id
          type: string
          format: uuid
          readOnly: true
        transaction:
          title: Transaction
          type: integer
          readOnly: true
          nullable: true
        total_volume:
          title: Total volume
          type: number
          readOnly: true
          nullable: true
        volume:
          title: Volume
          type: number
          readOnly: true
          nullable: true
        volume_unit:
          title: Volume unit
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        journal:
          title: Journal
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        title:
          title: Title
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        description:
          title: Description
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        vendor_name:
          title: Vendor name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        accounting_date:
          title: Accounting date
          type: string
          format: date-time
          readOnly: true
          nullable: true
        accounting_end_date:
          title: Accounting end date
          type: string
          format: date-time
          readOnly: true
          nullable: true
        transaction_is_visible:
          title: Transaction is visible
          type: boolean
          readOnly: true
          nullable: true
        transaction_data:
          title: Transaction data
          type: object
          readOnly: true
          nullable: true
        transaction_id:
          title: Transaction id
          type: string
          readOnly: true
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
          readOnly: true
        activity_data:
          title: Activity data
          type: object
          readOnly: true
          nullable: true
        emission_factor:
          title: Emission factor
          type: integer
          readOnly: true
          nullable: true
        emission_unit:
          title: Emission unit
          type: integer
          readOnly: true
          nullable: true
        emission_unit_name:
          title: Emission unit name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        emission_factor_data:
          title: Emission factor data
          type: object
          readOnly: true
          nullable: true
        classification_category:
          title: Classification category
          type: integer
          readOnly: true
          nullable: true
        classification_category_name:
          title: Classification category name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        sub_category:
          title: Sub category
          type: integer
          readOnly: true
          nullable: true
        sub_category_name:
          title: Sub category name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        category:
          title: Category
          type: integer
          readOnly: true
          nullable: true
        category_name:
          title: Category name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        ghg_category:
          title: Ghg category
          type: integer
          readOnly: true
          nullable: true
        ghg_category_name:
          title: Ghg category name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
          readOnly: true
        is_tag_along:
          title: Is tag along
          type: boolean
          readOnly: true
        main_emission:
          title: Main emission
          type: integer
          readOnly: true
          nullable: true
        created_by:
          title: Created by
          type: integer
          readOnly: true
          nullable: true
        classification_source:
          title: Classification source
          type: string
          enum:
            - auto
            - script
            - manual
          readOnly: true
        confidence:
          title: Confidence
          type: number
          readOnly: true
          nullable: true
        confidence_threshold:
          title: Confidence threshold
          type: number
          readOnly: true
          nullable: true
        confidence_status:
          title: Confidence status
          type: string
          enum:
            - confident
            - needs_attention
          readOnly: true
          nullable: true
        co2_kg:
          title: Co2 kg
          type: number
          readOnly: true
          nullable: true
        flags:
          title: Flags
          type: object
          readOnly: true
          nullable: true
        controlled_by_identifier:
          title: Controlled by identifier
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        deleted_at:
          title: Deleted at
          type: string
          format: date-time
          readOnly: true
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
    EmissionCsvExport:
      type: object
      properties:
        accounting_date:
          title: Accounting date
          type: string
          format: date-time
          nullable: true
        journal:
          title: Journal
          type: string
          maxLength: 255
          nullable: true
        title:
          title: Title
          type: string
          maxLength: 255
          nullable: true
        vendor_name:
          title: Vendor name
          type: string
          maxLength: 255
          nullable: true
        description:
          title: Description
          type: string
          maxLength: 1024
          nullable: true
        company_tags_names:
          title: Company tags names
          type: string
          minLength: 1
        volume:
          title: Volume
          type: number
          nullable: true
        volume_unit:
          title: Volume unit
          type: string
          maxLength: 255
          nullable: true
        co2_kg:
          title: Co2 kg
          type: number
          nullable: true
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
        ghg_category_name:
          title: Ghg category name
          type: string
          maxLength: 255
          nullable: true
        category_name:
          title: Category name
          type: string
          maxLength: 255
          nullable: true
        ef_title:
          title: Ef title
          type: string
          minLength: 1
        ef_description:
          title: Ef description
          type: string
          minLength: 1
        ef_multiplier:
          title: Ef multiplier
          type: string
          minLength: 1
        emission_unit_name:
          title: Emission unit name
          type: string
          maxLength: 255
          nullable: true
        ef_source:
          title: Ef source
          type: string
          minLength: 1
        ef_year:
          title: Ef year
          type: string
          minLength: 1
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
        is_tag_along:
          title: Is tag along
          type: boolean
        transaction:
          title: Transaction
          type: integer
          nullable: true
    DocxExport:
      required:
        - report_type
        - start_date
        - end_date
      type: object
      properties:
        report_type:
          title: Report type
          type: string
          enum:
            - climatiq_emission
            - ghg_emission
        start_date:
          title: Start date
          type: string
          format: date
        end_date:
          title: End date
          type: string
          format: date
    BaseEFCategorySerializer:
      required:
        - title
        - parent
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        icon:
          title: Icon
          description: SVG icon filename. Only set on top-level and sub-category levels.
          type: string
          readOnly: true
          format: uri
          nullable: true
        parent:
          title: Parent
          description: >-
            Parent category. Null for top-level categories. 3-level hierarchy:
            top-level → sub-category → classification.
          type: integer
          nullable: true
        is_classification_category:
          title: Is classification category
          description: >-
            True for leaf-node classification categories (level-3). The majority
            of EFCs are classification categories.
          type: boolean
        is_tag_along:
          title: Is tag along
          description: >-
            True for tag-along categories. Tag-along emissions are
            auto-generated alongside primary emissions.
          type: boolean
    EFCategorySerializer:
      required:
        - title
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        icon:
          title: Icon
          description: SVG icon filename. Only set on top-level and sub-category levels.
          type: string
          readOnly: true
          format: uri
          nullable: true
        parent:
          $ref: '#/components/schemas/BaseEFCategorySerializer'
        is_classification_category:
          title: Is classification category
          description: >-
            True for leaf-node classification categories (level-3). The majority
            of EFCs are classification categories.
          type: boolean
        is_tag_along:
          title: Is tag along
          description: >-
            True for tag-along categories. Tag-along emissions are
            auto-generated alongside primary emissions.
          type: boolean
    EFCSearchGrandparent:
      required:
        - title
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
    EFCSearchParent:
      required:
        - title
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        parent:
          $ref: '#/components/schemas/EFCSearchGrandparent'
    EFCSearchGHGCategory:
      required:
        - title
        - scope
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          type: string
          maxLength: 255
          minLength: 1
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
        slug:
          title: Slug
          type: string
          maxLength: 255
          nullable: true
        color:
          title: Color
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
    EFCSearchGHGMapping:
      type: object
      properties:
        greenhouse_gas_category:
          $ref: '#/components/schemas/EFCSearchGHGCategory'
    EFCSearchSerializer:
      required:
        - title
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        slug:
          title: Slug
          description: Auto-generated from title. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        parent:
          $ref: '#/components/schemas/EFCSearchParent'
        parent_id:
          title: Parent id
          type: integer
          readOnly: true
        color:
          title: Color
          description: Display colour. Only set on some categories.
          type: string
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
          maxLength: 24
          nullable: true
        is_classification_category:
          title: Is classification category
          description: >-
            True for leaf-node classification categories (level-3). The majority
            of EFCs are classification categories.
          type: boolean
        ghg_mappings:
          type: array
          items:
            $ref: '#/components/schemas/EFCSearchGHGMapping'
          readOnly: true
    EFKgCO2eMultiplierUnit:
      required:
        - name
        - display_name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        display_name:
          title: Display name
          description: 'You can use HTML tags, e.g.: km&lt;sup&gt;2&lt;/sup&gt;'
          type: string
          maxLength: 255
          minLength: 1
    EFSerializer:
      required:
        - title
        - kg_co2e_multiplier
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          description: Auto-generated from title + region. Not unique — duplicates exist.
          type: string
          maxLength: 255
          minLength: 1
          nullable: true
        description:
          title: Description
          description: Optional description. Sparsely populated.
          type: string
          maxLength: 1024
          nullable: true
        title:
          title: Title
          description: Display name of the emission factor.
          type: string
          maxLength: 255
          minLength: 1
        category:
          $ref: '#/components/schemas/EFCategorySerializer'
        classification_category:
          $ref: '#/components/schemas/EFCategorySerializer'
        company:
          title: Company
          description: Null for global EFs. Set for company-specific overrides.
          type: integer
          nullable: true
        kg_co2e_multiplier:
          title: Kg co2e multiplier
          description: CO2e conversion multiplier in kg per unit.
          type: number
        kg_co2e_multiplier_unit:
          $ref: '#/components/schemas/EFKgCO2eMultiplierUnit'
        region:
          title: Region
          description: Geographic region. Mix of freetext and ISO-2 codes.
          type: string
          maxLength: 255
          nullable: true
        is_activity_based:
          title: Is activity based
          description: True for activity-based EFs, false for spend-based.
          type: boolean
        is_required_transactions_input_classifier:
          title: Is required transactions input classifier
          description: >-
            Marks the EF whose category requires transaction input. Very few EFs
            are truthy.
          type: boolean
        year:
          title: Year
          description: Reference year for the emission factor data.
          type: string
          maxLength: 10
          nullable: true
        source:
          title: Source
          description: Data source (e.g. EXIOBASE, BEIS, EPA, CBAM).
          type: string
          maxLength: 255
          nullable: true
        deleted_at:
          title: Deleted at
          description: Soft-delete tombstone. Null means active.
          type: string
          format: date-time
          nullable: true
    GreenhouseGasCategory:
      required:
        - title
        - scope
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          type: string
          maxLength: 255
          nullable: true
        title:
          title: Title
          type: string
          maxLength: 255
          minLength: 1
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
        category_number:
          title: Category number
          description: GHG Protocol category number (1–15 for Scope 3, null otherwise).
          type: integer
          maximum: 32767
          minimum: 0
          nullable: true
        emission_direction:
          title: Emission direction
          type: string
          enum:
            - upstream
            - downstream
          nullable: true
    ETransaction:
      required:
        - net_amount
        - currency
        - date
        - ledger
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        net_amount:
          title: Net amount
          type: number
        currency:
          title: Currency
          type: string
          maxLength: 10
          minLength: 1
        vendor_name:
          title: Vendor name
          type: string
          maxLength: 255
          nullable: true
        date:
          title: Date
          type: string
          format: date-time
        end_date:
          title: End date
          type: string
          format: date-time
          nullable: true
        ledger:
          title: Ledger
          type: string
          maxLength: 255
          minLength: 1
        journal:
          title: Journal
          type: string
          maxLength: 255
          nullable: true
        description:
          title: Description
          type: string
          maxLength: 1024
          nullable: true
        tags:
          type: array
          items:
            type: string
          readOnly: true
        status:
          title: Status
          type: string
          enum:
            - new
            - classified
        source:
          title: Source
          type: string
          enum:
            - codat
            - chift
            - lune
            - regreener
            - csv
        total_co2_kg:
          title: Total co2 kg
          type: string
          readOnly: true
        emissions:
          title: Emissions
          type: string
          readOnly: true
    TransactionChart:
      required:
        - count
      type: object
      properties:
        count:
          title: Count
          type: integer
        total_net_amount:
          title: Total net amount
          type: number
        period:
          title: Period
          type: string
          format: date-time
        ledger:
          title: Ledger
          type: string
          minLength: 1
        vendor_name:
          title: Vendor name
          type: string
          minLength: 1
        journal:
          title: Journal
          type: string
          minLength: 1
        source:
          title: Source
          type: string
          minLength: 1
        currency:
          title: Currency
          type: string
          minLength: 1
    TransactionStatistics:
      required:
        - count
        - total_amount
        - currency
        - total_co2_kg
      type: object
      properties:
        count:
          title: Count
          type: integer
        total_amount:
          title: Total amount
          type: number
        currency:
          title: Currency
          type: string
          minLength: 1
        total_co2_kg:
          title: Total co2 kg
          type: number
    SimpleCompanyTag:
      required:
        - name
      type: object
      properties:
        name:
          title: Name
          type: string
          maxLength: 20
          minLength: 1
    SimpleEmissionFactorCategory:
      required:
        - title
      type: object
      properties:
        title:
          title: Title
          description: Display name of the category.
          type: string
          maxLength: 255
          minLength: 1
    SimpleGreenhouseGasCategory:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        slug:
          title: Slug
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        title:
          title: Title
          type: string
          readOnly: true
          minLength: 1
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
          readOnly: true
        category_number:
          title: Category number
          description: GHG Protocol category number (1–15 for Scope 3, null otherwise).
          type: integer
          readOnly: true
          nullable: true
        emission_direction:
          title: Emission direction
          type: string
          enum:
            - upstream
            - downstream
          readOnly: true
          nullable: true
        color:
          title: Color
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        icon:
          title: Icon
          type: string
          readOnly: true
          format: uri
          nullable: true
    RelatedEmission:
      required:
        - classification_category
        - sub_category
        - category
        - ghg_category
        - company_name
        - company
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        company_tags:
          type: array
          items:
            $ref: '#/components/schemas/SimpleCompanyTag'
          readOnly: true
        transaction_vendor_name:
          title: Transaction vendor name
          type: string
          minLength: 1
          nullable: true
        transaction_description:
          title: Transaction description
          type: string
          minLength: 1
          nullable: true
        classification_category:
          $ref: '#/components/schemas/SimpleEmissionFactorCategory'
        sub_category:
          $ref: '#/components/schemas/SimpleEmissionFactorCategory'
        category:
          $ref: '#/components/schemas/SimpleEmissionFactorCategory'
        ghg_category:
          $ref: '#/components/schemas/SimpleGreenhouseGasCategory'
        tag_along_emissions:
          title: Tag along emissions
          type: object
          readOnly: true
        transaction_total_net_amount:
          title: Transaction total net amount
          type: number
          readOnly: true
        transaction_net_amount:
          title: Transaction net amount
          type: number
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        company_name:
          title: Company name
          type: string
          maxLength: 1024
          minLength: 1
        emission_group_id:
          title: Emission group id
          type: string
          format: uuid
        total_volume:
          title: Total volume
          type: number
          nullable: true
        volume:
          title: Volume
          type: number
          nullable: true
        volume_unit:
          title: Volume unit
          type: string
          maxLength: 255
          nullable: true
        journal:
          title: Journal
          type: string
          maxLength: 255
          nullable: true
        title:
          title: Title
          type: string
          maxLength: 255
          nullable: true
        description:
          title: Description
          type: string
          maxLength: 1024
          nullable: true
        vendor_name:
          title: Vendor name
          type: string
          maxLength: 255
          nullable: true
        accounting_date:
          title: Accounting date
          type: string
          format: date-time
          nullable: true
        accounting_end_date:
          title: Accounting end date
          type: string
          format: date-time
          nullable: true
        transaction_is_visible:
          title: Transaction is visible
          type: boolean
          nullable: true
        transaction_data:
          title: Transaction data
          type: object
          nullable: true
        is_activity_based_emission:
          title: Is activity based emission
          type: boolean
        activity_data:
          title: Activity data
          type: object
          nullable: true
        emission_unit_name:
          title: Emission unit name
          type: string
          maxLength: 255
          nullable: true
        emission_factor_data:
          title: Emission factor data
          type: object
          nullable: true
        classification_category_name:
          title: Classification category name
          type: string
          maxLength: 255
          nullable: true
        sub_category_name:
          title: Sub category name
          type: string
          maxLength: 255
          nullable: true
        category_name:
          title: Category name
          type: string
          maxLength: 255
          nullable: true
        ghg_category_name:
          title: Ghg category name
          type: string
          maxLength: 255
          nullable: true
        scope:
          title: Scope
          type: string
          enum:
            - '1'
            - '2'
            - '3'
            - Offset
            - Excluded
        is_tag_along:
          title: Is tag along
          type: boolean
        classification_source:
          title: Classification source
          type: string
          enum:
            - auto
            - script
            - manual
        confidence:
          title: Confidence
          type: number
          nullable: true
        confidence_threshold:
          title: Confidence threshold
          type: number
          nullable: true
        confidence_status:
          title: Confidence status
          type: string
          enum:
            - confident
            - needs_attention
          nullable: true
        co2_kg:
          title: Co2 kg
          type: number
          nullable: true
        ml_metadata:
          title: Ml metadata
          type: object
          nullable: true
        testing_data:
          title: Testing data
          type: boolean
        flags:
          title: Flags
          type: object
          nullable: true
        controlled_by_identifier:
          title: Controlled by identifier
          type: string
          maxLength: 255
          nullable: true
        deleted_at:
          title: Deleted at
          type: string
          format: date-time
          nullable: true
        company:
          title: Company
          type: integer
        transaction:
          title: Transaction
          type: integer
          nullable: true
        emission_factor:
          title: Emission factor
          type: integer
          nullable: true
        emission_unit:
          title: Emission unit
          type: integer
          nullable: true
        main_emission:
          title: Main emission
          type: integer
          nullable: true
        created_by:
          title: Created by
          type: integer
          nullable: true
    AirtableRequest:
      required:
        - url
      type: object
      properties:
        url:
          title: Url
          type: string
          format: uri
          minLength: 1
    SyncChiftTransactions:
      required:
        - company_id
        - integration_id
      type: object
      properties:
        company_id:
          title: Company id
          type: integer
        integration_id:
          title: Integration id
          type: integer
    AccountingSelection:
      required:
        - name
        - type
        - journal
        - company
        - integration
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        transaction_count:
          title: Transaction count
          type: string
          readOnly: true
        journal_name:
          title: Journal name
          type: string
          readOnly: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 1024
          nullable: true
        type:
          title: Type
          type: string
          enum:
            - ledger
            - journal
        external_id:
          title: External id
          type: string
          maxLength: 255
          nullable: true
        is_included_in_analysis:
          title: Is included in analysis
          type: boolean
          nullable: true
        journal:
          title: Journal
          type: integer
          nullable: true
        company:
          title: Company
          type: integer
        integration:
          title: Integration
          type: integer
    Integration:
      required:
        - type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - codat
            - chift
            - lune
            - regreener
            - csv
        name:
          title: Name
          type: string
          maxLength: 1024
          nullable: true
        lune_account_id:
          title: Lune account id
          type: string
          maxLength: 1024
          nullable: true
        type_access_token:
          title: Type access token
          type: string
          maxLength: 1024
          nullable: true
        company:
          title: Company
          type: integer
        created_by:
          title: Created by
          type: integer
          nullable: true
        last_synced_at:
          title: Last synced at
          type: string
          format: date-time
          nullable: true
        created_at:
          title: Created at
          type: string
          format: date-time
          readOnly: true
        updated_at:
          title: Updated at
          type: string
          format: date-time
          readOnly: true
        logs:
          title: Logs
          type: object
          nullable: true
        linked_by_first_name:
          title: Linked by first name
          type: string
          readOnly: true
        linked_by_last_name:
          title: Linked by last name
          type: string
          readOnly: true
        linked_by_email:
          title: Linked by email
          type: string
          readOnly: true
        transactions_count:
          title: Transactions count
          type: string
          readOnly: true
        status:
          title: Status
          type: string
          enum:
            - inactive
            - uploading
            - importing transactions
            - upload failed
            - needs review
            - analysis running
            - analysis completed
          nullable: true
        connection_status:
          title: Connection status
          type: string
          enum:
            - active
            - inactive
          nullable: true
    CreateManualInputTransactions:
      required:
        - sub_category_id
      type: object
      properties:
        sub_category_id:
          title: Sub category id
          type: integer
    SSOSignup:
      type: object
      properties:
        user_invitation_id:
          title: User invitation id
          type: string
          maxLength: 1024
    Signup:
      required:
        - password
        - repeated_password
        - first_name
        - last_name
        - email
      type: object
      properties:
        password:
          title: Password
          description: >-
            Minimum 10 characters. Consider using a passphrase (e.g. a short
            memorable sentence). Must not be similar to your personal
            information, must not be a commonly used password, and must not be
            entirely numeric.
          type: string
          maxLength: 1024
          minLength: 1
        repeated_password:
          title: Repeated password
          type: string
          maxLength: 1024
          minLength: 1
        first_name:
          title: First name
          type: string
          maxLength: 1024
          minLength: 1
        last_name:
          title: Last name
          type: string
          maxLength: 1024
          minLength: 1
        company:
          title: Company
          type: string
          maxLength: 1024
        job_title:
          title: Job title
          type: string
          maxLength: 1024
        email:
          title: Email
          type: string
          maxLength: 1024
          minLength: 1
        user_invitation_id:
          title: User invitation id
          type: string
          maxLength: 1024
    Survey:
      required:
        - name
        - questions
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        name:
          title: Name
          type: string
          maxLength: 255
          minLength: 1
        questions:
          title: Questions
          type: object
        survey_questions:
          title: Survey questions
          type: string
          readOnly: true
        survey_answers:
          title: Survey answers
          type: string
          readOnly: true
    SurveyAnswer:
      required:
        - year
        - answers
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        year:
          title: Year
          type: string
          format: date
        answers:
          title: Answers
          type: object
    Answer:
      required:
        - question
        - year
        - text
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        question:
          title: Question
          type: integer
        year:
          title: Year
          type: string
          format: date
        text:
          title: Text
          type: string
          maxLength: 255
          minLength: 1
    BasicIntegration:
      required:
        - type
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - codat
            - chift
            - lune
            - regreener
            - csv
        name:
          title: Name
          type: string
          maxLength: 1024
          nullable: true
    TransactionEmissionClassification:
      required:
        - transaction
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        transaction:
          title: Transaction
          type: integer
        emission_factor:
          $ref: '#/components/schemas/EmissionFactor'
        confidence:
          title: Confidence
          type: number
          nullable: true
        source:
          title: Source
          type: string
          enum:
            - auto
            - manual
        auto_classification_version:
          title: Auto classification version
          type: string
          maxLength: 16
          nullable: true
        co2_kg:
          title: Co2 kg
          type: number
          nullable: true
    ManualInputAnswer:
      type: object
      properties:
        manual_input_id:
          title: Manual input id
          type: string
          readOnly: true
        emission_factor_title:
          title: Emission factor title
          type: string
          readOnly: true
        value:
          title: Value
          type: number
          nullable: true
    Transaction:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        type:
          title: Type
          type: string
          enum:
            - income
            - expense
          readOnly: true
        vat_rate:
          title: Vat rate
          type: number
          readOnly: true
          nullable: true
        net_amount:
          title: Net amount
          type: number
          readOnly: true
        gross_amount:
          title: Gross amount
          type: number
          readOnly: true
        currency:
          title: Currency
          type: string
          readOnly: true
          minLength: 1
        vendor_name:
          title: Vendor name
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        date:
          title: Date
          type: string
          format: date-time
          readOnly: true
        end_date:
          title: End date
          type: string
          format: date-time
          readOnly: true
          nullable: true
        title:
          title: Title
          type: string
          readOnly: true
        ledger:
          title: Ledger
          type: string
          readOnly: true
          minLength: 1
        journal:
          title: Journal
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        status:
          title: Status
          type: string
          enum:
            - new
            - classified
          readOnly: true
        description:
          title: Description
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        external_id:
          title: External id
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        integration:
          $ref: '#/components/schemas/BasicIntegration'
        emission_classification:
          $ref: '#/components/schemas/TransactionEmissionClassification'
        company:
          title: Company
          type: integer
          readOnly: true
        skip_manual_input:
          title: Skip manual input
          type: boolean
          readOnly: true
        manual_input_completed:
          title: Manual input completed
          type: boolean
          readOnly: true
        manual_input_answers:
          type: array
          items:
            $ref: '#/components/schemas/ManualInputAnswer'
        tags:
          title: Tags
          type: string
          readOnly: true
    BulkClassificationConfidenceRequest:
      required:
        - transaction_ids
        - source
      type: object
      properties:
        transaction_ids:
          type: array
          items:
            type: integer
        source:
          title: Source
          type: string
          enum:
            - auto
            - manual
    BulkClassificationRequest:
      required:
        - transaction_id
      type: object
      properties:
        transaction_id:
          title: Transaction id
          type: integer
        emission_factor_id:
          title: Emission factor id
          type: integer
    CreateUserInvitationMultiCompany:
      required:
        - email
        - auth_group
      type: object
      properties:
        id:
          title: Id
          type: string
          format: uuid
          readOnly: true
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          minLength: 1
        auth_group:
          title: Auth group
          type: integer
    RetrieveUserInvitation:
      required:
        - is_existing_user
      type: object
      properties:
        id:
          title: Id
          type: string
          format: uuid
          readOnly: true
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          nullable: true
        company:
          $ref: '#/components/schemas/LegacyCompany'
        auth_group_id:
          title: Auth group id
          type: string
          readOnly: true
        is_existing_user:
          title: Is existing user
          type: boolean
        is_active:
          title: Is active
          type: string
          readOnly: true
        is_mfa_enabled:
          title: Is mfa enabled
          type: string
          readOnly: true
    User:
      required:
        - first_name
        - last_name
      type: object
      properties:
        first_name:
          title: First name
          type: string
          maxLength: 1024
          minLength: 1
        last_name:
          title: Last name
          type: string
          maxLength: 1024
          minLength: 1
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          nullable: true
        id:
          title: ID
          type: integer
          readOnly: true
        firebase_uid:
          title: Firebase uid
          type: string
          readOnly: true
          minLength: 1
          nullable: true
        active_user_company_id:
          title: Active user company id
          type: integer
        user_company:
          $ref: '#/components/schemas/SimpleUserCompany'
        company:
          $ref: '#/components/schemas/LegacyOptionalCompany'
        job_title:
          title: Job title
          type: string
          maxLength: 1024
          nullable: true
        profile_picture:
          title: Profile picture
          type: string
          readOnly: true
          format: uri
          nullable: true
        auth_group:
          $ref: '#/components/schemas/Group'
        is_mfa_enrolled:
          title: Is mfa enrolled
          type: boolean
          readOnly: true
        is_mfa_required:
          title: Is mfa required
          type: boolean
          readOnly: true
          nullable: true
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          readOnly: true
        pylon_email_hash:
          title: Pylon email hash
          type: string
          readOnly: true
    ResetPassword:
      required:
        - email
      type: object
      properties:
        email:
          title: Email
          type: string
          format: email
          minLength: 1
    UserUpdate:
      required:
        - first_name
        - last_name
      type: object
      properties:
        first_name:
          title: First name
          type: string
          maxLength: 1024
          minLength: 1
        last_name:
          title: Last name
          type: string
          maxLength: 1024
          minLength: 1
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          nullable: true
        job_title:
          title: Job title
          type: string
          maxLength: 1024
          nullable: true
        profile_picture:
          title: Profile picture
          type: string
          readOnly: true
          format: uri
          nullable: true
    BatchChannelAuth:
      required:
        - socket_id
        - channel_names
      type: object
      properties:
        socket_id:
          title: Socket id
          type: string
          maxLength: 100
          minLength: 1
        channel_names:
          type: array
          items:
            type: string
            maxLength: 100
            minLength: 1
    ChannelAuth:
      required:
        - channel_name
        - socket_id
      type: object
      properties:
        channel_name:
          title: Channel name
          type: string
          maxLength: 100
          minLength: 1
        socket_id:
          title: Socket id
          type: string
          maxLength: 100
          minLength: 1
    TeamMember:
      required:
        - first_name
        - last_name
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        first_name:
          title: First name
          type: string
          maxLength: 1024
          minLength: 1
        last_name:
          title: Last name
          type: string
          maxLength: 1024
          minLength: 1
        job_title:
          title: Job title
          type: string
          maxLength: 1024
          nullable: true
        profile_picture:
          title: Profile picture
          type: string
          readOnly: true
          format: uri
          nullable: true
        email:
          title: Email
          type: string
          format: email
          maxLength: 1024
          nullable: true
    WorkspaceTeamMember:
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        user:
          $ref: '#/components/schemas/TeamMember'
        auth_group:
          title: Auth group
          type: integer
          nullable: true
        auth_group_name:
          title: Auth group name
          type: string
          readOnly: true
          minLength: 1
        data_room_consumer_id:
          title: Data room consumer id
          type: string
          maxLength: 1024
          nullable: true
  securitySchemes:
    Bearer:
      description: >-
        Our firebase api token, used to authenticate. Bearer prefix required
        before token
      type: apiKey
      name: Authorization
      in: header
  requestBodies:
    routed-documents_create:
      content:
        multipart/form-data:
          schema:
            type: object
            properties:
              name:
                type: string
                minLength: 1
                maxLength: 510
              description:
                type: string
                x-nullable: true
              file:
                type: string
                format: binary
              identifiers:
                description: List of identifier strings
                type: array
                items:
                  type: string
                  minLength: 1
            required:
              - name
      required: true
    Rule:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Rule'
      required: true
    Comment:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Comment'
      required: true
    SaleOrder:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SaleOrder'
      required: true
    PurchaseOrder:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PurchaseOrder'
      required: true
    BatchOrder:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BatchOrder'
      required: true
    Product:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Product'
      required: true
    Origin:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Origin'
      required: true
    DueDiligenceStatement:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DueDiligenceStatement'
      required: true
    ProductChainOrder:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProductChainOrder'
      required: true
    TraceList:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TraceList'
      required: true
    ValueChain:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValueChain'
      required: true
    UserUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserUpdate'
      required: true
    transactions_async_csv_uploadData:
      content:
        application/json:
          schema:
            required:
              - file_name
              - data
            type: object
            properties:
              file_name:
                description: Name of the CSV file
                type: string
              data:
                description: List of data entries in the CSV file
                type: array
                items:
                  type: object
                  properties:
                    vat_rate:
                      description: VAT Rate (optional)
                      type: string
                    net_amount:
                      description: Net Amount
                      type: string
                    gross_amount:
                      description: Gross Amount (optional)
                      type: string
                    currency:
                      description: Currency (optional)
                      type: string
                    vendor_name:
                      description: Vendor Name (optional)
                      type: string
                    date:
                      description: Date
                      type: string
                    ledger:
                      description: Ledger
                      type: string
                    journal:
                      description: Journal (optional)
                      type: string
                    description:
                      description: Description (optional)
                      type: string
                    external_id:
                      description: External ID (optional)
                      type: string
                    tags:
                      description: Tags (optional)
                      type: string
      required: true
    SSOSignup:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SSOSignup'
      required: true
    TransactionEmissionClassificationUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TransactionEmissionClassificationUpdate'
      required: true
    LegacyCompany:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyCompany'
      required: true
    CreateUpdateCompanyEmissionFactor:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateUpdateCompanyEmissionFactor'
      required: true
    Integration:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Integration'
      required: true
    CreateManualInputTransactions:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateManualInputTransactions'
      required: true
    SurveyAnswer:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SurveyAnswer'
      required: true
    Transaction:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Transaction'
      required: true
security:
  - Bearer: []
tags:
  - name: documents
  - name: expenses
  - name: imports
  - name: rag
