openapi: 3.0.0
info:
  title: Console
  version: '1.0'
  description: |+
    The console regroups the following engines:
    - NLU Studio
    - InboxCare Studio


    # Get Started

    1. Create an account
    2. Login
    3. Create a project

  contact:
    name: Contact Golem.ai tech support
    email: support@golem.ai
servers:
  - url: ' https://api.console.golem.ai'
    description: Prod
  - url: http://api.golem.local
    description: Dev
  - url: http://api-test.golem.local
    description: Test
paths:
  /api/login_check:
    post:
      x-codeSamples:
        - lang: cURL
          source: >-
            curl --location --request POST
            'https://api.console.golem.ai/api/login_check' \

            --header 'Content-Type: application/json' \

            --data-raw '{
                "username": "myMail@golem.ai", 
                "password": "myPassword"
            }'
      summary: Login
      operationId: post-api-login_check
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                required:
                  - token
              examples:
                200 - Ok:
                  value:
                    token: >-
                      eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2MTg1ODI4MDksImV4cCI6MTYxOTg3ODgwOSwicm9sZXMiOltdLCJ1c2VybmFtZSI6ImFubmUtc29waGllLnRhbmd1eUBnb2xlbS5haSJ9.TxJjklsd,sdl865lkJLKJjnSEbbnbnXy9456bKNKJ-KJ7gkR4hGFgd75rjhbKJHK-K5PulUnLJNjeq0J79RBPA0MwU2bhQrh0kKFTc2H_ON7MWCv8eNrEFb73J1IQJeETFe64Y2xWRqD62FQmR6IMrlKav8SXapvQIXOySaDDEirSi85r9xW7bsZua-IqnPayVWBfhE_0thKar4i-TlFXaWUAqb7SsIKp_Bscnn5eP6eL4EP-WlWlubNmeW1XibXx2Z360jTah_c5hndYRML5BAmO-Oy2X-879kljhgfyuiopkjhgfhgjyrtutiyopljkhGhjgjhGGHFHgfjhjHJKKJHKjhjkjh-3a_HwhfFeva0CHe5TPB42Y9Z2LuYijnS0hqkkhWT9WmjxxuPa8Iq4NitXAkql4rxIp2h7rqG6LDGTCUZTmCKMpkCbpDWWus440tJbUdrKKJ8Zdc72x_pl14P1PFFAsjC9U_rQJ4C7a0h-uckTHj3JDI2mUZ6QWt4q7iAvhxKvLPGxqx-pR4BTCMVCEN5KMVXoWR96PaNImR_wvu1r53Tx4J_V8KSbF12eJvMItBYFJ4S3W4bEusJc
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: '401'
                  message:
                    type: string
                    example: Invalid credentials.
                required:
                  - code
                  - message
              examples:
                401 - Unauthorized:
                  value:
                    code: '401'
                    message: Invalid credentials.
      description: >-
        Login on the Console with your username and password to get a bearer
        token.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                username:
                  type: string
                  description: Your username
                password:
                  type: string
                  description: Your password
              required:
                - username
                - password
            examples:
              200 - Ok:
                value:
                  username: aUser
                  password: aPassword
        description: Login to the Console to get an Bearer Token.
      tags:
        - Login
  /projects/{projectId}/access_keys:
    get:
      summary: Get access keys
      tags:
        - Access Keys
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccessKey_Get.v1'
              examples:
                200 - Ok:
                  value:
                    - id: 5798f36a-7ddc-406e-92d9-1b2483883c16
                      name: myConsoleAccessKey
                      createdAt: '2021-04-15T14:41:10+00:00'
      operationId: get-access_keys
      description: Get access keys
      parameters: []
    post:
      summary: Create access key
      operationId: post-access_keys
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessKey_Create.v1'
              examples:
                200 - Ok:
                  value:
                    id: 5798f36a-7ddc-406e-92d9-1b2483883c16
                    name: myConsoleAccessKey
                    createdAt: '2021-04-15T14:41:10+00:00'
                    secret: b24f431a67edf5595925150610c162d0d7479303
      description: Create an access key
      tags:
        - Access Keys
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: myAccessKey
                  description: AccessKey's name
              required:
                - name
    parameters:
      - schema:
          type: string
        name: projectId
        in: path
        required: true
        description: Project ID
  /projects/{projectId}/access_keys/{ACCESS_KEY_ID}:
    delete:
      summary: Delete access key
      operationId: delete-access_keys
      responses:
        '204':
          description: No Content
      tags:
        - Access Keys
      description: Delete an access key
    parameters:
      - schema:
          type: string
        name: ACCESS_KEY_ID
        in: path
        required: true
        description: Access key
      - schema:
          type: string
        name: projectId
        in: path
        required: true
        description: Project Id
  /v4/console/api/user:
    get:
      summary: Get user information
      tags:
        - User
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserOrganisation'
              examples:
                Example:
                  value:
                    id: 1150
                    username: anne-sophie.tanguy@golem.ai
                    lastname: Tanguy
                    firstname: Anne-Sophie
                    email: anne-sophie.tanguy@golem.ai
                    isAdmin: false
                    canGhost: false
                    isGhost: false
                    organisations:
                      - active: true
                        id: 1
                        name: organisation name
                        roles:
                          - ROLE_RIGHT_PROJECT_CREATE
                          - ROLE_RIGHT_PROJECT_RENAME
                        position: Dev Ops
                    hostOrganisation:
                      id: 1
                      name: organisation name
      operationId: get-user
      description: Get the logged in user's information
  /v4/console/api/user/edit:
    patch:
      summary: Edit your Profile
      operationId: get-v4-console-api-profile-edit
      responses:
        '200':
          description: 200 response used for OK and Error. Please check the status field.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - ok
                      - ko
                    example: ok
                    readOnly: true
                  message:
                    type: string
                    example: Votre profil a correctement été mis à jour.
                required:
                  - status
                  - message
              examples:
                Status 'ok':
                  value:
                    status: ok
                    message: Votre profil a correctement été mis à jour.
                Status 'ko':
                  value:
                    status: ko
                    message: L'adresse email 'new-email@golem.ai' est déjà utilisée.
      description: Edit your personal information
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  example: my-new-email@golem.ai
                  description: User's email
                firstname:
                  type: string
                  example: Lola
                  description: User's firstname
                lastname:
                  type: string
                  example: Deltoir
                  description: User's lastname
              required:
                - firstname
                - lastname
        description: ''
      tags:
        - User
  /v4/console/api/user/password/edit:
    post:
      summary: Edit your password
      operationId: post-v4-console-api-profile-password-edit
      responses:
        '200':
          description: 200 response used for OK and Error. Please check the status field.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - ok
                      - ko
                    example: ok
                    readOnly: true
                  message:
                    type: string
                    example: Votre mot de passe a correctement été mis à jour.
                    readOnly: true
                required:
                  - status
                  - message
              examples:
                Status 'ok':
                  value:
                    status: ok
                    message: Votre mot de passe a correctement été mis à jour.
                Status 'ko':
                  value:
                    status: ko
                    message: >-
                      L'ancien mot de passe renseigné ne correspond pas au
                      vôtre.
        '400':
          description: Bad Request
        '409':
          description: Conflict
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                oldPass:
                  type: string
                  example: myOldPassword
                newPass:
                  type: string
                  example: myNewPassword*2
                  format: password
                newPassConfirm:
                  type: string
                  example: myNewPassword*2
                  format: password
              required:
                - oldPass
                - newPass
                - newPassConfirm
      tags:
        - Password
      description: Edit your password
  /v4/console/api/users:
    post:
      description: >-
        Create a new user.

        If organisation exist the user is automatically added to the
        organisation.
      summary: Create a new User
      operationId: create-user
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  username:
                    type: string
                  recoveryToken:
                    type: string
                  recoveryTokenExpirationDate:
                    type: string
                    format: date-time
              examples:
                Example:
                  value:
                    id: 1
                    username: username
                    recoveryToken: 523b4e564e825918566811ff9bbd78cb149840ba
                    recoveryTokenExpirationDate: '1970-01-01T00:00:00+00:00'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                firstname:
                  type: string
                lastname:
                  type: string
                username:
                  type: string
                organisationId:
                  type: integer
                position:
                  type: string
                roles:
                  type: array
                  items:
                    type: string
                  description: Refer to documentation on organisation-level roles
      tags:
        - User
  /organisations/{organisationId}/users/{userId}:
    parameters:
      - schema:
          type: integer
        name: organisationId
        in: path
        required: true
        description: Organisation Id
      - schema:
          type: integer
        name: userId
        in: path
        required: true
        description: User Id
    delete:
      description: >-
        You cannot kick a user if he owns an access key which had activity in
        the last 3 days !
      summary: Remove User
      operationId: remove user
      responses:
        '204':
          description: No Content
        '403':
          description: Access Denied.
        '404':
          description: Not found
      tags:
        - User
  /organisations/{organisationId}/logs:
    get:
      summary: Get logs with filter
      operationId: get-logs-with-filter
      parameters:
        - schema:
            type: integer
          name: organisationId
          in: path
          required: true
          description: Organisation Id
        - schema:
            type: integer
          name: page
          in: query
          required: false
          description: Table page
        - schema:
            type: integer
          name: user
          in: query
          required: false
          description: Filter by user
        - schema:
            type: string
          name: event
          in: query
          required: false
          description: Filter by event name
        - schema:
            type: integer
          name: project
          in: query
          required: false
          description: Filter by project
        - schema:
            type: integer
          name: environment
          in: query
          required: false
          description: Filter by environment
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AuditLog'
                  pagination:
                    type: object
                    properties:
                      page:
                        type: integer
                      totalItems:
                        type: integer
                      totalPages:
                        type: integer
              examples:
                Example:
                  value:
                    data:
                      - id: 740326b2-c9c3-00ee-b778-0242sc170115
                        user:
                          id: 1
                          username: golem
                          email: golem@golem.fr
                          firstName: golem
                          lastName: golem
                        project:
                          id: 1
                          name: project's name
                        environment:
                          - id: 1
                            name: environment's name
                        event: organisation_permissions_update
                        description: >-
                          Added permission \"ROLE_PROJECT_ADMIN\" to
                          \"golem_test@golem.ai\" on project \"My first nlu
                          project\"
                        date: '1970-01-01T00:00:00+00:00'
                        metadata:
                          method: added
                          role: ROLE_PROJECT_ADMIN
                        accessKey: ao19b403-febe-2s70-81e6-f61378098651
                    pagination:
                      page: 1
                      totalItems: 10
                      totalPages: 4
      tags:
        - Logs
  /organisations/{organisationId}/logs/bulk:
    get:
      summary: Get logs with token
      operationId: get-logs-with-token
      parameters:
        - schema:
            type: integer
          name: organisationId
          in: path
          required: true
          description: Organisation Id
        - schema:
            type: integer
          name: limit
          in: query
          required: false
          description: How much items are returned
        - schema:
            type: string
            format: uuid
          name: token
          in: query
          required: false
          description: Return items after pagination token
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                properties:
                  next_token:
                    type: string
                    format: uuid
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AuditLog'
                  limit:
                    type: integer
              examples:
                Example:
                  value:
                    next_token: 1sw78cve-d09e-01ce-8646-0242ze170005
                    data:
                      - id: 740326b2-c9c3-00ee-b778-0242sc170115
                        user:
                          id: 1
                          username: golem
                          email: golem@golem.fr
                          firstName: golem
                          lastName: golem
                        project:
                          id: 1
                          name: project's name
                        environment:
                          - id: 1
                            name: environment's name
                        event: organisation_permissions_update
                        description: >-
                          Added permission \"ROLE_PROJECT_ADMIN\" to
                          \"golem_test@golem.ai\" on project \"My first nlu
                          project\"
                        date: '1970-01-01T00:00:00+00:00'
                        metadata:
                          method: added
                          role: ROLE_PROJECT_ADMIN
                        accessKey: ao19b403-febe-2s70-81e6-f61378098651
                    limit: 1
      tags:
        - Logs
  /v4/console/api/project:
    post:
      summary: Create project
      operationId: post-v4-console-api-projects
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
        '400':
          description: Bad Request
      description: Create a project
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: myProject
                  description: Project's name
                projectKind:
                  type: string
                  description: Project's type. NLU or IC
                  example: IC
                organisation:
                  type: integer
                  description: The organisation containing the Project
                  example: 1
              required:
                - name
                - projectKind
            examples:
              Example:
                value:
                  name: project name
                  projectKind: IC
      tags:
        - Projects
  /v4/console/api/projects:
    get:
      summary: Get projects
      tags:
        - Projects
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProjectWithPermissions'
      operationId: get-v4-console-api-projects
      description: Get all projects
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                sortField:
                  type: string
                asc:
                  type: boolean
        description: Project list filters
  /v4/console/api/projects/{projectID}:
    parameters:
      - schema:
          type: integer
          example: 3193
        name: projectID
        in: path
        required: true
        description: Project's ID
    delete:
      summary: Delete Project
      operationId: delete-v4-console-api-projects-projectId
      responses:
        '204':
          description: No Content
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      tags:
        - Projects
      description: Delete a project
    patch:
      summary: Rename Project
      operationId: patch-project
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
        '400':
          description: Bad Request
        '404':
          description: Not Found
      tags:
        - Projects
      description: Rename a project
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: myProject
                  description: Project's name
              required:
                - name
    put:
      summary: Change Project Organisation
      operationId: put-v4-console-api-projects-projectId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
        '403':
          description: Access Denied.
        '404':
          description: Not Found
        '409':
          description: Already in organisation
      description: Changes a project organisation
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                organisationId:
                  type: integer
                  example: 1
              required:
                - organisationId
      tags:
        - Projects
  /v4/console/api/project/{projectId}/last-environment:
    parameters:
      - schema:
          type: string
        name: projectId
        in: path
        description: Project's ID
        required: true
    get:
      summary: Get Last Environment
      tags:
        - Projects
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LastEnvironment.v1'
        '404':
          description: Not Found
      operationId: get-v4-console-api-projects-projectId-las
      description: Get last environment used.
    post:
      summary: Update Last Project Environment
      operationId: post-v4-console-api-projects-PROJECT_ID-las
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LastEnvironment.v1'
        '403':
          description: Access Denied.
        '404':
          description: Not Found
        '409':
          description: Environment is not in Project
      description: Update last environment used
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                environment:
                  type: integer
                  example: 123
                  description: Environment Id
              required:
                - environment
      tags:
        - Projects
  /v4/console/api/project-types:
    get:
      summary: Get Projects' Type
      tags:
        - Projects
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectType'
      operationId: get-v4-console-api-project-types
      description: Get all project's type
  /v4/console/api/server/{id}:
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: to fill
    get:
      summary: Get Server
      tags:
        - Server
      description: to fill
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: ''
                type: object
                properties:
                  id:
                    type: number
                  name:
                    type: string
                    minLength: 1
                  token:
                    type: string
                    minLength: 1
                  branch:
                    type: string
                    minLength: 1
                  replicas:
                    type: number
                  aiType:
                    type: string
                  multi_lang:
                    type: boolean
                  status:
                    type: string
                    minLength: 1
                  contexts:
                    type: array
                    uniqueItems: true
                    minItems: 1
                    items:
                      required:
                        - id
                        - name
                        - type
                        - countInteractions
                      properties:
                        id:
                          type: number
                        name:
                          type: string
                          minLength: 1
                        langs:
                          type: array
                          items:
                            properties: {}
                        type:
                          type: string
                          minLength: 1
                        countInteractions:
                          type: number
                required:
                  - id
                  - name
                  - token
                  - branch
                  - replicas
                  - aiType
                  - multi_lang
                  - status
                  - contexts
                x-examples:
                  example-1:
                    id: 11
                    name: v3.13_beta_test
                    token: f7cade1dae742a73a0072a76eeb118f5
                    branch: v3.13_prod
                    replicas: 1
                    aiType: ''
                    multi_lang: false
                    status: started
                    contexts:
                      - id: 10
                        name: aaa
                        langs:
                          - fr
                          - en
                        type: context
                        countInteractions: 1
              examples:
                example-1:
                  value:
                    id: 11
                    name: v3.13_beta_test
                    token: f7cade1dae742a73a0072a76eeb118f5
                    branch: v3.13_prod
                    replicas: 1
                    aiType: prod
                    multi_lang: false
                    status: started
                    contexts:
                      - id: 10
                        name: aaa
                        langs:
                          - fr
                          - en
                        type: context
                        countInteractions: 1
      operationId: get-v4-console-api-server-id
  /v4/console/api/project/{projectId}/environment:
    parameters:
      - schema:
          type: string
        name: projectId
        in: path
        required: true
        description: Project ID
    post:
      summary: Post Environment
      description: This endpoint allow users to create Environments in a Project.
      operationId: post-v4-console-api-project-projectId-environment
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment.v2'
              examples:
                simple:
                  value:
                    id: 15
                    name: client-prod
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                description: ''
                x-examples:
                  example-1:
                    code: 400
                    message: >-
                      Name "client-demo" already used for an environment in this
                      project.
                oneOf:
                  - properties:
                      code:
                        type: number
                      message:
                        type: string
                        minLength: 1
                    required:
                      - code
                      - message
                type: object
              examples:
                name-taken:
                  value:
                    code: 400
                    message: >-
                      Name "client-demo" already used for an environment in this
                      project.
        '401':
          description: Unauthorized
        '404':
          description: Not Found
      requestBody:
        content:
          application/json:
            schema:
              description: ''
              type: object
              x-examples:
                example-1:
                  name: aaaa
              properties:
                name:
                  type: string
                  minLength: 1
                  description: The name of the new environment
              required:
                - name
            examples:
              simple:
                value:
                  name: client-demo
          application/xml:
            schema:
              type: object
              properties: {}
          text/plain:
            schema:
              description: ''
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
              required:
                - name
              x-examples:
                example-1:
                  name: aaaa
        description: t
      tags:
        - Environment
  /v4/console/api/project/{projectId}/environment{environmentId}:
    parameters:
      - schema:
          type: string
        name: projectId
        in: path
        required: true
        description: Project ID
      - schema:
          type: string
        name: environmentId
        in: path
        required: true
        description: Environment ID
    patch:
      summary: Edit Environment
      operationId: patch-v4-console-api-project-projectId-environment-environmentId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Environment.v2'
              examples:
                simple:
                  value:
                    id: 15
                    name: client-prod
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                description: ''
                x-examples:
                  example-1:
                    code: 400
                    message: >-
                      Name "eaze" already used for an environment in this
                      project.
                oneOf:
                  - properties:
                      code:
                        type: number
                      message:
                        type: string
                        minLength: 1
                    required:
                      - code
                      - message
                type: object
              examples:
                name-taken:
                  value:
                    code: 400
                    message: >-
                      Name "client-demo" already used for an environment in this
                      project.
        '404':
          description: Not Found
      requestBody:
        content:
          application/json:
            schema:
              description: ''
              x-examples:
                example-1:
                  name: client-demo
              oneOf:
                - properties:
                    code:
                      type: integer
                    message:
                      type: string
                  required:
                    - code
              type: object
            examples:
              simple:
                value:
                  name: client-demo
                  code: 1
        description: ''
      description: Manipulate Environment
      tags:
        - Environment
    delete:
      description: Delete environment
      summary: Delete environment
      operationId: delete-v4-console-api-project-projectId-environment-environmentId
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
      tags:
        - Environment
  /organisations:
    get:
      summary: List organisations
      tags:
        - Organisation
      operationId: list-organisations
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Organisation'
              examples:
                Example:
                  value:
                    - id: '1'
                      name: organisation1
                      createdAt: '1970-01-01T00:00:00+00:00'
                    - id: '2'
                      name: organisation2
                      createdAt: '1970-01-02T00:00:00+00:00'
  /organisations/{id}:
    get:
      summary: Get Organisation Information
      tags:
        - Organisation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  name:
                    type: string
                  createdAt:
                    type: string
                    format: date-time
                  permissions:
                    type: array
                    items:
                      type: string
              examples:
                Example:
                  value:
                    id: 1
                    name: project's name
                    createdAt: '2019-08-24T14:15:22Z'
                    permissions:
                      - ROLE_ORGANISATION_ADMIN
      operationId: get-organisation
      description: Get organisation information
    patch:
      summary: Rename organisation
      tags:
        - Organisation
      operationId: patch-organisation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organisation'
              examples:
                Example:
                  value:
                    id: 1
                    name: project's name
                    createdAt: '2019-08-24T14:15:22Z'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
            examples:
              Example:
                value:
                  name: new organisation name
      description: Rename an organisation
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: Organisation ID
  /organisations/{id}/users:
    get:
      summary: List Organisation users
      tags:
        - Organisation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'
              examples:
                Example:
                  value:
                    - id: 1
                      email: golem@golem.ai
                      roles:
                        - ROLE_ORGANISATION_ADMIN
                      active: true
                      position: null
                      lastname: golem
                      firstname: golem
                      username: golem@golem.ai
                      recoveryToken: 72bd57c1158ec12872cb21bd6d307901de36d9c03
                      recoveryTokenExpirationDate: '1970-01-01T00:00:00+00:00'
                      isHosted: true
        '403':
          description: Access Denied.
        '404':
          description: Not found
      operationId: get-organisation-users
      description: List organisation users
    post:
      summary: Organisation User
      tags:
        - Organisation
      operationId: post-organisation-users
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                roles:
                  type: array
                  items:
                    type: string
                position:
                  type: string
              required:
                - email
            examples:
              Example:
                value:
                  email: golem@golem.ai
                  roles:
                    - ROLE_ORGANISATION_ADMIN
                  position: Dev Ops
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  username:
                    type: string
              examples:
                Example:
                  value:
                    id: 1
                    username: golem
        '403':
          description: Access Denied
        '404':
          description: User not found
        '409':
          description: User 'name' is already in organisation 'organisation name'
      description: Invite an existing user to an organisation.
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: Organisation ID
  /organisations/{organisationId}/users{userId}:
    parameters:
      - schema:
          type: integer
        name: userId
        in: path
        required: true
        description: User ID
      - schema:
          type: integer
        name: organisationId
        in: path
        required: true
        description: Organisation ID
    get:
      summary: Get User from Organisation by id
      tags:
        - Organisation
      operationId: get-organisation-user-by-id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  position:
                    type: string
                  lastname:
                    type: string
                  firstname:
                    type: string
              examples:
                Example:
                  value:
                    id: 1
                    position: Dev Ops
                    lastname: golem
                    firstname: golem
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      description: Get a user by id from your organisation
    delete:
      summary: Removing User from Organisation
      tags:
        - Organisation
      operationId: delete-organisation-user-username
      responses:
        '204':
          description: No Content
        '403':
          description: Access Denied.
        '404':
          description: Not Found
        '409':
          description: Cannot self kick
      description: Remove a user from your organisation
    patch:
      summary: Update User in Organisation
      operationId: patch-organisations-users-id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
                  firstname:
                    type: string
                  id:
                    type: integer
                  lastname:
                    type: string
                  position:
                    type: string
                  username:
                    type: string
              examples:
                Example:
                  value:
                    id: 1
                    email: golem@golem.ai
                    position: Dev Ops
                    lastname: golem
                    firstname: golem
                    username: golem
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                position:
                  type: string
                email:
                  type: string
                firstname:
                  type: string
                lastname:
                  type: string
      tags:
        - Organisation
      description: Modify information of a user in your organisation
  /organisations/{organisationId}/users/{userId}/roles:
    put:
      summary: Add Roles to User in Organisation
      tags:
        - Organisation
      operationId: put-organisation-user-roles
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                roles:
                  type: array
                  items:
                    type: string
              required:
                - roles
            examples:
              Example:
                value:
                  roles:
                    - ROLE_ORGANISATION_ADMIN
      responses:
        '204':
          description: No Content
        '403':
          description: Access Denied. / Can't find role 'role name'
        '404':
          description: Not Found
        '409':
          description: Cannot update self permissions
      description: Add roles to an user in your organisation
    delete:
      summary: Remove Roles to User in Organisation
      tags:
        - Organisation
      operationId: delete-organisation-user-roles
      responses:
        '200':
          description: OK
        '403':
          description: Access Denied. / Can't find role 'role name'
        '404':
          description: Not Found
        '409':
          description: Cannot update self permissions
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                roles:
                  type: array
                  items:
                    type: string
              required:
                - roles
            examples:
              Example:
                value:
                  roles:
                    - ROLE_ORGANISATION_ADMIN
      description: Remove permissions to a user
    parameters:
      - schema:
          type: integer
        name: organisationId
        in: path
        required: true
        description: Organisation ID
      - schema:
          type: integer
        name: userId
        in: path
        required: true
        description: User ID
  /organisations/{organisationId}/users/{userId}/password:
    parameters:
      - schema:
          type: integer
        name: organisationId
        in: path
        required: true
        description: Organisation ID
      - schema:
          type: integer
        name: userId
        in: path
        required: true
        description: User Id
    post:
      tags:
        - Organisation
      summary: Generate Password Token for User in Organisation
      operationId: post-organisations-users-id-password
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
              examples:
                Example:
                  value:
                    token: c6c202523ff5e46adb55ed86b3945afc2cb7b0aa
        '403':
          description: Access Denied.
        '404':
          description: Not Found
        '409':
          description: Cannot update self permissions
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                recovery_url:
                  type: string
              required:
                - recovery_url
            examples:
              Example-Local:
                value:
                  recovery_url: >-
                    http://api.console.golem.ai/reset-password/c6c202523ff5e46adb55ed86b3945afc2cb7b0aa
              Example-Prod:
                value:
                  recovery_url: >-
                    http://console.golem.ai/reset-password/c6c202523ff5e46adb55ed86b3945afc2cb7b0aa
      description: >-
        Generate a reset password token to a user and send him a mail with the
        link
  /organisations/invites:
    get:
      summary: List my Organisation Invites
      tags:
        - Organisation
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    token:
                      type: string
                    createdAt:
                      type: string
                      format: date-time
                    organisation:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
              examples:
                Example:
                  value:
                    createdAt: '1970-00-00T00:00:00+00:00'
                    organisation:
                      id: 1
                      name: organisation name
                    token: c6c202523ff5e46adb55ed86b3945afc2cb7b0aa
      operationId: get-organisations-invites
      description: Listing all organisation invites for current user
  /v4/console/api/environment/{environmentId}/inboxCare/customFields:
    parameters:
      - schema:
          type: integer
        name: environmentId
        in: path
        required: true
        description: Environment's Id
        example: 1
    post:
      summary: Create Custom Field
      operationId: post-custom-fields
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomField'
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      description: Create a Custom Field for an Environment
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type: string
                  description: Custom Field label
                  example: otherAttachments
                name:
                  type: string
                  description: Custom Field technical name
                  example: Field for other attachments
                required:
                  type: boolean
                  description: Is Custom Field required in Analysis
                  example: true
                type:
                  type: string
                  enum:
                    - body
                    - attachment
                  description: Type of the Custom Field
                  example: body
              required:
                - label
                - name
                - required
                - type
      tags:
        - Custom Fields
    get:
      summary: Get All Custom Fields For An Environment
      operationId: get-custom-fields
      description: Get all custom fields with an environment id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      tags:
        - Custom Fields
  /v4/console/api/environment/{environmentId}/inboxCare/customFields/{customFieldId}:
    parameters:
      - schema:
          type: integer
        name: environmentId
        in: path
        required: true
        description: Environment's Id
        example: 1
      - schema:
          type: integer
        name: customFieldId
        in: path
        required: true
        description: Custom Field's Id
        example: 1
    patch:
      summary: Update Custom Field
      operationId: update-custom-fields
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomField'
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      description: Update a Custom Field
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type: string
                  description: Custom Field label
                  example: otherAttachments
                name:
                  type: string
                  description: Custom Field technical name
                  example: Field for other attachments
                active:
                  type: boolean
                  description: Is Custom Field active
                  example: true
                required:
                  type: boolean
                  description: Is Custom Field required in Analysis
                  example: true
                type:
                  type: string
                  enum:
                    - body
                    - attachment
                  description: Type of the Custom Field
                  example: body
      tags:
        - Custom Fields
    delete:
      summary: Delete a Custom Field
      operationId: delete-custom-fields
      description: Delete a Custom Field From an Environment
      responses:
        '204':
          description: No Content
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      tags:
        - Custom Fields
  /organisations/invites/{token}:
    parameters:
      - schema:
          type: string
        name: token
        in: path
        required: true
        description: Invite token
    put:
      summary: Accept Invitation
      operationId: put-organisations-invites-token
      responses:
        '204':
          description: No Content
      description: Accept an invitation.
      tags:
        - Organisation
  /users/password/forgotten/check/{token}:
    parameters:
      - schema:
          type: string
        name: token
        in: path
        required: true
        description: Reset password token
    get:
      summary: Check Token Password
      operationId: get-user_password_forgotten_check
      responses:
        '204':
          description: No Content
        '404':
          description: Not Found
      description: Verify the token is valid
      tags:
        - Password
  /users/password/forgotten/send:
    post:
      summary: Send Reset Password Token By Email
      operationId: post-user_password_forgotten
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
        '404':
          description: Not Found
      description: Generate reset password token and send it by email
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  example: my-email@golem.ai
                  description: Your email to receive the link to reset your password
                recovery_url:
                  type: string
                  example: http://api.console.golem.ai/reset-password/**MyToken**
                  description: Url Sent in the Mail
              required:
                - email
                - recovery_url
      tags:
        - Password
  /users/password/forgotten:
    put:
      summary: Update Password With Token
      operationId: put-user_password_forgotten_update
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
        '404':
          description: Not Found
      description: Update your password
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                  description: User's Password Recovery Token
                  example: skldldfjdsfjsknrZdkdzl3439ds3
                password:
                  type: string
                  example: myNewPassword*2
                  format: password
                passwordConfirmation:
                  type: string
                  example: myNewPassword*2
                  format: password
              required:
                - token
                - password
                - passwordConfirmation
      tags:
        - Password
  /v2/interactions:
    get:
      summary: Get All Interactions
      tags:
        - Interaction
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Interaction'
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      operationId: get-v2-interactions
      description: Get all Interactions of one Environment
      parameters:
        - schema:
            type: integer
          in: query
          name: environmentId
          description: Id of the Environment
          required: true
        - schema:
            type: integer
          in: query
          name: contextId
          description: To filter by contextId
          required: false
    post:
      summary: Create Interaction
      tags:
        - Interaction
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Interaction'
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                idInteraction:
                  type: string
                  description: Interaction's Name
                  example: foo
                enabled:
                  type: boolean
                  description: Is Interaction enable (false by default)
                  example: true
                ordonned:
                  type: boolean
                  description: >-
                    Are Interaction's Parameter Ordonned By Order (false by
                    default)
                  example: true
                contextId:
                  type: integer
                  description: Context Id's
                  example: 1
              required:
                - idInteraction
                - contextId
      operationId: create-v2-interaction
      description: Create an Interaction for a Context
  /v2/interactions/{interactionId}:
    delete:
      summary: Delete Interaction
      tags:
        - Interaction
      responses:
        '204':
          description: No Content
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      operationId: delete-v2-interaction
      description: Delete An Interaction
    get:
      summary: Get An Interaction
      tags:
        - Interaction
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Interaction'
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      operationId: get-v2-interaction
      description: Get One Interaction With Id
    parameters:
      - schema:
          type: integer
        name: interactionId
        in: path
        required: true
        description: Id of the Interaction
    patch:
      summary: Update An Interaction
      operationId: patch-v2-interactions-interactionId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Interaction'
        '403':
          description: Access Denied.
        '404':
          description: Not Found
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                idInteraction:
                  type: string
                  description: Interaction's Name
                  example: bar
                enabled:
                  type: boolean
                  description: Is Interaction Enable
                  example: true
                ordonned:
                  type: boolean
                  description: Are Interaction's Parameter Ordonned By Order
                  example: true
                parameters:
                  type: array
                  items:
                    type: object
                    properties:
                      event:
                        type: string
                      payload:
                        type: object
                        properties:
                          archetype:
                            type: string
                          multiple:
                            type: boolean
                          optional:
                            type: boolean
                          resetConversation:
                            type: boolean
                          idParameter:
                            type: string
                      id:
                        type: integer
                functions:
                  type: array
                  items:
                    type: object
                    properties:
                      event:
                        type: string
                        description: Command to execute (add, update, remove)
                        example: IsAfterFoo
                      id:
                        type: integer
                        description: Function's Id (Not Required)
                        example: 1
                      payload:
                        type: object
                        properties:
                          name:
                            type: string
                          functionName:
                            type: string
                          functionParameters:
                            type: object
                            properties:
                              '**paramName**':
                                type: string
                                example: foo
                    required:
                      - event, properties
      description: Update an Interaction
      tags:
        - Interaction
