---
openapi: 3.1.0
components:
  schemas:
    Add member request:
      type: object
      required:
      - userID
      properties:
        userID:
          type: string
          description: The user ID of the user being invited or added
    Create a device resource:
      type: object
      required:
      - name
      - serial
      properties:
        name:
          type: string
          description: Resource name
          default: My scenario name
        serial:
          type: string
          description: Device serial
          default: Serial number
    Create a resource:
      type: object
      required:
      - name
      properties:
        name:
          type: string
          description: Resource name
          default: My scenario name
    Create a scenario resource:
      type: object
      required:
      - archive
      properties:
        archive:
          type: string
          format: binary
          description: Scenario archive in ZIP format
    Create or update company logo:
      type: object
      required:
      - logo
      properties:
        logo:
          type: string
          format: binary
          description: Logo in png format
    Create or update profile picture:
      type: object
      required:
      - picture
      properties:
        picture:
          type: string
          format: binary
          description: Profile picture in jpg format
    Deploy or undeploy resource on another resource:
      type: object
      required:
      - target
      - what
      - action
      properties:
        target:
          $ref: "#/components/schemas/DeploymentRequestJobRequestResourceInput"
          type: object
          description: Target resource
        what:
          $ref: "#/components/schemas/DeploymentRequestJobRequestResourceInput"
          type: object
          description: Object to deploy on resource
        action:
          $ref: "#/components/schemas/DeploymentRequestJobRequestActionInput"
          type: string
          description: Deploy or Undeploy ?
    Deploy or undeploy resources:
      type: object
      required:
      - requests
      properties:
        requests:
          type: array
          items:
            $ref: "#/components/schemas/Deploy or undeploy resource on another resource"
          description: Deploy or undeploy resource
        note:
          type:
          - string
          - "null"
          description: An optional note
    DeploymentFlux:
      type: object
      required:
      - id
      - jobID
      - target
      - what
      properties:
        id:
          type: string
        jobID:
          type: string
        note:
          type:
          - string
          - "null"
        target:
          $ref: "#/components/schemas/DeploymentResourceFlux"
        what:
          $ref: "#/components/schemas/DeploymentResourceFlux"
    DeploymentRequestJobRequestActionInput:
      type: string
      enum:
      - DEPLOY
      - UNDEPLOY
    DeploymentRequestJobRequestResourceInput:
      type: object
      required:
      - type
      - id
      properties:
        type:
          $ref: "#/components/schemas/ResourceType"
          type: string
          description: Resource type
        id:
          type: string
          description: Resource ID
        subId:
          type:
          - string
          - "null"
          description: Optional sub-resource ID
    DeploymentRequestJobResultActionFlux:
      type: string
      enum:
      - DEPLOY
      - UNDEPLOY
    DeploymentRequestJobResultActionStateCauseFlux:
      type: string
      enum:
      - NONE
      - TAGET_NOT_FOUND
      - WHAT_NOT_FOUND
      - ALREADY_DEPLOYED
      - ALREADY_UNDEPLOYED
      - NOT_IMPLEMENTED
    DeploymentRequestJobResultActionStateFlux:
      type: string
      enum:
      - SUCCESS
      - FAILURE
    DeploymentRequestJobResultFlux:
      type: object
      required:
      - id
      - target
      - what
      - action
      - state
      properties:
        id:
          type: string
        target:
          $ref: "#/components/schemas/DeploymentRequestJobResultResourceFlux"
        what:
          $ref: "#/components/schemas/DeploymentRequestJobResultResourceFlux"
        action:
          $ref: "#/components/schemas/DeploymentRequestJobResultActionFlux"
        state:
          $ref: "#/components/schemas/DeploymentRequestJobResultActionStateFlux"
        cause:
          anyOf:
          - $ref: "#/components/schemas/DeploymentRequestJobResultActionStateCauseFlux"
          - type: "null"
    DeploymentRequestJobResultResourceFlux:
      type: object
      required:
      - type
      - id
      properties:
        type:
          $ref: "#/components/schemas/ResourceType"
        id:
          type: string
        subId:
          type:
          - string
          - "null"
    DeploymentResourceFlux:
      type: object
      required:
      - type
      - id
      properties:
        type:
          $ref: "#/components/schemas/ResourceType"
        id:
          type: string
        subId:
          type:
          - string
          - "null"
        resource:
          anyOf:
          - $ref: "#/components/schemas/ResourceFlux"
          - type: "null"
    Execute a command on a device:
      type: object
      required:
      - command
      - payload
      properties:
        command:
          type: string
          description: Command
          default: RESTART
        payload:
          type: object
          additionalProperties: {}
          description: Paylone
          default: {}
    LocalDateTime:
      type: string
      format: date-time
      examples:
      - 2022-03-10T12:15:50
    Motd:
      type: object
      required:
      - versions
      properties:
        versions:
          type: array
          items:
            $ref: "#/components/schemas/MotdVersion"
        maintenance:
          anyOf:
          - $ref: "#/components/schemas/MotdMaintenance"
          - type: "null"
        message:
          anyOf:
          - $ref: "#/components/schemas/MotdMessage"
          - type: "null"
    MotdMaintenance:
      type: object
      required:
      - start
      - title
      - description
      properties:
        start:
          $ref: "#/components/schemas/LocalDateTime"
        end:
          anyOf:
          - $ref: "#/components/schemas/LocalDateTime"
          - type: "null"
        title:
          type: string
        description:
          type: string
        link:
          type:
          - string
          - "null"
    MotdMessage:
      type: object
      required:
      - title
      - message
      properties:
        title:
          type: string
        message:
          type: string
        link:
          type:
          - string
          - "null"
    MotdVersion:
      type: object
      required:
      - type
      - version
      - name
      - description
      - items
      properties:
        id:
          type: integer
          format: int64
        type:
          $ref: "#/components/schemas/MotdVersionType"
        version:
          type: string
        name:
          type: string
        description:
          type: string
        items:
          type: array
          items:
            $ref: "#/components/schemas/MotdVersionItem"
    MotdVersionItem:
      type: object
      required:
      - id
      - type
      - name
      - description
      properties:
        id:
          type: string
        type:
          $ref: "#/components/schemas/MotdVersionItemType"
        name:
          type: string
        description:
          type: string
    MotdVersionItemType:
      type: string
      enum:
      - FEATURE
      - FIX
      - AGENT
      - DEVICE
    MotdVersionType:
      type: string
      enum:
      - ANDROID
      - API
    ResourceFlux:
      type: object
      required:
      - id
      - company
      - type
      - name
      - description
      - created
      - updated
      properties:
        id:
          type: string
        company:
          $ref: "#/components/schemas/ResourceFluxCompany"
        type:
          $ref: "#/components/schemas/ResourceType"
        name:
          type: string
        description:
          type: string
        created:
          $ref: "#/components/schemas/LocalDateTime"
        updated:
          $ref: "#/components/schemas/LocalDateTime"
        resource:
          anyOf:
          - $ref: "#/components/schemas/ResourceFluxPayload"
          - type: "null"
    ResourceFluxCompany:
      type: object
      required:
      - id
      - name
      properties:
        id:
          type: string
        name:
          type: string
    ResourceFluxPayload:
      type: object
    ResourcePatch:
      type: object
      properties:
        operations:
          type: array
          items:
            $ref: "#/components/schemas/ResourcePatchOperation"
    ResourcePatchOperation:
      type: object
      properties:
        operation:
          $ref: "#/components/schemas/ResourcePatchOperationType"
        path:
          type: string
        value: {}
    ResourcePatchOperationType:
      type: string
      enum:
      - Add
      - Replace
      - Remove
      - Move
      - Copy
      - Test
    ResourceQuotaFlux:
      type: object
      required:
      - type
      - spaceUsed
      properties:
        type:
          $ref: "#/components/schemas/ResourceType"
        spaceUsed:
          type: number
    ResourceSearchQuerySortDirection:
      type: string
      enum:
      - ASC
      - DESC
    ResourceType:
      type: string
      enum:
      - SCENARIO
      - DIRECTORY
      - DEVICE
    ResourcesQuotaFlux:
      type: object
      required:
      - spaceAvailable
      - spaceUsed
      - spaceUsedByResources
      properties:
        spaceAvailable:
          type: number
        spaceUsed:
          type: number
        spaceUsedByResources:
          type: array
          items:
            $ref: "#/components/schemas/ResourceQuotaFlux"
    ResponseFlux:
      type: object
      properties:
        item: {}
        subItem: {}
  securitySchemes:
    Keycloak:
      description: Authentication
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://auth.wogeez.com/realms/wogeez/protocol/openid-connect/auth
tags:
- name: Companies
  description: Companies management
