openapi: 3.0.0
info:
  title: InboxCare v1 Public API
  version: '1.0'
  contact:
    name: Contact Golem.ai tech support
    email: support@golem.ai
    url: https://golem.ai/
  description: >-
    # Introduction


    The Inboxcare REST API provides a convenient way to categorize your
    documents.


    1. The symbolic AI NLU from Golem.ai

    2. The post categorization engine from Golem.ai


    These components need a specific configuration to fulfill your business
    context and requirements. Usually, the configuration is done by Golem.ai.


    Once configured, your InboxCare is ready and uniquely identified with an
    **environment ID** (envId). You can find it in the url of your environment :
    /project/projectId/environment/**envId**/dashboard


    # Authentication


    The Inboxcare API is secured by a set of API Keys.


    All API requests must be made over HTTPS and must be authenticated with the
    API Keys.


    Depending on your setup & agreement with Golem.ai:


    * **you are managed by Golem.ai**: you have been provided with a set of API
    keys by Golem.ai.


    * **you have been granted an access to the Golem.ai console**: you can
    directly manage your API keys in Management >> Access keys. From there u can
    click on the button "New Access Key" and give it a name. Now you will be
    given your `Secret_token`, keep it safe, this is the only time you will be
    able to see it. After u close this window you can now see the "Id" of your
    key, this is your `APP_ID`


    # Getting started


    Analyzing your data flow is a 3-steps process:


    1. upload your email

    2. webhook notification

    3. retrieve the results


    ## 1. Uploading


    You will need to upload your email or document with the
    [/v4/console/api/environment/{envId}/inboxCare/analyse](#operations-Analysis-post-analyse)
    endpoint.


    ## 2. Webhook - push


    You can also be notified by InboxCare once a categorisation is done. If
    configured, InboxCare will POST an HTTP request to a pre-defined URL. To
    configure it, go to Management >> Webhooks and click on "Create a webhook".
    When there you will need to insert a few informations : 


    * The url of your webhook


    * The type of webhook - (sucess/error) If you want to be notified on success
    or on error


    * The format of webhook - (inboxcare_v2/inboxcare_light) Use light if you
    want a more lighter version of response, else use v2


    * An Autorization header if you want your new endpoint to be protected with
    one (optional)


    ## 3. Retrieving the result of your analysis


    Once the categorization is done, you can get the formatted result with the
    [/v4/console/api/inboxCare/analysis/{analysisId}](#operations-Analysis-post-analyse)
    endpoint.


    # API upgrades policy


    The following elements should be treated as indicative rather than a
    comprehensive list of every possible change. 


    ## Backwards-compatible changes


    Golem.ai considers the following changes to be **backwards-compatible**:


    * Adding new API resources or methods

    * Adding new optional request parameters

    * Adding new field to existing API responses

    * Changing the fields order in API responses

    * Adding a value to an enum


    ## Backwards-incompatible breaking changes


    Golem.ai considers the following changes to be **backwards-incompatible**:


    * Removing or renaming a service, resource, field, method or enum value

    * Changing the type of a field

    * Changing the URL format
servers:
  - description: preprod
    url: https://api.console.golem-preprod.dev
  - url: https://api.console.golem.ai
    description: prod
paths:
  /v4/console/api/environment/{envId}/inboxCare/analyses/batches:
    parameters:
      - schema:
          type: string
        name: envId
        in: path
        required: true
        description: Environment ID
      - schema:
          type: string
        name: appId
        in: query
        required: true
        description: App ID
    post:
      summary: Analyse files by batch
      operationId: post-v4-console-api-environment-envId-inboxCare-analyse_v2
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
              examples:
                Example 1:
                  value:
                    batchId: 63e0ec1ad1268
      description: Send files to be categorized by batch.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                file[]:
                  type: string
                  format: binary
                name:
                  type: string
      tags:
        - Analysis
  /v4/console/api/environment/{envId}/inboxCare/analyse:
    post:
      summary: Analyse file
      operationId: post-analyse
      responses:
        '202':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobId:
                    type: string
              examples:
                example-1:
                  value:
                    jobId: a1d5a6b3c7f2d3b9a7e17dac0ebc2727
      description: |+
        Send an email or document to be categorised.


      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                inbox:
                  type: string
                  description: >-
                    Specify the inbox were the file comes from. This will allow
                    an inboxes discriminating filter in your Dashboard
                metadata:
                  type: object
                  description: 'Correct syntax is metadata[key]=value '
                attachments[]:
                  type: string
                  x-stoplight:
                    id: 2nu42ebekrjtd
                  format: binary
              required:
                - file
            examples:
              example-1:
                value:
                  file: null
        description: '"file" represent an an EML, MSG or PDF file'
      callbacks:
        webhook:
          webhookUrl:
            post:
              operationId: post-analyse-webhook-v2
              description: |+
                Webhook notification.


              requestBody:
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/Webhook'
              responses:
                '200':
                  description: OK
                  content:
                    application/json:
                      schema:
                        type: object
        webhooklight:
          webhookUrl:
            post:
              operationId: post-analyse-webhook-light
              description: |+
                Webhook notification light format.


              requestBody:
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/Webhooklight'
              responses:
                '200':
                  description: OK
                  content:
                    application/json:
                      schema:
                        type: object
      parameters: []
      x-codeSamplesse:
        - lang: cURL
          source: >-
            curl --location --request POST
            '/environment/{envId}/inboxCare/analyse/environment/{envId}/inboxCare/analyse'
            \

            --header 'Authorization: {Secret_token}' \

            --form 'file=@"/Users/you/Documents/ftest.eml"'
      tags:
        - Analysis
    parameters:
      - schema:
          type: string
        name: envId
        in: path
        description: Environment ID
        required: true
      - schema:
          type: string
        name: appId
        in: query
        description: App ID
        required: true
  /v4/console/api/environment/{envId}/inboxCare/form-analyze:
    post:
      summary: Analyse form
      operationId: post-analyse-manual
      responses:
        '202':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobId:
                    type: string
              examples:
                example-1:
                  value:
                    jobId: a1d5a6b3c7f2d3b9a7e17dac0ebc2727
      description: |+
        Send splitted fields from an email


      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                subject:
                  type: string
                body:
                  type: string
                from:
                  type: string
                to:
                  type: string
                attachments:
                  type: array
                  items: {}
                metadata:
                  type: array
                  description: 'Correct syntax is metadata[key]=value '
                  items:
                    type: object
                cc:
                  type: string
                  x-stoplight:
                    id: 8baykxl64mh86
              required:
                - subject
                - body
            examples:
              example-2:
                value:
                  subject: My subject
                  body: My body
                  from: sender@sender.com
                  to: mail@mail.com
                  attachments:
                    - file1
                    - file2
                  metadata:
                    - ticketId: '23'
          application/json:
            schema:
              type: object
              properties: {}
        description: ''
      callbacks:
        webhook:
          webhookUrl:
            post:
              operationId: post-form-analyse-webhook-v2
              description: |+
                Webhook notification.


              requestBody:
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/Webhook'
              responses:
                '200':
                  description: OK
                  content:
                    application/json:
                      schema:
                        type: object
        webhooklight:
          webhookUrl:
            post:
              operationId: post-form-analyse-webhook-light
              description: |+
                Webhook notification light format.


              requestBody:
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/Webhooklight'
              responses:
                '200':
                  description: OK
                  content:
                    application/json:
                      schema:
                        type: object
      parameters: []
      x-codeSamplesse:
        - lang: cURL
          source: >-
            curl --location --request POST
            '/environment/{envId}/inboxCare/analyse/environment/{envId}/inboxCare/form-analyze'
            \

            --header 'Authorization: {Secret_token}' \

            --form 'file=@"/Users/you/Documents/ftest.eml"'
      tags:
        - Analysis
      x-internal: false
    parameters:
      - schema:
          type: string
        name: envId
        in: path
        description: Environment ID
        required: true
      - schema:
          type: string
        name: appId
        in: query
        description: App ID
        required: true
  /v4/console/api/inboxCare/analysis/{analysisId}:
    parameters:
      - schema:
          type: string
        name: analysisId
        in: path
        description: Analysis' Id
        required: true
      - schema:
          type: string
        name: appId
        in: query
        description: App ID
        required: true
    get:
      summary: Retrieve an analysis
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Categorisation'
              examples:
                example-1:
                  value:
                    id: 5a35e2c8bae983074c67d4692a53123f
                    filename: Mail.eml
                    environmentId: 4
                    state: IC - Processed
                    inboxCareResult:
                      body: Demande de devis
                      from: samuel.simonney@golem.ai
                      subject: Demande de devis
                      to: robert.zed@gmail.com
                      cc: ''
                      golem_text: ''
                      processing:
                        - name: 4_reportMecEmise
                          priority: 10
                      language: fr
                      golem_request: {}
                      golem_response: {}
                      golem_attachments_responses:
                        - idRequest: 0
                          requestLanguage: fr
                          usedLanguage: ''
                          requestText: requestText  PJ_1.pdf
                          timeAi: 0s
                          timeTotal: 300ms
                          helperMessage: ''
                          conversationCode: 0
                          labels: []
                      golem_attachments_contents:
                        attachment2.txt: attestation d'assureur  Samuel copie 2.txt
                        attachment.txt: "relance procès verbal\r\n  Samuel copie.txt"
                      nlu_response_by_attachment:
                        attachment2.txt:
                          idRequest: 0
                        attachment.txt:
                          idRequest: 0
                    automatedReplyResult: null
                    draftReplyResult: null
                    queuedDate: '2022-02-22T10:36:43+00:00'
                    lastModificationDate: '2022-02-22T10:36:46+00:00'
                    metadata: []
                    postProcessingLog: ''
                    categoriesBeforePostProcessing:
                      - name: 4_reportMecEmise
                        priority: 10
                        id: 12
                    messageCategories:
                      - name: 4_reportMecEmise
                    attachmentsCategories: []
        '404':
          description: Not Found
      operationId: get-categorisation-analysisId
      description: Retrieve the result of a specific categorisation
      parameters: []
      tags:
        - Analysis
components:
  schemas:
    Categorisation:
      description: Categorisation result
      type: object
      x-examples:
        example-1:
          id: 5a35e2c8bae983074c67d4692a53123f
          filename: Mail_46f5b611fc5f8f1621feb2008a34c79e65efb24a.eml
          environmentId: 4
          state: IC - Error
          inboxCareResult:
            body: ''
            from: samuel.simonney@golem.ai
            subject: CONTRADICTOIRE rdv
            to: samuel.simonney@gmail.com
            cc: ''
            golem_text: ''
            processing:
              - name: 4_reportMecEmise
                priority: 10
            language: fr
            golem_request: {}
            golem_response: {}
            golem_attachments_responses: []
            golem_attachments_contents:
              Samuel copie 2.txt: attestation d'assureur  Samuel copie 2.txt
              Samuel copie.txt: "relance procès verbal\r\n  Samuel copie.txt"
              Samuel.txt: "relance procès verbal\r\n\r\ncoordonnées assureur  Samuel.txt"
          automatedReplyResult: null
          draftReplyResult: null
          queuedDate: '2022-02-22T10:36:43+00:00'
          lastModificationDate: '2022-02-22T10:36:46+00:00'
          metadata: []
          postProcessingLog: ''
          categoriesBeforePostProcessing:
            - name: 4_reportMecEmise
              priority: 10
              id: 12
          messageCategories:
            - name: 4_reportMecEmise
          trace:
            - name: extractor
              duration: PT0.012460S
            - name: nlu
              duration: PT0.034021S
            - name: categoryMatching
              duration: PT0.029863S
            - name: postProcessing
              duration: PT0.007174S
            - name: extractData
              duration: null
            - name: automatedReply
              duration: null
          totalDuration: null
      properties:
        id:
          type: string
          minLength: 1
        filename:
          type: string
          minLength: 1
        environmentId:
          type: number
        state:
          type: string
          minLength: 1
        inboxCareResult:
          type: object
          required:
            - body
            - from
            - subject
            - to
            - cc
            - golem_text
            - processing
            - language
            - golem_request
            - golem_response
            - golem_attachments_responses
            - golem_attachments_contents
          properties:
            body:
              type: string
              minLength: 1
            from:
              type: string
              minLength: 1
            subject:
              type: string
              minLength: 1
            to:
              type: string
              minLength: 1
            cc:
              type: string
            golem_text:
              type: string
              minLength: 1
            processing:
              type: array
              uniqueItems: true
              items:
                type: object
                properties:
                  name:
                    type: string
                    minLength: 1
                  priority:
                    type: number
                required:
                  - name
                  - priority
            language:
              type: string
              minLength: 1
            golem_request:
              type: object
            golem_response:
              type: object
            golem_attachments_responses:
              type: array
              items:
                type: object
            golem_attachments_contents:
              type: object
            nlu_response_by_attachment:
              type: object
        automatedReplyResult:
          type: string
          nullable: true
        draftReplyResult:
          type: string
          nullable: true
        queuedDate:
          type: string
          minLength: 1
        lastModificationDate:
          type: string
          minLength: 1
        metadata:
          type: object
        postProcessingLog:
          type: string
          minLength: 0
        categoriesBeforePostProcessing:
          type: array
          uniqueItems: true
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
              priority:
                type: number
              id:
                type: number
            required:
              - name
              - priority
              - id
        messageCategories:
          type: array
          uniqueItems: true
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
            required:
              - name
        attachmentsCategories:
          type: array
          uniqueItems: true
          items:
            type: object
            properties:
              categoryName:
                type: string
                minLength: 1
            required:
              - categoryName
        extractParamsLog:
          type: string
          nullable: true
        extractParams:
          type: object
        trace:
          type: array
          items:
            $ref: '#/components/schemas/CategorizationTraceListItem.v1'
        extractorTraces:
          type: array
          items:
            type: object
            properties:
              executionTime:
                type: string
                nullable: true
              filename:
                type: string
                nullable: true
              nbPages:
                type: number
                nullable: true
              ocrUsed:
                type: string
        totalDuration:
          type: string
          nullable: true
        anonymizedAt:
          type: string
          nullable: true
        inbox:
          type: string
          nullable: true
        extractParamsErrorLogs:
          type: array
          x-stoplight:
            id: fausbt61tvvt7
          items:
            x-stoplight:
              id: ullkqkeugdmqf
            type: string
      required:
        - id
        - filename
        - environmentId
        - state
        - inboxCareResult
        - queuedDate
        - lastModificationDate
        - metadata
        - postProcessingLog
        - categoriesBeforePostProcessing
        - messageCategories
        - attachmentsCategories
        - trace
        - totalDuration
        - inbox
        - extractParamsErrorLogs
    Webhook:
      description: Categorisation webhook
      type: object
      x-examples:
        example-1:
          id: 5a35e2c8bae983074c67d4692a53123f
          filename: Mail_46f5b611fc5f8f1621feb2008a34c79e65efb24a.eml
          environmentId: 4
          state: IC - Error
          inboxCareResult:
            body: "Convocation RDV CONTRADICTOIRE REPORTE\r\nREFERENCES ELEX Référence Sinistre Assureur\r\nA_neutralizer\r\n[Llogo\r\nElex]\r\narchetype (A_neutralizer)\r\nA_neutralizer\r\n[Llogo\r\n-- \r\n[image: photo]\r\n*Samuel SIMONNEY*\r\nChef de projet technique\r\n0786815002\r\n\r\nhttps://golem.ai/ | Paris 02\r\n"
            from: samuel.simonney@golem.ai
            subject: CONTRADICTOIRE rdv
            to: samuel.simonney@gmail.com
            cc: ''
            golem_text: ''
            processing:
              - name: 4_reportMecEmise
                priority: 10
            language: fr
            golem_request: {}
            golem_response: {}
            golem_attachments_responses: []
            golem_attachments_contents:
              Samuel copie 2.txt: attestation d'assureur  Samuel copie 2.txt
              Samuel copie.txt: "relance procès verbal\r\n  Samuel copie.txt"
              Samuel.txt: "relance procès verbal\r\n\r\ncoordonnées assureur  Samuel.txt"
          automatedReplyResult: null
          draftReplyResult: null
          queuedDate: '2022-02-22T10:36:43+00:00'
          lastModificationDate: '2022-02-22T10:36:46+00:00'
          metadata: []
          postProcessingLog: ''
          categoriesBeforePostProcessing:
            - name: 4_reportMecEmise
              priority: 10
              id: 12
          messageCategories:
            - name: 4_reportMecEmise
      properties:
        id:
          type: string
          minLength: 1
        categories:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
            required:
              - name
        attachmentCategories:
          type: array
          items:
            type: object
            properties:
              categoryName:
                type: string
                minLength: 1
            required:
              - name
        categorization:
          type: object
          required:
            - golem_text
            - processing
            - language
            - golem_request
            - golem_response
          properties:
            golem_text:
              type: string
              minLength: 1
            processing:
              type: array
              uniqueItems: true
              items:
                type: object
                properties:
                  name:
                    type: string
                    minLength: 1
                  priority:
                    type: number
                required:
                  - name
                  - priority
            language:
              type: string
              minLength: 1
            golem_request:
              type: object
            golem_response:
              type: object
        message:
          type: object
          properties:
            from:
              type: string
              minLength: 1
            to:
              type: string
              minLength: 1
            cc:
              type: string
            subject:
              type: string
              minLength: 1
            body:
              type: string
              minLength: 1
        automatedReply:
          type: string
          nullable: true
        draftReply:
          type: string
          nullable: true
        extractParams:
          type: object
        metadata:
          type: object
        filename:
          type: string
          minLength: 1
        createdAt:
          type: string
          minLength: 1
        attachments:
          type: array
          items:
            type: string
      required:
        - id
        - filename
        - categorization
        - createdAt
        - metadata
    Webhooklight:
      description: Categorisation webhook light format
      type: object
      x-examples:
        example-1:
          id: 5a35e2c8bae983074c67d4692a53123f
          categories:
            - name: 4_reportMecEmise
          attachmentsCategories: []
          categorization:
            golem_text: "<from= samuel.simonney@golem.ai >\n<to= samuel.simonney@gmail.com >\n<cc=  >\n<subject= CONTRADICTOIRE rdv >\n<body= Convocation RDV CONTRADICTOIRE REPORTE\r\nREFERENCES ELEX Référence Sinistre Assureur\r\nA_neutralizer\r\n[Llogo\r\nElex]\r\narchetype (A_neutralizer)\r\nA_neutralizer\r\n[Llogo\r\n-- \r\n[image: photo]\r\n*Samuel SIMONNEY*\r\nChef de projet technique\r\n0786815002\r\n\r\nhttps://golem.ai/ | Paris 02\r\n >\n"
            golem_response:
              idRequest: 0
              requestLanguage: fr
              usedLanguage: ''
              requestText: "<from= samuel.simonney@golem.ai >\n<to= samuel.simonney@gmail.com >\n<cc=  >\n<subject= CONTRADICTOIRE rdv >\n<body= Convocation RDV CONTRADICTOIRE REPORTE\r\nREFERENCES ELEX Référence Sinistre Assureur\r\nA_neutralizer\r\n[Llogo\r\nElex]\r\narchetype (A_neutralizer)\r\nA_neutralizer\r\n[Llogo\r\n-- \r\n[image: photo]\r\n*Samuel SIMONNEY*\r\nChef de projet technique\r\n0786815002\r\n\r\nhttps://golem.ai/ | Paris 02\r\n >\n"
              timeAi: '@variableType(string)'
              timeTotal: '@variableType(string)'
              interactions:
                - idInteraction: reportRdv
                  idContext: Analyse du corps de mail
                  parameters:
                    - name: A_neutralizer
                      value: Référence Sinistre Assureur
                    - name: C_modificationRendezVous
                      value: >-
                        [[A_rendezVous]]<<\s*((?i)[a-zA-Zéêèëîïôàù'():\-,1-2*]{1,10})\s*((?i)[a-zA-Zéêèëîïôàù'():\-,1-2*]{1,10})\s*((?i)[a-zA-Zéêèëîïôàù'():\-,1-2*]{1,10})\s*>>[[A_modification]]
                  parametersDetail:
                    A_neutralizer:
                      archetype: A_neutralizer
                      from_previous_conversation: false
                      values:
                        - source_kind: dict
                          value:
                            id: Référence Sinistre Assureur
                            expression: references elex référence sinistre assureur
                            found: references elex référence sinistre assureur
                            requested: REFERENCES ELEX Référence Sinistre Assureur
                            parents: null
                    C_modificationRendezVous:
                      archetype: C_modificationRendezVous
                      from_previous_conversation: false
                      values:
                        - source_kind: dict
                          value:
                            id: >-
                              [[A_rendezVous]]<<\s*((?i)[a-zA-Zéêèëîïôàù'():\-,1-2*]{1,10})\s*((?i)[a-zA-Zéêèëîïôàù'():\-,1-2*]{1,10})\s*((?i)[a-zA-Zéêèëîïôàù'():\-,1-2*]{1,10})\s*>>[[A_modification]]
                            capture:
                              A_modification: report
                              A_rendezVous: convocation
                            found: Convocation RDV CONTRADICTOIRE REPORTE
                  incomplete: false
              helperMessage: ''
              conversationCode: 0
              labels:
                - type: nothing
                  expression: "\r\nA_neutralizer\r\n[Llogo\r\nElex]\r\narchetype (A_neutralizer)\r\nA_neutralizer\r\n[Llogo\r\n-- \r\n[image: photo]\r\n*Samuel SIMONNEY*\r\nChef de projet technique\r\n0786815002\r\n\r\nhttps://golem.ai/ | Paris 02\r\n >\n"
            golem_request:
              text: "<from= samuel.simonney@golem.ai >\n<to= samuel.simonney@gmail.com >\n<cc=  >\n<subject= CONTRADICTOIRE rdv >\n<body= Convocation RDV CONTRADICTOIRE REPORTE\r\nREFERENCES ELEX Référence Sinistre Assureur\r\nA_neutralizer\r\n[Llogo\r\nElex]\r\narchetype (A_neutralizer)\r\nA_neutralizer\r\n[Llogo\r\n-- \r\n[image: photo]\r\n*Samuel SIMONNEY*\r\nChef de projet technique\r\n0786815002\r\n\r\nhttps://golem.ai/ | Paris 02\r\n >\n"
              token: '@variableType(string)'
              parameters_detail: true
              multiple_interaction_search: true
              language: fr
              labelling: true
            processing:
              - name: 4_reportMecEmise
                priority: 10
            language: fr
          message:
            from: samuel.simonney@golem.ai
            to: samuel.simonney@gmail.com
            cc: ''
            subject: CONTRADICTOIRE rdv
            body: "Convocation RDV CONTRADICTOIRE REPORTE\r\nREFERENCES ELEX Référence Sinistre Assureur\r\nA_neutralizer\r\n[Llogo\r\nElex]\r\narchetype (A_neutralizer)\r\nA_neutralizer\r\n[Llogo\r\n-- \r\n[image: photo]\r\n*Samuel SIMONNEY*\r\nChef de projet technique\r\n0786815002\r\n\r\nhttps://golem.ai/ | Paris 02\r\n"
          automatedReply: ''
          draftReply: ''
          metadata: {}
          extractParams:
            reportRdv: Convocation RDV CONTRADICTOIRE REPORTE
            coordonneesAssureurAttachment: coordonnées assureur
            notDetected: null
          createdAt: '2022-03-15T13:20:29+00:00'
      properties:
        id:
          type: string
          minLength: 1
        categories:
          type: array
          uniqueItems: true
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
            required:
              - name
        attachmentCategories:
          type: array
          uniqueItems: true
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
            required:
              - name
        message:
          type: object
          required:
            - body
            - from
            - to
            - cc
            - subject
          properties:
            body:
              type: string
              minLength: 1
            from:
              type: string
              minLength: 1
            subject:
              type: string
              minLength: 1
            to:
              type: string
              minLength: 1
            cc:
              type: string
        categorization:
          type: object
          required:
            - golem_text
            - processing
            - language
            - golem_request
            - golem_response
          properties:
            golem_text:
              type: string
              minLength: 1
            processing:
              type: array
              uniqueItems: true
              items:
                type: object
                properties:
                  name:
                    type: string
                    minLength: 1
                  priority:
                    type: number
                required:
                  - name
                  - priority
            language:
              type: string
              minLength: 1
            golem_request:
              type: object
            golem_response:
              type: object
        createdAt:
          type: string
          minLength: 1
        draftReply:
          type: string
        automatedReply:
          type: string
        extractParams:
          type: object
        metadata:
          type: object
        filename:
          type: string
          minLength: 1
      required:
        - id
        - filename
        - message
        - categorization
        - createdAt
        - metadata
        - draftReply
        - automatedReply
        - extractParams
        - trace
        - totalDuration
    CategorizationTraceListItem.v1:
      title: CategorizationTraceListItem
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
        duration:
          type: string
          format: duration
          nullable: true
        state:
          type: string
          x-stoplight:
            id: 0795hqaeu86xv
          enum:
            - Ok
            - Warning
      required:
        - name
        - duration
        - state
  securitySchemes:
    APP_ID:
      type: apiKey
      in: query
      name: appId
      description: >-
        provided in the URL as a query parameter `?appId=<id>`, meant  to
        publicly identify your account, it is not a sensitive information.
    Secret_token:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        provided in the HTTP header `Authorization`, it should be kept
        confidential.
security:
  - APP_ID: []
    Secret_token: []
tags:
  - name: Analysis