components:
  schemas:
    AccessKey_Get.v1:
      title: AccessKey_Get
      type: object
      description: When we get an access key.
      properties:
        id:
          type: string
          example: 5798f36a-7ddc-406e-92d9-1b2483883c16
          description: AccessKey's ID
        name:
          type: string
          example: myConsoleAccessKey
          description: AccessKey's name
        createdAt:
          type: string
          description: AccessKey's creation date
          example: '2021-04-15T14:41:10+00:00'
        project:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
      required:
        - id
        - name
        - createdAt
    AccessKey_Create.v1:
      title: AccessKey_Create
      type: object
      description: When we create an access key..
      properties:
        id:
          type: string
          example: 5798f36a-7ddc-406e-92d9-1b2483883c16
          description: AccessKey's ID
        name:
          type: string
          example: myConsoleAccessKey
          description: AccessKey's name
        createdAt:
          type: string
          example: '2021-04-15T14:41:10+00:00'
          description: AccessKey's creation date
        secret:
          type: string
          example: b24f431a67edf5595925150610c162d0d7479303
          description: AccessKey's secret token
        project:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
      required:
        - id
        - name
        - createdAt
        - secret
    OrganisationMember:
      title: OrganisationMember
      type: object
      properties:
        active:
          type: boolean
          example: true
          description: Is User Active In Organisation
        id:
          type: integer
          example: 1
          description: Organisation ID
        name:
          type: string
          example: Organisation name
          description: Organisation's name
        roles:
          type: array
          items:
            type: string
          description: User roles in the Organisation
        position:
          type: string
          example: Dev Ops
          description: User's position in the Organisation
    UserOrganisation:
      title: User
      type: object
      properties:
        id:
          type: integer
          example: 1150
          description: User ID
        username:
          type: string
          example: anne-sophie.tanguy@golem.ai
          description: User's Username
        lastname:
          type: string
          nullable: true
          example: Tanguy
          description: User's lastname
        firstname:
          type: string
          nullable: true
          example: Anne-Sophie
          description: User's firstname
        email:
          type: string
          example: anne-sophie.tanguy@golem.ai
          description: User's email
        isAdmin:
          type: boolean
          example: true
          description: Is User Amin
        canGhost:
          type: boolean
          example: true
          description: Can User Ghost Other Users
        isGhost:
          type: boolean
          example: true
          description: Is User Ghost
        organisation:
          type: array
          items:
            $ref: '#/components/schemas/OrganisationMember'
        hostOrganisation:
          type: object
          properties:
            id:
              type: integer
              example: 1
              description: Organisation ID
            name:
              type: string
              example: organisation name
              description: Organisation's name
    UserAuditLog:
      title: User
      type: object
      properties:
        id:
          type: integer
        email:
          type: string
        firstname:
          type: string
        lastname:
          type: string
    ProjectAuditLog:
      title: Project
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
    EnvironmentAuditLog:
      title: Environment
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
    AuditLog:
      title: AuditLog
      type: object
      properties:
        id:
          type: string
          format: uuid
        user:
          $ref: '#/components/schemas/UserAuditLog'
        project:
          $ref: '#/components/schemas/ProjectAuditLog'
        environment:
          type: array
          items:
            $ref: '#/components/schemas/EnvironmentAuditLog'
        event:
          type: string
        description:
          type: string
        date:
          type: string
          format: date-time
        metadata:
          type: object
        accessKey:
          type: string
    OrganisationLight:
      title: Organisation
      type: object
      properties:
        id:
          type: integer
          description: Organisation Id
          example: 1
        name:
          type: string
          description: Organisation's name
          example: organisation name
    Environment.v1:
      title: Environment
      type: object
      properties:
        id:
          type: integer
          description: Environment's ID
          example: 7652
        name:
          type: string
          description: Environment's name
          example: dev
        isProduction:
          type: boolean
          description: Is production
          example: false
        createdAt:
          description: Environment's creation date
          example: '1970-00-00T00:00:00+00:00'
        extractor:
          type: integer
          description: Environment's extractors
          example: 3
          nullable: true
        langs:
          type: array
          items:
            type: string
      required:
        - id
        - name
        - createdAt
      description: Console environment
    Project:
      title: Project
      type: object
      description: |-
        A project can be: 
        - NLU
        - InboxCare
      properties:
        id:
          type: integer
          description: Project ID
          example: 3190
        name:
          type: string
          description: Project name
          example: myProject
        createdAt:
          type: string
          format: date-time
          description: Creation date of Project
          example: '1970-00-00T00:00:00+00:00'
        organisation:
          $ref: '#/components/schemas/OrganisationLight'
        projectKind:
          type: string
          description: Project Kind, IC or NLU
          example: NLU
        lastEnv:
          type: integer
          nullable: true
          description: Last environment used by the user that initiated the request.
        environments:
          type: array
          description: Project's environments
          items:
            $ref: '#/components/schemas/Environment.v1'
      required:
        - id
        - name
        - projectKind
        - environments
        - lastEnv
    ProjectWithPermissions:
      title: Project
      type: object
      description: |-
        A project can be: 
        - NLU
        - InboxCare
      properties:
        id:
          type: integer
          description: Project ID
          example: 3190
        name:
          type: string
          description: Project name
          example: myProject
        createdAt:
          type: string
          format: date-time
          description: Creation date of Project
          example: '1970-00-00T00:00:00+00:00'
        organisation:
          $ref: '#/components/schemas/OrganisationLight'
        projectKind:
          type: string
          description: Project's type. NLU or IC
          example: IC
        lastEnv:
          type: integer
          nullable: true
          description: Last environment used by the user that initiated the request.
        environments:
          type: array
          description: Project's environments
          items:
            $ref: '#/components/schemas/Environment.v1'
        permissions:
          type: array
          description: Project's permissions
          items:
            type: string
            example: ROLE_ORGANISATION_ADMIN
      required:
        - id
        - name
        - projectKind
        - environments
        - lastEnv
    LastEnvironment.v1:
      title: LastEnvironment
      type: object
      description: Last environment used
      properties:
        id:
          type: integer
          example: 7661
          description: Last environment's ID
        name:
          type: string
          description: Last environment's name
          example: dev
        createdAt:
          type: string
          description: Last environment's created date
          example: '1970-00-00T00:00:00+00:00'
        project:
          type: object
          description: Last environment's project
          properties:
            id:
              type: integer
              description: Project's ID
              example: 3193
            url:
              type: string
              description: Project's URL
              example: http://api.console.golem.ai/v4/console/api/project/3193
    ProjectType:
      title: ProjectType
      type: object
      properties:
        id:
          type: integer
          description: Project type ID. 1 NLU, 2 InboxCare
          enum:
            - 1
            - 2
          example: 1
        name:
          type: string
          description: Project type name
          example: NLU Studio
        description:
          type: string
          description: Project's description
          example: >-
            The Mail Studio allow you to create your own tool to automated and
            get analyzed mails.
        icon:
          type: string
          description: Project type icon
          example: nlu
        url:
          type: string
          description: Project type URL
          example: http://api.console.golem.ai/v4/console/api/project-type/1
      required:
        - id
        - name
        - icon
        - url
    Environment.v2:
      title: Environment.v2
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
      description: >-
        Lighter Environment representation. Should be the only one used in new
        routes.
      x-tags:
        - Environment
    Organisation:
      title: Organisation
      x-stoplight:
        id: 2u0dilt2c1tm0
      type: object
      properties:
        id:
          type: integer
          description: Organisation Id
          example: 1
        name:
          type: string
          description: Organisation's name
          example: Organisation name
        createdAt:
          type: string
          format: date-time
          description: Creation date of Organisation
          example: '1970-00-00T00:00:00+00:00'
    User:
      title: User
      type: object
      properties:
        id:
          type: integer
        email:
          type: string
        roles:
          type: array
          description: >-
            Roles the user has on the organisation: 

            - an array with only "ROLE_ORGANISATION_ADMIN" if an organisation
            admin

            - nothing if a regular user
        active:
          type: boolean
        position:
          type: string
          description: The position the user has in the organisation, free form
        lastname:
          type: string
        firstname:
          type: string
        username:
          type: string
          description: Login to be used to connect
        recoveryToken:
          type: string
          description: >-
            Token to reset user password with URL :
            `https://console.golem.ai/reset-password/XXX`
        recoveryTokenExpirationDate:
          type: string
          format: date-time
          description: Recovery expiration date
        isHosted:
          type: boolean
    CustomField:
      title: CustomField
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Custom Field's Id
          example: 3f6d03d1-065d-45c7-8baa-9216283e729d
        label:
          type: string
          description: Custom Field's Label
          example: otherAttachment
        name:
          type: string
          description: Custom Fields's Technical Name
          example: custom field for other attachment
        required:
          type: boolean
          description: Is Custom Field required in Analysis
          example: true
      required:
        - id
        - required
        - label
        - name
      description: A basic Custom Field
    ContextLight:
      title: ContextLight
      type: object
      properties:
        id:
          type: integer
          description: Context's Id
          example: 1
        name:
          type: string
          description: Context's name
          example: My Context
        langs:
          type: array
          items:
            type: string
            example: fr
      required:
        - id
        - name
        - langs
      description: Lighter Context representation.
    Descriptor:
      title: Descriptor
      type: object
      properties:
        '**langName**':
          type: array
          items:
            type: string
            description: Descriptor's Name
            example: foo
    Interaction:
      type: object
      properties:
        id:
          type: integer
          description: Interaction's Id
          example: 1
        context:
          $ref: '#/components/schemas/ContextLight'
        idInteraction:
          type: string
          description: Interaction's name
          example: My Interaction
        enabled:
          type: boolean
          description: Is Interaction enable (false by default)
          example: true
        functions:
          type: array
          description: List of this Interaction's functions
          items:
            type: object
            properties:
              id:
                type: integer
                description: Function's Id
                example: 1
              name:
                type: string
                description: Function's Name
                example: foo
              functionName:
                type: string
                description: Function's Technical Name
                example: IsRightAfter
              functionParameters:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      example: interactionRightBefore
                    interaction:
                      type: string
                      example: bar
        descriptors:
          $ref: '#/components/schemas/Descriptor'
        ordonned:
          type: boolean
          description: Are Interaction's Parameter Ordonned By Order (false by default)
          example: true
        parameters:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: Parameter's Id
                example: 1
              multiple:
                type: boolean
                example: true
              optional:
                type: boolean
                example: true
              idParameter:
                type: string
                example: bar
                description: Parameter's Name
              resetConversation:
                type: boolean
                example: true
              position:
                type: integer
                example: null
              archetype:
                type: object
                properties:
                  id:
                    type: integer
                    description: Archetype's Id
                    example: 1
                  name:
                    type: string
                    description: Archetype's Name
                    example: foo
              descriptors:
                $ref: '#/components/schemas/Descriptor'
              descriptorsLeft:
                $ref: '#/components/schemas/Descriptor'
              descriptorsRight:
                $ref: '#/components/schemas/Descriptor'
  securitySchemes:
    API_Key:
      type: http
      scheme: bearer
tags:
  - name: Access Keys
  - name: Custom Fields
    description: >-
      A Custom Field allow you to send extra custom infos in your Analysis,
      either text in the body or files in the attachments
  - name: Environment
  - name: Interaction
  - name: Login
  - name: Organisation
  - name: Password
  - name: Projects
  - name: Server
  - name: User