- name: Message of the day
  description: "Message of the day, maintenance and versions"
- name: Profile
  description: Profile management
- name: Resources
  description: Resources management
- name: Resources Search
  description: Resources search
  externalDocs:
    description: Developer Guide
    url: https://doc.wogeez.com/developer-guide/api-interaction-resources-search/
- name: Resources devices
  description: Resources devices management
  externalDocs:
    description: Manual
    url: https://doc.wogeez.com/user-guide/terms/resource-device/resource-device/
- name: Resources scenarios
  description: Resources scenarios management
  externalDocs:
    description: Scenario package
    url: https://doc.wogeez.com/developer-guide/scenario/package-v1/
- name: Users
  description: Users management
paths:
  /companies:
    get:
      summary: List all companies
      description: Returns list of all companies.
      tags:
      - Companies
      responses:
        "401":
          description: Not authenticated
        "200":
          description: Normal response
          content:
            application/json: {}
        "403":
          description: Not Allowed
      security:
      - Keycloak: []
  /companies/{id}/assets/logo:
    delete:
      summary: Delete company logo
      description: Delete company logo.
      tags:
      - Companies
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      responses:
        "204":
          description: Delete successful
        "400":
          description: "Can't execute request, bad arguments or request"
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
    post:
      summary: Upload company logo
      description: Upload company logo.
      tags:
      - Companies
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Create or update company logo"
        required: true
      responses:
        "200":
          description: Upload successful
          content:
            application/json: {}
        "400":
          description: "Can't execute request, bad arguments or request"
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
  /companies/{id}/assets/logo.png:
    get:
      summary: Download logo picture
      description: Download the logo picture of specified company
      tags:
      - Companies
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/octet-stream:
              schema:
                $ref: "#/components/schemas/Add member request"
        "404":
          description: Not found
  /companies/{id}/resources/deployments:
    post:
      summary: Deploy or undeploy resources
      description: Deploy or undeploy resources
      tags:
      - Resources
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Deploy or undeploy resources"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeploymentRequestJobResultFlux"
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
        "400":
          description: Bad Request
      security:
      - Keycloak: []
  /companies/{id}/resources/devices:
    post:
      summary: Declare a new device
      description: This endpoint allows you to declare a new device.
      tags:
      - Resources devices
      parameters:
      - description: Identifier of the company for which the resource will be created
        required: true
        name: id
        in: path
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Create a device resource"
        required: true
      responses:
        "200":
          description: Created
          content:
            application/json: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
        "409":
          description: Already exists
        "400":
          description: Bad Request
      security:
      - Keycloak: []
  /companies/{id}/resources/devices/{device}/hubs/{hub}/devices/{hubDevice}/commands:
    post:
      summary: Execute a remote command
      description: This endpoint allows you to execute a remote command.
      tags:
      - Resources devices
      parameters:
      - description: The device id
        required: true
        name: device
        in: path
        schema:
          type: string
      - description: The hub id
        required: true
        name: hub
        in: path
        schema:
          type: string
      - description: The hubDevice id
        required: true
        name: hubDevice
        in: path
        schema:
          type: string
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Execute a command on a device"
        required: true
      responses:
        "200":
          description: Executed
          content:
            application/json: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
        "409":
          description: Already exists
        "400":
          description: Bad Request
      security:
      - Keycloak: []
  /companies/{id}/resources/quotas:
    get:
      summary: Return resources quotas
      description: Return resources quotas
      tags:
      - Resources
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResourcesQuotaFlux"
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
  /companies/{id}/resources/scenarios:
    post:
      summary: Upload a new scenario
      description: "This endpoint allows you to upload a new scenario, including all\
        \ the necessary resources and configurations, to the system. A scenario typically\
        \ consists of a ZIP archive containing relevant files and metadata, along\
        \ with additional details provided as structured JSON data."
      tags:
      - Resources scenarios
      parameters:
      - description: Identifier of the company for which the resource will be created
        required: true
        name: id
        in: path
        schema:
          type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Create a scenario resource"
        required: true
      responses:
        "200":
          description: Created
          content:
            application/json: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
        "507":
          description: Insufficient Storage for your company
        "400":
          description: Scenario archive is invalid
      security:
      - Keycloak: []
  /companies/{id}/resources/scenarios/contexts/snapshots:
    get:
      summary: Extract scenario context
      description: Extract scenario context
      tags:
      - Resources scenarios
      parameters:
      - description: Identifier of the company for which the resource will be created
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Correlation
        required: false
        name: correlation
        in: query
        schema:
          type:
          - string
          - "null"
      - description: Device ID
        required: false
        name: deviceId
        in: query
        schema:
          type:
          - string
          - "null"
      - description: Format (default is json)
        required: false
        name: format
        in: query
        schema:
          type:
          - string
          - "null"
      - description: Mission
        required: false
        name: mission
        in: query
        schema:
          type:
          - string
          - "null"
      - description: Page (default is 0)
        required: false
        name: page
        in: query
        schema:
          type:
          - integer
          - "null"
          format: int32
      - description: "Page size (default is 30, max is 100)"
        required: false
        name: pageSize
        in: query
        schema:
          type:
          - integer
          - "null"
          format: int32
      - description: Scenario ID
        required: false
        name: scenarioId
        in: query
        schema:
          type:
          - string
          - "null"
      - description: Scenario version ID
        required: false
        name: scenarioVersionId
        in: query
        schema:
          type:
          - string
          - "null"
      responses:
        "200":
          description: Extracted
          content:
            application/json: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
  /companies/{id}/resources/scenarios/skeleton.zip:
    get:
      summary: Generate a generic scenario archive
      description: Generates and returns a ZIP archive containing a generic scenario
        template for the specified company. The archive includes the necessary skeleton
        files to initialize a new scenario.
      tags:
      - Resources scenarios
      parameters:
      - description: Identifier of the company for which the resource will be created
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Engine scenario package version (default is 1.0.0)
        required: false
        name: version
        in: query
        schema:
          type:
          - string
          - "null"
      responses:
        "200":
          description: Generated
          content:
            application/zip: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
  /companies/{id}/resources/scenarios/{scenarioId}/versions:
    post:
      summary: Create a new scenario version or replace existing scenario version
      description: "The system checks whether a version with the same number already\
        \ exists in the metadata of the archive. If such a version is found, it will\
        \ be overwritten by the one from the archive. If not, a new version will be\
        \ added to the scenario."
      tags:
      - Resources scenarios
      parameters:
      - description: Identifier of the company for which the resource will be created
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Identifier of the scenario for which the resource will be patched
        required: true
        name: scenarioId
        in: path
        schema:
          type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Create a scenario resource"
        required: true
      responses:
        "200":
          description: Version created or replaced
          content:
            application/json: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
        "507":
          description: Insufficient Storage for your company
        "400":
          description: Scenario archive is invalid
      security:
      - Keycloak: []
  /companies/{id}/resources/scenarios/{scenarioId}/versions/{scenarioVersionId}:
    delete:
      summary: Delete a scenario version
      description: Delete a scenario version
      tags:
      - Resources scenarios
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Identifier of the scenario
        required: true
        name: scenarioId
        in: path
        schema:
          type: string
      - description: Identifier of the scenario version
        required: true
        name: scenarioVersionId
        in: path
        schema:
          type: string
      responses:
        "204":
          description: Version deleted
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
  /companies/{id}/resources/scenarios/{scenarioId}/versions/{scenarioVersionId}.zip:
    get:
      summary: Retrieve a specific scenario version archive
      description: Retrieves a ZIP archive containing the files of a specific scenario
        version.
      tags:
      - Resources scenarios
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Identifier of the scenario
        required: true
        name: scenarioId
        in: path
        schema:
          type: string
      - description: Identifier of the scenario version
        required: true
        name: scenarioVersionId
        in: path
        schema:
          type: string
      responses:
        "200":
          description: Ok
          content:
            application/zip: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
  /companies/{id}/resources/{resourceId}:
    patch:
      summary: Update a resource
      description: This endpoint allows you to update resource attributes.
      tags:
      - Resources
      parameters:
      - description: Identifier of the company for which the resource will be patched
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Identifier of the resource id
        required: true
        name: resourceId
        in: path
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ResourcePatch"
        required: true
      responses:
        "204":
          description: Patched
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
        "400":
          description: Bad Request
      security:
      - Keycloak: []
    get:
      summary: Retrieve a resource
      description: This endpoint allows you to retrieve a full resource.
      tags:
      - Resources
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Identifier of the resource
        required: true
        name: resourceId
        in: path
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResponseFlux"
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
    delete:
      summary: Delete a resource
      description: This endpoint allows you to delete a resource.
      tags:
      - Resources
      parameters:
      - description: Identifier of the company for which the resource will be deleted
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Identifier of the resource for which the resource will be deleted
        required: true
        name: resourceId
        in: path
        schema:
          type: string
      responses:
        "204":
          description: Deleted
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
  /companies/{id}/resources/{resourceId}/deployments:
    get:
      summary: Get deployments for a specific resource
      description: Get deployments for a specific resource
      tags:
      - Resources
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Resource id
        required: true
        name: resourceId
        in: path
        schema:
          type: string
      - description: "Details, if true we fetch resources (target and what)"
        required: false
        name: details
        in: query
        schema:
          type: boolean
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeploymentFlux"
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
  /companies/{id}/resources/{resourceId}/files:
    get:
      summary: Retrieve resource file
      description: This endpoint allows you to retrieve a resource file.
      tags:
      - Resources
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Identifier of the resource
        required: true
        name: resourceId
        in: path
        schema:
          type: string
      - name: path
        in: query
        schema:
          type:
          - string
          - "null"
      responses:
        "200":
          description: Ok
          content:
            application/octet-stream: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
  /companies/{id}/resources/{type}/deployments:
    get:
      summary: Get deployments by resource type
      description: Get deployments by resource type
      tags:
      - Resources
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Resource type
        required: true
        name: type
        in: path
        schema:
          $ref: "#/components/schemas/ResourceType"
      - description: "Details, if true we fetch resources (target and what)"
        required: false
        name: details
        in: query
        schema:
          type: boolean
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeploymentFlux"
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
  /companies/{id}/users:
    get:
      summary: List users for a specific company
      description: List users for a specific company
      tags:
      - Users
      parameters:
      - description: Identifier of the company
        required: true
        name: id
        in: path
        schema:
          type: string
      responses:
        "200":
          description: User list
          content:
            application/json: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
      security:
      - Keycloak: []
    post:
      summary: Invite user in a specific company
      description: The invited user will automatically be assigned to the company
        they are invited to.
      tags:
      - Users
      parameters:
      - description: Identifier of the company that the invited user will join
        required: true
        name: id
        in: path
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Add member request"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Add member request"
        "400":
          description: Bad request
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
        "404":
          description: Not found
        "409":
          description: User already in this company
      security:
      - Keycloak: []
  /companies/{id}/users/{userId}:
    delete:
      summary: Remove user from a specific company
      description: "If a member is removed from a company, they are automatically\
        \ removed from all groups within that company as well. If you later decide\
        \ to invite the user back to the company, they will rejoin with default membership\
        \ (without specific permissions) and will need to be reassigned to the relevant\
        \ groups to restore previous access and roles."
      tags:
      - Users
      parameters:
      - description: Identifier of the company that the invited user will join
        required: true
        name: id
        in: path
        schema:
          type: string
      - description: Identifier of the user to delete
        required: true
        name: userId
        in: path
        schema:
          type: string
      responses:
        "200":
          description: User deleted
          content:
            application/json: {}
        "400":
          description: Bad request
        "403":
          description: Not authorized
        "404":
          description: Not found
        "401":
          description: Not Authorized
      security:
      - Keycloak: []
  /motd:
    get:
      summary: Message of the day
      description: "Message of the day, maintenance and versions"
      tags:
      - Message of the day
      parameters:
      - name: types
        in: query
        schema:
          type:
          - array
          - "null"
          items:
            $ref: "#/components/schemas/MotdVersionType"
      - name: version
        in: query
        schema:
          type:
          - string
          - "null"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Motd"
  /profile/picture:
    post:
      summary: Upload profile picture
      description: Upload profile picture.
      tags:
      - Profile
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Create or update profile picture"
        required: true
      responses:
        "200":
          description: Upload successful
          content:
            application/json: {}
        "400":
          description: "Can't execute request, bad arguments or request"
        "401":
          description: Not authenticated
        "404":
          description: Not found
        "403":
          description: Not Allowed
      security:
      - Keycloak: []
    delete:
      summary: Delete profile picture
      description: Delete profile picture.
      tags:
      - Profile
      responses:
        "204":
          description: Delete successful
        "400":
          description: Bad request
        "401":
          description: Not authenticated
        "404":
          description: Not found
        "403":
          description: Not Allowed
      security:
      - Keycloak: []
  /resources/search:
    get:
      summary: Search resources
      description: Pass filters as query parameters
      tags:
      - Resources Search
      parameters:
      - description: "Global search, filters are disabled if you use it"
        name: Global search
        required: false
        in: query
        schema:
          type:
          - string
          - "null"
      - description: "Order by field name, id by default"
        name: Order By
        required: false
        in: query
        schema:
          type:
          - string
          - "null"
      - description: "Order by direction, default is ASC"
        name: Order Direction
        required: false
        in: query
        schema:
          anyOf:
          - $ref: "#/components/schemas/ResourceSearchQuerySortDirection"
          - type: "null"
      - description: "Page (begin at 1), default is 1"
        name: Page
        required: false
        in: query
        schema:
          type:
          - integer
          - "null"
          format: int32
      - description: "Page size, default is 30, max is 50"
        name: Page Size
        required: false
        in: query
        schema:
          type:
          - integer
          - "null"
          format: int32
      responses:
        "200":
          description: Ok
          content:
            application/json: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
      security:
      - Keycloak: []
  /resources/search/filters:
    get:
      summary: Retrieve filters for search
      description: Retrieve filters for search
      tags:
      - Resources Search
      parameters:
      - description: Resource type
        required: false
        name: type
        in: query
        schema:
          anyOf:
          - $ref: "#/components/schemas/ResourceType"
          - type: "null"
      responses:
        "200":
          description: Ok
          content:
            application/json: {}
        "401":
          description: Not authenticated
        "403":
          description: Not authorized
      security:
      - Keycloak: []
  /resources/types:
    get:
      summary: Return all types of resources
      description: Return all types of resources.
      tags:
      - Resources
      responses:
        "200":
          description: Success
        "401":
          description: Not authenticated
  /resources/{type}/paths:
    get:
      summary: Return all paths of a resource type
      description: Return all paths of a resource type.
      tags:
      - Resources
      parameters:
      - description: Resource type
        required: true
        name: type
        in: path
        schema:
          $ref: "#/components/schemas/ResourceType"
      responses:
        "200":
          description: Success
        "401":
          description: Not authenticated
        "403":
          description: Not Allowed
      security:
      - Keycloak: []
  /users/search:
    get:
      summary: Search user
      description: Search a Wogeez user
      tags:
      - Users
      parameters:
      - name: q
        in: query
        schema:
          type: string
        required: true
      responses:
        "200":
          description: Successfully found users
          content:
            application/json: {}
        "401":
          description: Not authenticated
        "403":
          description: Not Allowed
      security:
      - Keycloak: []
  /users/{id}/profile/picture.jpeg:
    get:
      summary: Download profile picture
      description: Download the profile picture of specified user
      tags:
      - Users
      parameters:
      - description: Identifier of the user
        required: true
        name: id
        in: path
        schema:
          type: string
      responses:
        "200":
          description: Successfully found profile picture
          content:
            application/octet-stream: {}
        "401":
          description: Not authenticated
        "404":
          description: Not found
        "403":
          description: Not Allowed
      security:
      - Keycloak: []
info:
  title: Wogeez API prd
  version: 1.7.0
  description: Official API for Wogeez
  contact:
    name: Wogeez
    email: contact@zeegow.com
    url: https://www.wogeez.com
  license:
    name: Licence
    url: https://doc.wogeez.com/developer-guide/api-licence
