openapi: 3.0.0
info:
  description: >
    # Authentication

    All endpoints need a valid access token which can be obtained following
    either of the authentication flows detailed below.

    Both the authentication methods required a OAuth2 client. Create a OAuth2
    client for your organisation at

    [https://app.hoxton.ai/settings?tab=oauth_client](https://app.hoxton.ai/settings?tab=oauth_client),
    if not done already.


    ## Authorization Code Flow

    ![authorization code
    flow](https://s3.eu-west-1.amazonaws.com/hoxton.ai/authorization-code-flow-diagram.png)


    This method is preferred if you plan to share your oauth client credentials
    with a third part app. This method involves

    directing user to the `login` page on the authorization server. After the
    user has successfully authenticated, exchange

    authorization code received from the server to the `access_token`. This is a
    multistep method.


    - Get `authorization_code`:
      - **Endpoint**: `https://auth.hoxton.ai/authorize`
      - Parameters:

    | Parameter       | Type      |
    Description                                                                                                                              
    |

    |-----------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------|

    | `response_type` | required  | Always set this to
    `code`                                                                                                                
    |

    | `audience`      | required  | Always set this to
    `https://api.hoxton.cloud`                                                                                             
    |

    | `scope`         | optional  | A space separated list of claims to include
    in the token. Use `profile` to get ID token. Include `offline_access` to get
    *Refresh Token*. |

    | `client_id`     | required  | The oauth client's
    id                                                                                                                    
    |

    | `redirect_uri`  | required  | URL the user should be redirect to after
    successful login. This must be a valid `Allowed Callback URL` set in the
    oauth client            |


    An example authorization url would be:


    ```html

    https://auth.hoxton.ai/authorize?
        response_type=code&
        client_id=<CLIENT_ID>&
        redirect_uri=<REDIRECT_URI>&
        scope=offline_access&
        audience=https://api.hoxton.cloud
    ```


    On successful authentication, you will receive a `HTTP 302` response with
    the `authorization_code` included as a parameter.


    ```html

    HTTP/1.1 302 Found

    Location: <REDIRECT_URI>?code={authorization_code}

    ```


    - Exchange `authorization_code` to `access_token`:
      - **Endpoint**: `https://auth.hoxton.ai/oauth/token`
      - Parameters:

    | Parameter        | Type       |
    Description                                                                                                                         
    |

    |------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------|

    | `grant_type`     | required   | Always set this to
    `authorization_code`                                                                                             
    |

    | `code`           | required   | The `authorization_code` from the previous
    step                                                                                     
    |

    | `client_id`      | required   | The oauth client's
    id                                                                                                               
    |

    | `client_secret`  | required   | The oauth client's
    secret                                                                                                           
    |

    | `redirect_uri`   | required   | A valid URL configured in the oauth
    client. This must match exactly the URL passed to the authorization endpoint
    in the first step   |


    You can now exchange the `authorization_code` from the above step to the
    `access_token` by making a `POST` request to the

    token URL.


    ```shell

    curl -X POST https://auth.hoxton.ai/oauth/token
      -H 'Content-Type: application/json'
      -d '{
        "grant_type": "authorization_code",
        "code": "<code_from_authorization_step>",
        "client_id": "<CLIENT_ID>",
        "client_secret": "<CLIENT_SECRET>",
        "redirect_uri": "<REDIRECT_URI>"
      }'
    ```


    All going well, you will get a `HTTP 200` response with the `access_token`
    which is valid for `24hr`.


    ```json

    {
      "access_token": "eyJhbGc...2oSuHNwA",
      "refresh_token": "v1.MT...4XFunfTks",
      "id_token": "eyv1.KDNM3w...vPkdKvMU",
      "token_type": "Bearer",
      "expires_in": 86400
    }

    ```


    ## Client Credentials Flow


    ![client credentials
    flow](https://s3.eu-west-1.amazonaws.com/hoxton.ai/client-credentials-flow-diagram.png)


    This method should be reserved for internal use only. If you are sharing
    with third party, use `authorization code flow`

    described above. This flow is best suited for Machine-to-Machine (M2M)
    applications, such as CLIs, daemons, or

    backend services, because the system must authenticate and authorize the
    application instead of a user.


    To get the access token, make a POST request to the token URL with  the
    oauth2 client's credentials (`client_id` &

    `client_secret`). This is a single step method.


    - Get `access_token`:
      - **Endpoint**: `https://auth.hoxton.ai/oauth/token`
      - Parameters:

    | Parameter         | Type       |
    Description                                                                     
    |

    |-------------------|------------|----------------------------------------------------------------------------------|

    | `grant_type`      | required   | Always set this to
    `client_credentials`                                          |

    | `audience`        | required   | Always set this to
    `https://api.hoxton.cloud`                                    |

    | `client_id`       | required   | The oauth client's
    id                                                            |

    | `client_secret`   | required   | The oauth client's
    secret                                                        |


    Once you have the required oauth client credentials, the access token can be
    obtained from the authorization server

    by making a POST request to the token URL.


    ```shell

    curl -X POST https://auth.hoxton.ai/oauth/token
      -H 'Content-Type: application/json'
      -d '{
        "grant_type": "client_credentials",
        "audience": "https://api.hoxton.cloud",
        "client_id": "<CLIENT_ID>",
        "client_secret": "<CLIENT_SECRET>",
      }'
    ```


    If the authorization server was able to successfully validate the request,
    you will receive `HTTP 200` response with

    a payload containing `access_token` which is valid for `24hr`.


    ```json

    {
      "access_token": "eyJhbGc...2oSuHNwA",
      "token_type": "Bearer",
      "expires_in": 86400
    }

    ```


    ## Resource Owner Password Flow


    ![resource owner password
    flow](https://s3.eu-west-1.amazonaws.com/hoxton.ai/resource-owner-password-flow-diagram.png)


    This method should be reserved for internal use only. If you are sharing
    with third party, use `authorization code flow`

    described above.


    To get the access token first get the user's credentials (`username` &
    `password`). Then get the oauth2 client's

    credentials (`client_id` & `client_secret`). Finally, exchange them for
    token by making a `POST` request to the

    token URL. This is a single step method.


    - 1. Get `access_token`:
      - **Endpoint**: `https://auth.hoxton.ai/oauth/token`
      - Parameters

    | Parameter         | Type       |
    Description                                                                                                                              
    |

    |-------------------|------------|-------------------------------------------------------------------------------------------------------------------------------------------|

    | `grant_type`      | required   | Always set this to
    `password`                                                                                                            
    |

    | `audience`        | required   | Always set this to
    `https://api.hoxton.cloud`                                                                                            
    |

    | `scope`           | optional   | A space separated list of claims to
    include in the token. Use `profile` to get ID token. Include
    `offline_access` to get *Refresh Token*. |

    | `username`        | required   | The user's loging
    username                                                                                                               
    |

    | `password`        | required   | The user's login
    password                                                                                                                
    |

    | `client_id`       | required   | The oauth client's
    id                                                                                                                    
    |

    | `client_secret`   | required   | The oauth client's
    secret                                                                                                                
    |


    Once you have the required oauth client credentials, the access token can be
    obtained from the authorization server

    by making a POST request to the token URL.


    ```shell

    curl -X POST https://auth.hoxton.ai/oauth/token
      -H 'Content-Type: application/json'
      -d '{
        "grant_type": "password",
        "username": "<USERNAME>",
        "password": "<PASSWORD>",
        "audience": "https://api.hoxton.cloud",
        "scope": "offline",
        "client_id": "<CLIENT_ID>",
        "client_secret": "<CLIENT_SECRET>",
      }'
    ```


    If the authorization server was able to successfully validate the request,
    you will receive `HTTP 200` response with

    a payload containing `access_token` which is valid for `24hr`.


    ```json

    {
      "access_token": "eyJhbGc...2oSuHNwA",
      "refresh_token": "v1.MT...4XFunfTks",
      "id_token": "eyv1.KDNM3w...vPkdKvMU",
      "token_type": "Bearer",
      "expires_in": 86400
    }

    ```


    ## Refresh Token


    If you have requested `offline_access` claim in the authorisation call as
    described above, you can request a new

    `access_token` using this method.


    - 1. Get new `access_token` and `refresh_token`:
      - **Endpoint**: `https://auth.hoxton.ai/oauth/token`
      - Parameters

    | Parameter       | Type       |
    Description                                                                                                                
    |

    |-----------------|------------|-----------------------------------------------------------------------------------------------------------------------------|

    | `grant_type`    | required   | Always set this to
    `refresh_token`                                                                                         
    |

    | `scope`         | optional   | A space separated list of claims to include
    in the token. Do not set this parameter if you want to keep the original
    claims |

    | `client_id`     | required   | The oauth client's id use in the initial
    authorization
    call                                                                 |

    | `refresh_token` | required   | The `refresh_token` from the previous
    successful authorization
    call                                                         |


    To get a new `access_token` & `refresh_token`, make a `POST` request to the
    token URL.


    ```shell

    curl -X POST https://auth.hoxton.ai/oauth/token
      -H 'Content-Type: application/json'
      -d '{
        "grant_type": "refresh_token",
        "client_id": "<CLIENT_ID>",
        "scope": "offline",
        "refresh_token": "v1.MT...4XFunfTks"
      }'
    ```


    If the authorization server was able to successfully validate the request,
    you will receive `HTTP 200` response with

    a payload containing `access_token` (which is valid for `24hr`) and a
    `refresh_token`.


    ```json

    {
      "access_token": "eyJhbGc...2oSuHNwA",
      "refresh_token": "v1.MT...4XFunfTks",
      "id_token": "eyv1.KDNM3w...vPkdKvMU",
      "token_type": "Bearer",
      "expires_in": 86400
    }

    ```
  license:
    name: Proprietary
    url: https://hoxton.ai
  title: HoxtonAi API
  version: 0.0.1
  x-logo:
    altText: HoxtonAi
    url: https://app.hoxton.ai/assets/images/logo_hoxtonai.svg
paths:
  /aggregated-api-request-metrics-reports:
    post:
      description: >-
        Create a report of aggregated api request metrics for a given time range
        and list of organisations.
      operationId: CreateAggregatedAPIRequestMetricsReport
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AggregatedApiRequestMetricsReport'
        description: >-
          request aggregated api request metrics data for a set of orgs and a
          given time range.
        required: true
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/AggregatedApiRequestMetrics'
                type: array
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create aggregated api metrics report
      tags:
        - report
  /aggregated-video-metrics-reports:
    post:
      description: >-
        Create a report of aggregated camera metrics for a given time range and
        list of cameras.
      operationId: CreateAggregatedVideoMetricsReport
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AggregatedVideoMetricsReport'
        description: >-
          request aggregated video metrics data for a set of cameras and a given
          time range.
        required: true
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/AggregatedVideoMetrics'
                type: array
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create aggregated video metrics report
      tags:
        - report
  /alert-camera-position-mappings:
    get:
      description: |-
        Get all available links between alters and camera positions subject
        to filters.
      operationId: ListAlertCameraPositionMappings
      parameters:
        - description: The ID of a camera linked to the alerts.
          in: query
          name: cameraId
          schema:
            type: string
            format: uuid
        - description: The ID of an alert being linked to the camera positions.
          in: query
          name: alertId
          schema:
            type: string
            format: uuid
        - description: The ID of a camera position linked to the alerts.
          in: query
          name: cameraPositionId
          schema:
            type: string
            format: uuid
        - description: The ID of the notification group the linked alert notifies.
          in: query
          name: notificationGroupId
          schema:
            type: string
            format: uuid
        - description: The ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: Alert camera position state.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
        - description: The ID of a camera linked to the Alerts.
          in: query
          name: alertType
          schema:
            type: string
            enum:
              - offline_alert
              - occupancy_alert
              - camera_health_summary_alert
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/AlertCameraPositionMapping'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: List alert camera position mappings
      tags:
        - alertCameraPositionMapping
    put:
      description: |-
        Update a link between an alert and a camera
        position if it exists, create a new one otherwise.
      operationId: PutAlertCameraPositionMapping
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertCameraPositionMapping'
        description: The link between an alert and a camera position to store.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertCameraPositionMapping'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Create/Update alert camera position mapping
      tags:
        - alertCameraPositionMapping
  /alert-camera-position-mappings/{alertCameraPositionMappingId}:
    delete:
      description: |-
        Delete a link between an alert and a camera
        position.
      operationId: DeleteAlertCameraPositionMapping
      parameters:
        - description: >-
            The ID of the link between an alert and a camera position to be
            deleted.
          in: path
          name: alertCameraPositionMappingId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Delete alert camera position mapping
      tags:
        - alertCameraPositionMapping
    get:
      description: |-
        Get a link between an alert and a camera position
        identified by its id.
      operationId: GetAlertCameraPositionMapping
      parameters:
        - description: The ID of the link between an alert and a camera position to get.
          in: path
          name: alertCameraPositionMappingId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertCameraPositionMapping'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Get alert camera position mapping
      tags:
        - alertCameraPositionMapping
  /alert-notification-group-mappings:
    get:
      description: Get all available alert notification group mappings subject to filters.
      operationId: ListAlertNotificationGroupMappings
      parameters:
        - description: >-
            The ID of a camera position linked to the alert notification group
            mapping.
          in: query
          name: cameraPositionId
          schema:
            type: string
            format: uuid
        - description: The ID of the notification group the alerts are linked to.
          in: query
          name: notificationGroupId
          schema:
            type: string
            format: uuid
        - description: The ID of the alert the notification groups are linked to.
          in: query
          name: alertId
          schema:
            type: string
            format: uuid
        - description: The ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: The state of the alert notification group mapping.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
        - description: the ID of the occupancy monitor the alert is mapped to.
          in: query
          name: occupancyMonitorId
          schema:
            type: string
            format: uuid
        - description: The ID of a camera linked to the Alerts.
          in: query
          name: alertType
          schema:
            type: string
            enum:
              - offline_alert
              - occupancy_alert
              - camera_health_summary_alert
        - description: the ID of the site the alert rule mapping is part of.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/AlertNotificationGroupMapping'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: List alert notification group mappings
      tags:
        - alertNotificationGroupMapping
    put:
      description: >-
        Update an alert notification group link if it exists, create a new one
        otherwise.
      operationId: PutAlertNotificationGroupMapping
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertNotificationGroupMapping'
        description: The link between an alert and a notification group to store.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertNotificationGroupMapping'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Create/Update alert notification group mapping
      tags:
        - alertNotificationGroupMapping
  /alert-notification-group-mappings/{alertNotificationGroupMappingId}:
    delete:
      description: Delete an alert notification group mapping.
      operationId: DeleteAlertNotificationGroupMapping
      parameters:
        - description: The ID of the alert notification group mapping to be deleted.
          in: path
          name: alertNotificationGroupMappingId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Delete alert notification group mapping
      tags:
        - alertNotificationGroupMapping
    get:
      description: >-
        Get a mapping between an alert and a notification group identified by
        its id.
      operationId: GetAlertNotificationGroupMapping
      parameters:
        - description: The ID of the alert notification group mapping to get.
          in: path
          name: alertNotificationGroupMappingId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertNotificationGroupMapping'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Get alert notification group mapping
      tags:
        - alertNotificationGroupMapping
  /alert-occupancy-monitor-mappings:
    get:
      description: Get all links between occupancy monitors and alert subject to filters.
      operationId: ListAlertOccupancyMonitorMappings
      parameters:
        - description: the ID of the occupancy monitor the alert is mapped to.
          in: query
          name: occupancyMonitorId
          schema:
            type: string
            format: uuid
        - description: the ID of the alert the occupancy monitors are mapped to.
          in: query
          name: alertId
          schema:
            type: string
            format: uuid
        - description: the ID of the site the monitor alert rule mapping is part of.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: >-
            the ID of the organisation the site of the monitor alert rule
            mapping is part of.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: Occupancy monitor alert state.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/AlertOccupancyMonitorMapping'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: List alert occupancy monitor mappings
      tags:
        - alertOccupancyMonitorMapping
    put:
      description: |-
        Update an occupancy monitor to alert mapping if it exists, create a new
        object linking the given occupancy monitor to the given alert otherwise.
      operationId: PutAlertOccupancyMonitorMapping
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertOccupancyMonitorMapping'
        description: An occupancy monitor to alert mapping.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertOccupancyMonitorMapping'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Create/Update alert occupancy monitor mapping
      tags:
        - alertOccupancyMonitorMapping
  /alert-occupancy-monitor-mappings/{alertOccupancyMonitorMappingId}:
    delete:
      description: Set the state of an occupancy monitor to alert mapping to deleted.
      operationId: DeleteAlertOccupancyMonitorMapping
      parameters:
        - description: the ID of the occupancy monitor to alert mapping to delete.
          in: path
          name: alertOccupancyMonitorMappingId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Delete alert occupancy monitor mapping
      tags:
        - alertOccupancyMonitorMapping
    get:
      description: Get an occupancy monitor to alert mapping identified by the provided ID.
      operationId: GetAlertOccupancyMonitorMapping
      parameters:
        - description: The ID of the occupancy monitor to alert mapping.
          in: path
          name: alertOccupancyMonitorMappingId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertOccupancyMonitorMapping'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Get alert occupancy monitor mapping
      tags:
        - alertOccupancyMonitorMapping
  /alert-people-count-monitor-mappings:
    get:
      description: |-
        Get all available links between alert and people count subject
        to filters.
      operationId: ListAlertPeopleCountMonitorMappings
      parameters:
        - description: The ID of an alert being linked to the monitors.
          in: query
          name: alertId
          schema:
            type: string
            format: uuid
        - description: the ID of the site the monitor alert rule mapping is part of.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: The ID of an alert being linked to the monitors.
          in: query
          name: peopleCountMonitorId
          schema:
            type: string
            format: uuid
        - description: The ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: Alert monitor mapping state.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/AlertPeopleCountMonitorMapping'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: List alert people count mappings
      tags:
        - alertPeopleCountMonitorMapping
    put:
      description: |-
        Update a link between an alert and a monitor
        if it exists, create a new one otherwise.
      operationId: PutAlertPeopleCountMonitorMapping
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertPeopleCountMonitorMapping'
        description: The link between an alert and a monitor to store.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertPeopleCountMonitorMapping'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Create/Update alert people count mapping
      tags:
        - alertPeopleCountMonitorMapping
  /alert-people-count-monitor-mappings/{alertPeopleCountMonitorMappingId}:
    delete:
      description: Delete a link between an alert and a monitor.
      operationId: DeleteAlertPeopleCountMonitorMapping
      parameters:
        - description: The ID of the link between an alert and a monitor to be deleted.
          in: path
          name: alertPeopleCountMonitorMappingId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Delete alert people count monitor mapping
      tags:
        - alertPeopleCountMonitorMapping
    get:
      description: |-
        Get a link between an alert and a people count monitor
        identified by its id.
      operationId: GetAlertPeopleCountMonitorMapping
      parameters:
        - description: The ID of the link between an alert and a people count to get.
          in: path
          name: alertPeopleCountMonitorMappingId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertPeopleCountMonitorMapping'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Get alert people count mapping
      tags:
        - alertPeopleCountMonitorMapping
  /alerts:
    get:
      description: Get all available alerts subject to filters.
      operationId: ListAlerts
      parameters:
        - description: The ID of a camera linked to the Alerts.
          in: query
          name: alertType
          schema:
            type: string
            enum:
              - offline_alert
              - occupancy_alert
              - camera_health_summary_alert
        - description: The ID of a camera position linked to the alerts.
          in: query
          name: cameraPositionId
          schema:
            type: string
            format: uuid
        - description: The ID of the notification group the alert are sent to.
          in: query
          name: notificationGroupId
          schema:
            type: string
            format: uuid
        - description: The ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: The ID of the associated occupancy monitor.
          in: query
          name: occupancyMonitorId
          schema:
            type: string
            format: uuid
        - description: The ID of the associated site.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: Alert state.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/Alert'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: List alerts
      tags:
        - alert
    put:
      description: Update an alert if it exists, create a new one otherwise.
      operationId: PutAlert
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Alert'
        description: The configuration for an alert to store.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Create/Update alert
      tags:
        - alert
  /alerts/{alertId}:
    delete:
      description: Delete an alert.
      operationId: DeleteAlert
      parameters:
        - description: The ID of the alert to be deleted.
          in: path
          name: alertId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Delete alert
      tags:
        - alert
    get:
      description: Get an alert identified by its id.
      operationId: GetAlert
      parameters:
        - description: The ID of the alert to get.
          in: path
          name: alertId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Get alert
      tags:
        - alert
  /annotations:
    get:
      description: Get all available annotations subject to filters.
      operationId: ListAnnotations
      parameters:
        - description: The ID of a camera position linked to the annotations.
          in: query
          name: cameraPositionId
          schema:
            type: string
            format: uuid
        - description: The ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: The ID of the associated site.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: annotation state.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/Annotation'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: List annotation
      tags:
        - annotation
    put:
      description: Update an annotation if it exists, create a new one otherwise.
      operationId: PutAnnotation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Annotation'
        description: The configuration for an annotation to store.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Annotation'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Create/Update annotation
      tags:
        - annotation
  /annotations/{annotationId}:
    delete:
      description: Delete an annotation.
      operationId: DeleteAnnotation
      parameters:
        - description: The ID of the annotation to be deleted.
          in: path
          name: annotationId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Delete annotation
      tags:
        - annotation
    get:
      description: Get an annotation identified by its id.
      operationId: GetAnnotation
      parameters:
        - description: The ID of the annotation to get.
          in: path
          name: annotationId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Annotation'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Get annotation
      tags:
        - annotation
  /cameras:
    get:
      description: >-
        List all claimed cameras in the fleet along with the organisations that
        own them.
      operationId: ListCameras
      parameters:
        - description: >-
            Choose whether camera metrics should be included in the response or
            not.
          in: query
          name: includeMetrics
          schema:
            type: boolean
            default: true
        - description: >-
            The ID of the site whose list of associated cameras will be
            returned.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: The ID of a user on whose visibility of the cameras to filter on.
          in: query
          name: userId
          schema:
            type: string
            format: uuid
        - description: The camera states to filter on.
          in: query
          name: state
          required: false
          style: form
          explode: false
          schema:
            type: array
            items:
              enum:
                - running
                - paused
                - decommissioned
              type: string
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/Camera'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List cameras
      tags:
        - camera
    post:
      description: Link a camera to an organisation.
      operationId: CreateCamera
      requestBody:
        content:
          application/json:
            schema:
              properties:
                name:
                  type: string
                serialNumber:
                  type: string
                siteId:
                  format: uuid
                  type: string
              required:
                - serialNumber
                - siteId
              type: object
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Camera'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: This camera has already been claimed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create camera
      tags:
        - camera
  /cameras/{cameraId}:
    delete:
      description: Decommission a camera that is in state running or paused.
      operationId: DeleteCamera
      parameters:
        - description: the camera ID of the camera.
          in: path
          name: cameraId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete camera
      tags:
        - camera
    get:
      description: Get a camera identified by the provided camera ID.
      operationId: GetCamera
      parameters:
        - description: The full camera ID of a camera to be fetched.
          in: path
          name: cameraId
          required: true
          schema:
            type: string
            format: uuid
        - description: >-
            Choose whether camera metrics should be included in the response or
            not.
          in: query
          name: includeMetrics
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Camera'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get camera
      tags:
        - camera
    patch:
      description: >-
        Update camera name and/or direction aliases of the camera identified by
        the provided camera ID.
      operationId: PatchCamera
      parameters:
        - description: The full camera ID of a camera to be patched.
          in: path
          name: cameraId
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchCameraRequest'
        description: Update a camera's name and/or direction alias/es.
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Camera'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Patch camera
      tags:
        - camera
  /cameras/{cameraId}/move:
    post:
      description: Move camera to new site
      operationId: MoveCamera
      parameters:
        - in: path
          name: cameraId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                siteId:
                  format: uuid
                  type: string
              required:
                - siteId
              type: object
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Camera'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Content.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Move camera
      tags:
        - camera
  /cameras/{cameraId}/opening-hours:
    get:
      description: Get all attributes of a camera model given a camera ID.
      operationId: GetCameraOpeningHour
      parameters:
        - description: the camera ID of the camera
          in: path
          name: cameraId
          required: true
          schema:
            type: string
            format: uuid
        - description: Day of the year of requested Opening Hour
          in: query
          name: date
          schema:
            type: string
            format: date
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  format: date-time
                  type: string
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get camera opening hour
      tags:
        - camera
  /cameras/{cameraId}/state/{newState}:
    put:
      description: Change the state of a camera from running to paused or vice-versa.
      operationId: PutCameraState
      parameters:
        - description: the camera ID of the camera.
          in: path
          name: cameraId
          required: true
          schema:
            type: string
            format: uuid
        - description: >
            The state to which the camera will be set: running cameras are
            processing video and have notifications on,

            paused cameras are not processing video, notifications are off and
            can be re-activated.
          in: path
          name: newState
          required: true
          schema:
            type: string
            enum:
              - running
              - paused
      responses:
        '201':
          description: OK.
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update camera state
      tags:
        - camera
  /cameras/{cameraId}/video-upload-metrics:
    get:
      description: Get video upload metrics for the provided camera ID
      operationId: GetVideoUploadMetrics
      parameters:
        - description: the camera ID of the camera
          in: path
          name: cameraId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoUploadMetrics'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get video upload metrics
      tags:
        - camera
  /dwell-time-reports:
    get:
      description: List of all dwell time reports for the given organisation
      operationId: ListDwellTimeReports
      parameters:
        - description: The ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: report status.
          in: query
          name: status
          schema:
            type: string
            enum:
              - pending
              - awaiting_approval
              - approved
              - rejected
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/DwellTimeRequestResponse'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: List Dwell Time Reports
      tags:
        - dwellTimeReport
    post:
      description: >-
        Create a report of dwell time for a given time range and given
        organisation
      operationId: CreateDwellTimeReport
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DwellTimeReportRequest'
        description: request dwell time data for an organisation and a given time range.
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DwellTimeRequestResponse'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Payload too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: Not implemented.
      summary: Create dwell time report
      tags:
        - dwellTimeReport
  /dwell-time-reports/{dwellTimeReportId}:
    get:
      description: Get a dwell time report identified by the provided report ID.
      operationId: GetDwellTimeReport
      parameters:
        - description: The full report ID of a report to be fetched.
          in: path
          name: dwellTimeReportId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DwellTimeRequestResponse'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Get Dwell Time Report
      tags:
        - dwellTimeReport
  /frame-requests:
    post:
      description: Get a recent video frame from a camera.
      operationId: CreateFrameRequest
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FrameRequest'
        description: The FrameRequest that contains the camera to fetch a frame for.
        required: true
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Frame'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No image available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      summary: Get live frame
      tags:
        - camera
  /live-occupancy:
    post:
      description: Create a report of live occupancies for a list of occupancy monitors.
      operationId: CreateLiveOccupancyReport
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LiveOccupancyReport'
        description: request live occupancies for a list of occupancy monitors.
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/LiveOccupancy'
                type: array
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      summary: Create live occupancy report
      tags:
        - report
  /notification-group-notification-groups:
    get:
      description: Get all notification groups link subject to filters.
      operationId: ListNotificationGroupNotificationGroups
      parameters:
        - description: The ID of the notification group link to get.
          in: query
          name: notificationGroupNotificationGroupId
          schema:
            type: string
            format: uuid
        - description: The ID of the parent notification group to get all nested child IDs.
          in: query
          name: parentNotificationGroupId
          schema:
            type: string
            format: uuid
        - description: The ID of the child notification group to get all ancestral IDs.
          in: query
          name: childNotificationGroupId
          schema:
            type: string
            format: uuid
        - description: >-
            The ID of the organisation the notification group links are linked
            to.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: The state of the notification group notification group link.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/NotificationGroupNotificationGroup'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: List notification group notification groups
      tags:
        - notificationGroupMapping
    put:
      description: Update existing notification group link, create a new one otherwise.
      operationId: PutNotificationGroupNotificationGroup
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationGroupNotificationGroup'
        description: A link between two notification groups.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationGroupNotificationGroup'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Create/Update notification group notification group
      tags:
        - notificationGroupMapping
  /notification-group-notification-groups/{notificationGroupNotificationGroupId}:
    delete:
      description: Set the state of a notification group link to deleted.
      operationId: DeleteNotificationGroupNotificationGroup
      parameters:
        - description: the ID of the notification group link to delete.
          in: path
          name: notificationGroupNotificationGroupId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Delete notification group notification group
      tags:
        - notificationGroupMapping
    get:
      description: Get a notification group link identified by the provided ID.
      operationId: GetNotificationGroupNotificationGroup
      parameters:
        - description: The ID of the notification group link to get.
          in: path
          name: notificationGroupNotificationGroupId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationGroupNotificationGroup'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
        '501':
          description: Not implemented.
      summary: Get notification group notification group
      tags:
        - notificationGroupMapping
  /notification-groups:
    get:
      description: Get all notification groups subject to filters.
      operationId: ListNotificationGroups
      parameters:
        - description: The ID of the notification group to get.
          in: query
          name: notificationGroupId
          schema:
            type: string
            format: uuid
        - description: The ID of the alert rule a notification group is linked to.
          in: query
          name: alertId
          schema:
            type: string
            format: uuid
        - description: The ID of the organisation the notification groups are linked to.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: The state of the notification group.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
        - description: >-
            The ID of a user on whose visibility of the notification groups to
            filter on.
          in: query
          name: userId
          schema:
            type: string
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/NotificationGroup'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List notification groups
      tags:
        - notificationGroup
    put:
      description: >-
        Update a notification group exists if exists, create a new one
        otherwise.
      operationId: PutNotificationGroup
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationGroup'
        description: A notification group to send alerts to.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationGroup'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update notification group
      tags:
        - notificationGroup
  /notification-groups/{notificationGroupId}:
    delete:
      description: Set the state of a notification group to deleted.
      operationId: DeleteNotificationGroup
      parameters:
        - description: the ID of the notification group to delete.
          in: path
          name: notificationGroupId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete notification group
      tags:
        - notificationGroup
    get:
      description: Get a notification group identified by the provided ID.
      operationId: GetNotificationGroup
      parameters:
        - description: The ID of the notification group to get.
          in: path
          name: notificationGroupId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationGroup'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get notification group
      tags:
        - notificationGroup
  /oauth-clients:
    get:
      description: List OAuth client links.
      operationId: ListOAuthClientLinks
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/OAuthClientLink'
                type: array
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List OAuth client links.
      tags:
        - oAuthClient
    put:
      description: Update an OAuth client.
      operationId: PutOAuthClient
      requestBody:
        content:
          application/json:
            schema:
              properties:
                callbacks:
                  items:
                    type: string
                  type: array
                clientId:
                  type: string
                grantTypes:
                  items:
                    enum:
                      - authorization_code
                      - client_credentials
                      - password
                      - refresh_token
                    type: string
                  type: array
                name:
                  type: string
                organisationId:
                  example: 532ec32c-6f32-457f-8285-3438b2599d9b
                  type: string
              required:
                - name
                - grantTypes
                - organisationId
              type: object
        description: A client to update.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthClient'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '412':
          description: Precondition failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update OAuth client
      tags:
        - oAuthClient
  /oauth-clients/{oAuthClientId}:
    delete:
      description: Remove an OAuth client.
      operationId: DeleteOAuthClient
      parameters:
        - description: The ID of the OAuth client to delete.
          in: path
          name: oAuthClientId
          required: true
          schema:
            type: string
      responses:
        '204':
          description: OK.
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete OAuth client
      tags:
        - oAuthClient
    get:
      description: Get an OAuth client.
      operationId: GetOAuthClient
      parameters:
        - description: The ID of the OAuth client to delete.
          in: path
          name: oAuthClientId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthClient'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get OAuth client.
      tags:
        - oAuthClient
  /oauth-clients/{oAuthClientId}/rotate-secret:
    post:
      description: Rotate an OAuth client secret ID
      operationId: RotateClientSecret
      parameters:
        - description: The ID of the OAuth client to update.
          in: path
          name: oAuthClientId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthClient'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Rotate client secret
      tags:
        - oAuthClient
  /occupancy-monitor-camera-positions:
    get:
      description: Get all available occupancy monitor camera positions subject to filters.
      operationId: ListOccupancyMonitorCameraPositions
      parameters:
        - description: the ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: >-
            the ID of the site the occupancy monitor camera positions are linked
            to.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: the ID of a camera linked to the occupancy monitor camera positions.
          in: query
          name: cameraId
          schema:
            type: string
            format: uuid
        - description: >-
            the ID of the occupancy monitor the occupancy monitor camera
            position is linking.
          in: query
          name: occupancyMonitorId
          schema:
            type: string
            format: uuid
        - description: Occupancy monitor camera position state.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/OccupancyMonitorCameraPosition'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List occupancy monitor camera positions
      tags:
        - occupancyMonitorCameraPosition
    put:
      description: >-
        Update an occupancy monitor's camera position if it exists, create a new

        object linking the given occupancy monitor to the given camera position
        otherwise.
      operationId: PutOccupancyMonitorCameraPosition
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OccupancyMonitorCameraPosition'
        description: An occupancy monitor camera position.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OccupancyMonitorCameraPosition'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update occupancy monitor camera position
      tags:
        - occupancyMonitorCameraPosition
  /occupancy-monitor-camera-positions/{occupancyMonitorCameraPositionId}:
    delete:
      description: Set the state of an occupancy monitor camera position to deleted.
      operationId: DeleteOccupancyMonitorCameraPosition
      parameters:
        - description: the ID of the occupancy monitor camera position to delete.
          in: path
          name: occupancyMonitorCameraPositionId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete occupancy monitor camera position
      tags:
        - occupancyMonitorCameraPosition
    get:
      description: Get an occupancy monitor camera position identified by the provided ID.
      operationId: GetOccupancyMonitorCameraPosition
      parameters:
        - description: The ID of the occupancy monitor camera position.
          in: path
          name: occupancyMonitorCameraPositionId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OccupancyMonitorCameraPosition'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get occupancy monitor camera position
      tags:
        - occupancyMonitorCameraPosition
  /occupancy-monitors:
    get:
      description: Get all available occupancy monitors subject to filters.
      operationId: ListOccupancyMonitors
      parameters:
        - description: the ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: the ID of the site the occupancy monitors are linked to.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: the ID of a camera position linked to the occupancy monitors.
          in: query
          name: cameraPositionId
          schema:
            type: string
            format: uuid
        - description: Occupancy monitor state.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/OccupancyMonitor'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List occupancy monitors
      tags:
        - occupancyMonitor
    put:
      description: Update an occupancy monitor if it exists, create a new one otherwise.
      operationId: PutOccupancyMonitor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OccupancyMonitor'
        description: An occupancy monitor.
        required: true
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OccupancyMonitor'
        '204':
          description: No Content.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update occupancy monitor
      tags:
        - occupancyMonitor
  /occupancy-monitors/{occupancyMonitorId}:
    delete:
      description: Set the state of an occupancy monitor to deleted.
      operationId: DeleteOccupancyMonitor
      parameters:
        - description: the ID of the occupancy monitor.
          in: path
          name: occupancyMonitorId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete occupancy monitor
      tags:
        - occupancyMonitor
    get:
      description: Get an occupancy monitor identified by the provided ID.
      operationId: GetOccupancyMonitor
      parameters:
        - description: The ID of the Occupancy Monitor.
          in: path
          name: occupancyMonitorId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OccupancyMonitor'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get occupancy monitor
      tags:
        - occupancyMonitor
  /occupancy-reports:
    post:
      description: >-
        Create a report of occupancy counts for a given time range and set of
        monitors.
      operationId: CreateOccupancyReport
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OccupancyReport'
        description: request occupancy data for a set of monitors and a given time range.
        required: true
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/Occupancy'
                type: array
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Payload too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      summary: Create occupancy report
      tags:
        - report
  /organisations:
    get:
      description: List organisations in the portfolio.
      operationId: ListOrganisations
      parameters:
        - description: The ID of a user.
          in: query
          name: userId
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/Organisation'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List organisations
      tags:
        - organisation
  /organisations/{organisationId}:
    get:
      description: Get all attributes of an organisation model given an organisation ID.
      operationId: GetOrganisation
      parameters:
        - description: The ID of the organisation to be returned.
          in: path
          name: organisationId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Organisation'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get organisation
      tags:
        - organisation
  /peel-off-monitor-camera-positions:
    get:
      description: Get all available peel off monitor camera positions subject to filters.
      operationId: ListPeelOffMonitorCameraPositions
      parameters:
        - description: the ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: >-
            the ID of the site the peel off monitor camera positions are linked
            to.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: >-
            the ID of a camera position linked to the peel off monitor camera
            positions.
          in: query
          name: cameraPositionId
          schema:
            type: string
            format: uuid
        - description: >-
            the ID of the peel off monitor the peel off monitor camera position
            is linking.
          in: query
          name: peelOffMonitorId
          schema:
            type: string
            format: uuid
        - description: Peel off monitor camera positions state filter.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PeelOffMonitorCameraPosition'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List peel off monitor camera positions
      tags:
        - peelOffMonitorCameraPosition
    put:
      description: >-
        Update a peel off monitor's camera position if it exists, create a new

        object linking the given peel off monitor to the given camera position
        otherwise.
      operationId: PutPeelOffMonitorCameraPosition
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeelOffMonitorCameraPosition'
        description: A peel off monitor camera position to put.
        required: true
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeelOffMonitorCameraPosition'
        '204':
          description: Updated.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update peel off monitor camera position
      tags:
        - peelOffMonitorCameraPosition
  /peel-off-monitor-camera-positions/{peelOffMonitorCameraPositionId}:
    delete:
      description: Set the state of a peel off monitor camera position to deleted.
      operationId: DeletePeelOffMonitorCameraPosition
      parameters:
        - description: the ID of the peel off monitor camera position to delete.
          in: path
          name: peelOffMonitorCameraPositionId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete peel off monitor camera position
      tags:
        - peelOffMonitorCameraPosition
    get:
      description: Get a peel off monitor camera position identified by the provided ID.
      operationId: GetPeelOffMonitorCameraPosition
      parameters:
        - description: The ID of the peel off monitor camera position to get.
          in: path
          name: peelOffMonitorCameraPositionId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeelOffMonitorCameraPosition'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get peel off monitor camera position
      tags:
        - peelOffMonitorCameraPosition
  /peel-off-monitors:
    get:
      description: Get all available peel off monitors subject to filters.
      operationId: ListPeelOffMonitors
      parameters:
        - description: the ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: the ID of the site the peel off monitors are linked to.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: the ID of a camera position linked to the peel off monitors.
          in: query
          name: cameraPositionId
          schema:
            type: string
            format: uuid
        - description: Peel off monitors state.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PeelOffMonitor'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List peel off monitors
      tags:
        - peelOffMonitor
    put:
      description: Update a peel off monitor if it exists, create a new one otherwise.
      operationId: PutPeelOffMonitor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeelOffMonitor'
        description: A peel off monitor to put.
        required: true
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeelOffMonitor'
        '204':
          description: Updated.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update peel off monitor
      tags:
        - peelOffMonitor
  /peel-off-monitors/{peelOffMonitorId}:
    delete:
      description: Set the state of a peel off monitor to deleted.
      operationId: DeletePeelOffMonitor
      parameters:
        - description: the ID of the peel off monitor to delete.
          in: path
          name: peelOffMonitorId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete peel off monitor
      tags:
        - peelOffMonitor
    get:
      description: Get a peel off monitor identified by the provided ID.
      operationId: GetPeelOffMonitor
      parameters:
        - description: The ID of the peel off monitor.
          in: path
          name: peelOffMonitorId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeelOffMonitor'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get peel off monitor
      tags:
        - peelOffMonitor
  /peel-off-reports:
    post:
      description: Create a peel off report for a given time range and set of monitors.
      operationId: CreatePeelOffReport
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeelOffReport'
        description: request peel off data for a set of monitors and a given time range.
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PeelOffData'
                type: array
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Payload too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      summary: Create peel off report
      tags:
        - report
  /people-count-monitor-camera-positions:
    get:
      description: Get all available occupancy monitor camera positions subject to filters.
      operationId: ListPeopleCountMonitorCameraPositions
      parameters:
        - description: the ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: >-
            the ID of the site the people count monitor camera positions are
            linked to.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: >-
            the ID of a camera position linked to the people count monitor
            camera positions.
          in: query
          name: cameraPositionId
          schema:
            type: string
            format: uuid
        - description: >-
            the ID of the people count monitor the people count monitor camera
            position is linking.
          in: query
          name: peopleCountMonitorId
          schema:
            type: string
            format: uuid
        - description: People count monitor camera positions state filter.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PeopleCountMonitorCameraPosition'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List people count monitor camera positions
      tags:
        - peopleCountMonitorCameraPosition
    put:
      description: >-
        Update a people count monitor's camera position if it exists, create a
        new

        object linking the given people count monitor to the given camera
        position otherwise.
      operationId: PutPeopleCountMonitorCameraPosition
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeopleCountMonitorCameraPosition'
        description: A people count monitor camera position to put.
        required: true
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeopleCountMonitorCameraPosition'
        '204':
          description: Updated.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update people count monitor camera position
      tags:
        - peopleCountMonitorCameraPosition
  /people-count-monitor-camera-positions/{peopleCountMonitorCameraPositionId}:
    delete:
      description: Set the state of a people count monitor camera position to deleted.
      operationId: DeletePeopleCountMonitorCameraPosition
      parameters:
        - description: the ID of the people count monitor camera position to delete.
          in: path
          name: peopleCountMonitorCameraPositionId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete people count monitor camera position
      tags:
        - peopleCountMonitorCameraPosition
    get:
      description: >-
        Get a people count monitor camera position identified by the provided
        ID.
      operationId: GetPeopleCountMonitorCameraPosition
      parameters:
        - description: The ID of the people count monitor camera position to get.
          in: path
          name: peopleCountMonitorCameraPositionId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeopleCountMonitorCameraPosition'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get people count monitor camera position
      tags:
        - peopleCountMonitorCameraPosition
  /people-count-monitors:
    get:
      description: Get all available occupancy monitors subject to filters.
      operationId: ListPeopleCountMonitors
      parameters:
        - description: the ID of the associated organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: the ID of the site the people count monitors are linked to.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
        - description: the ID of a camera position linked to the people count monitors.
          in: query
          name: cameraPositionId
          schema:
            type: string
            format: uuid
        - description: People count monitors state.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PeopleCountMonitor'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List people count monitors
      tags:
        - peopleCountMonitor
    put:
      description: Update a people count monitor if it exists, create a new one otherwise.
      operationId: PutPeopleCountMonitor
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeopleCountMonitor'
        description: A people count monitor to put.
        required: true
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeopleCountMonitor'
        '204':
          description: Updated.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update people count monitor
      tags:
        - peopleCountMonitor
  /people-count-monitors/{peopleCountMonitorId}:
    delete:
      description: Set the state of a people count monitor to deleted.
      operationId: DeletePeopleCountMonitor
      parameters:
        - description: the ID of the people count monitor to delete.
          in: path
          name: peopleCountMonitorId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete people count monitor
      tags:
        - peopleCountMonitor
    get:
      description: Get a people count monitor identified by the provided ID.
      operationId: GetPeopleCountMonitor
      parameters:
        - description: The ID of the people count monitor.
          in: path
          name: peopleCountMonitorId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PeopleCountMonitor'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get people count monitor
      tags:
        - peopleCountMonitor
  /people-count-reports:
    post:
      description: >-
        Create a report of people counts for a given time range and set of
        monitors.
      operationId: CreatePeopleCountReport
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PeopleCountReport'
        description: >-
          request people count data for a set of monitors and a given time
          range.
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/PeopleCount'
                type: array
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Payload too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      summary: Create people count report
      tags:
        - report
  /put-camera-state-requests:
    post:
      description: >-
        Change the state of a camera from claimed to claimed_paused or
        vice-versa.
      operationId: PutCameraStateRequest
      requestBody:
        content:
          application/json:
            schema:
              properties:
                cameraId:
                  description: the camera ID of the camera.
                  format: uuid
                  type: string
                newState:
                  description: >
                    The state to which the camera will be set: claimed cameras
                    are processing video and have notifications on,

                    claimed_paused cameras are not processing video,
                    notifications are off and can be re-activated.
                  enum:
                    - claimed
                    - claimed_paused
                  type: string
              required:
                - cameraId
                - newState
              type: object
      responses:
        '202':
          description: Accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update camera state request
      tags:
        - camera
  /register-camera-requests:
    post:
      description: Create a camera in a registered state.
      operationId: RegisterCameraRequest
      requestBody:
        content:
          application/json:
            schema:
              properties:
                cameraId:
                  format: uuid
                  type: string
                serialNumber:
                  type: string
              required:
                - cameraId
                - serialNumber
              type: object
        required: true
      responses:
        '202':
          description: Accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Register camera
      tags:
        - camera
  /sites:
    get:
      description: >-
        List all the sites in the portfolio along with the organisations that
        own them.
      operationId: ListSites
      parameters:
        - description: The ID of an organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: The ID of a user.
          in: query
          name: userId
          schema:
            type: string
        - description: Site state.
          in: query
          name: state
          schema:
            type: string
            enum:
              - active
              - deleted
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/Site'
                type: array
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List sites
      tags:
        - site
    put:
      description: Update site information.
      operationId: PutSite
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Site'
        description: Update site information.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Site'
        '204':
          description: Update was successful.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update site
      tags:
        - site
  /sites/{siteId}:
    delete:
      description: Set the state of a site to decommissioned.
      operationId: DeleteSite
      parameters:
        - description: The ID of the site that will be decommissioned.
          in: path
          name: siteId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '410':
          description: Gone.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete site
      tags:
        - site
    get:
      description: Get all attributes of a site model given a site ID.
      operationId: GetSite
      parameters:
        - description: The ID of the site to be returned.
          in: path
          name: siteId
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Site'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get site
      tags:
        - site
  /users:
    get:
      description: Fetch the list of users associated with an organisation or site.
      operationId: ListUsers
      parameters:
        - description: The ID of an organisation.
          in: query
          name: organisationId
          schema:
            type: string
            format: uuid
        - description: The ID of a site.
          in: query
          name: siteId
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/User'
                type: array
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: List users
      tags:
        - user
    put:
      description: Create/Update an user.
      operationId: PutUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
        description: A user to update.
        required: true
      responses:
        '201':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '204':
          description: OK.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Create/Update user
      tags:
        - user
  /users/me:
    get:
      description: Returns the profile data of the caller.
      operationId: GetMe
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable entity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get my profile
      tags:
        - user
  /users/{userId}:
    delete:
      description: Remove an user.
      operationId: DeleteUser
      parameters:
        - description: The ID of the user to be deleted.
          in: path
          name: userId
          required: true
          schema:
            type: string
      responses:
        '204':
          description: OK.
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Delete user
      tags:
        - user
    get:
      description: Get details of the user given by the ID.
      operationId: GetUser
      parameters:
        - description: The ID of the user to be returned.
          in: path
          name: userId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed.
      summary: Get user
      tags:
        - user
security:
  - o_auth: []
tags:
  - description: APIs to manage an Organisation's monitor reports.
    name: report
    x-displayName: Reports
  - description: APIs to manage an Organisation's Dwell Time reports.
    name: dwellTimeReport
    x-displayName: Dwell Times
  - description: APIs to manage Organisations.
    name: organisation
    x-displayName: Organisations
  - description: APIs to manage an organisation's sites.
    name: site
    x-displayName: Sites
  - description: APIs to manage an organisation's cameras.
    name: camera
    x-displayName: Cameras
  - description: APIs to manage an organisation's notification groups.
    name: notificationGroup
    x-displayName: Notification Groups
  - description: APIs to manage an organisation's notification group links.
    name: notificationGroupMapping
    x-displayName: Notification Group Mappings
  - description: APIs to manage an Organisation's occupancy monitors.
    name: occupancyMonitor
    x-displayName: Occupancy Monitors
  - description: APIs to manage an Organisation's occupancy monitor camera positions.
    name: occupancyMonitorCameraPosition
    x-displayName: Occupancy Monitor Camera Positions
  - description: APIs to manage an Organisation's people count monitors.
    name: peopleCountMonitor
    x-displayName: People Count Monitors
  - description: APIs to manage an Organisation's people count monitor camera positions.
    name: peopleCountMonitorCameraPosition
    x-displayName: People Count Monitor Camera Positions
  - description: APIs to manage an Organisation's users.
    name: user
    x-displayName: Users
  - description: APIs to manage an organisation's alert notification group mappings.
    name: alertNotificationGroupMapping
    x-displayName: Alert Notification Group Mappings
  - description: APIs to manage an organisation's alerts.
    name: alert
    x-displayName: Alert
  - description: APIs to manage an organisation's alert camera position mappings.
    name: alertCameraPositionMapping
    x-displayName: Alert Camera Position Mappings
  - description: APIs to manage an organisation's alert occupancy monitor mappings.
    name: alertOccupancyMonitorMapping
    x-displayName: Alert Occupancy Monitor Mappings
  - description: APIs to manage an organisation's alert people count monitor mappings.
    name: alertPeopleCountMonitorMapping
    x-displayName: Alert People Count Monitor Mappings
  - description: APIs to manage an annotation.
    name: annotation
    x-displayName: Annotations
  - description: APIs to manage OAuth clients.
    name: oAuthClient
    x-displayName: OAuth Clients
  - description: APIs to manage an Organisation's peel off monitors.
    name: peelOffMonitor
    x-displayName: Peel Off Monitors
  - description: APIs to manage an Organisation's peel off monitor camera positions.
    name: peelOffMonitorCameraPosition
    x-displayName: Peel Off Monitor Camera Positions
  - description: APIs to manage talkbacks devices and reports.
    name: talkBack
    x-displayName: TalkBack
x-tagGroups:
  - name: ANALYTICS
    tags:
      - report
      - dwellTimeReport
  - name: ADMIN
    tags:
      - organisation
      - user
      - oAuthClient
  - name: SITE
    tags:
      - site
  - name: CAMERA
    tags:
      - camera
      - annotation
  - name: ALERT
    tags:
      - alert
      - alertNotificationGroupMapping
      - alertCameraPositionMapping
      - alertOccupancyMonitorMapping
  - name: NOTIFICATION GROUP
    tags:
      - notificationGroup
      - notificationGroupMapping
  - name: OCCUPANCY MONITOR
    tags:
      - occupancyMonitor
      - occupancyMonitorCameraPosition
  - name: PEOPLE-COUNT MONITOR
    tags:
      - peopleCountMonitor
      - peopleCountMonitorCameraPosition
  - name: PEEL-OFF MONITOR
    tags:
      - peelOffMonitor
      - peelOffMonitorCameraPosition
  - name: TalkBack
    tags:
      - talkBack
servers:
  - url: https://hoxton.cloud/api/v0
components:
  securitySchemes:
    o_auth:
      type: oauth2
      x-defaultClientId: zrG51yDFAcYOrEdUWHeMujRP01DdK6As
      flows:
        implicit:
          authorizationUrl: https://auth.hoxton.ai/authorize?audience=https://api.hoxton.cloud
          scopes: {}
  schemas:
    AggregatedApiRequestMetrics:
      properties:
        clientID:
          readOnly: true
          type: string
        dailyAPICallCount:
          readOnly: true
          type: integer
          nullable: true
        dailyActiveUser:
          readOnly: true
          type: integer
          nullable: true
        organisationID:
          format: uuid
          readOnly: true
          type: string
        time:
          format: date-time
          readOnly: true
          type: string
    AggregatedApiRequestMetricsReport:
      properties:
        clientIds:
          description: A list of IDs of the clients to fetch the data for.
          items:
            type: string
          type: array
        endDate:
          description: >-
            It is the upper bound of the date range for which to return data.
            The `endDate` is non-inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`
          format: date
          type: string
        startDate:
          description: >-
            It is the lower bound of the date range for which to return data.
            The `startDate` is inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`
          format: date
          type: string
      type: object
    AggregatedVideoMetrics:
      properties:
        cameraId:
          format: uuid
          readOnly: true
          type: string
        lateCount:
          readOnly: true
          type: integer
          nullable: true
        missingCount:
          readOnly: true
          type: integer
          nullable: true
        onTimeCount:
          readOnly: true
          type: integer
          nullable: true
        time:
          format: date-time
          readOnly: true
          type: string
    AggregatedVideoMetricsReport:
      properties:
        cameraIds:
          description: A list of IDs of the cameras to fetch the data for.
          items:
            format: uuid
            type: string
          type: array
        endDate:
          description: >-
            It is the upper bound of the date range for which to return data.
            The `endDate` is non-inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`
          format: date
          type: string
        id:
          format: uuid
          readOnly: true
          type: string
        startDate:
          description: >-
            It is the lower bound of the date range for which to return data.
            The `startDate` is inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`
          format: date
          type: string
        timeGrain:
          default: 24h
          description: The time granularity of the response.
          enum:
            - 1h
            - 24h
            - 168h
          type: string
      type: object
    Alert:
      properties:
        alertType:
          enum:
            - offline_alert
            - occupancy_alert
            - camera_health_summary_alert
            - people_count
          type: string
        configurationDetails:
          type: object
        createdAt:
          format: date-time
          readOnly: true
          type: string
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        emails:
          items:
            format: email
            type: string
          minItems: 1
          type: array
          x-omitempty: true
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        name:
          type: string
        organisationId:
          format: uuid
          type: string
        siteId:
          format: uuid
          type: string
          nullable: true
        state:
          enum:
            - active
            - deleted
          type: string
        webhook:
          type: object
      required:
        - organisationId
        - alertType
        - name
      type: object
    AlertCameraPositionMapping:
      properties:
        alertId:
          format: uuid
          type: string
        cameraPositionId:
          format: uuid
          type: string
        createdAt:
          format: date-time
          readOnly: true
          type: string
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - alertId
        - cameraPositionId
      type: object
    AlertNotificationGroupMapping:
      properties:
        alertId:
          format: uuid
          type: string
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        notificationGroupId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - alertId
        - notificationGroupId
      type: object
    AlertOccupancyMonitorMapping:
      properties:
        alertId:
          format: uuid
          type: string
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        occupancyMonitorId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - alertId
        - occupancyMonitorId
      type: object
    AlertPeopleCountMonitorMapping:
      properties:
        alertId:
          format: uuid
          type: string
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        peopleCountMonitorId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - alertId
        - peopleCountMonitorId
      type: object
    Annotation:
      properties:
        cameraPositionId:
          format: uuid
          type: string
        createdAt:
          format: date-time
          readOnly: true
          type: string
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        kind:
          enum:
            - polygon
            - multipolygon
          type: string
        roi:
          type: object
          x-go-type:
            hints:
              kind: interface
            import:
              package: github.com/paulmach/orb/geojson
            type: FeatureCollection
          nullable: true
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - cameraPositionId
        - roi
      type: object
    Camera:
      properties:
        cameraPositionId:
          format: uuid
          type: string
        claimedAt:
          format: date-time
          type: string
        direction1Alias:
          type: string
        direction2Alias:
          type: string
        encodedFramesProportion:
          description: >-
            The number of frames encoded over the expected number of frames in
            the last 2 minutes.
          format: float64
          minimum: 0
          readOnly: true
          type: number
          nullable: true
        id:
          format: uuid
          type: string
        isOnline:
          type: boolean
          nullable: true
        lastSeenAt:
          format: date-time
          type: string
          nullable: true
        lastVideoAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        name:
          type: string
        networkTransmitRate:
          description: >-
            The rate in bytes/second the camera sends information over the
            network at.
          format: uint64
          minimum: 0
          readOnly: true
          type: number
          nullable: true
        organisationId:
          format: uuid
          readOnly: true
          type: string
        serialNumber:
          readOnly: true
          type: string
        siteId:
          format: uuid
          type: string
        state:
          enum:
            - running
            - decommissioned
            - paused
          type: string
        videoBacklog:
          description: The number of milliseconds of video the camera is waiting to upload.
          format: uint64
          minimum: 0
          type: number
          nullable: true
        videoUploadLatency:
          description: >-
            The number of milliseconds it took the latest video uploaded to be
            uploaded.
          minimum: 0
          readOnly: true
          type: number
          nullable: true
      type: object
    DwellTimeData:
      properties:
        day:
          type: string
        description:
          type: string
        dwellTime:
          type: string
        monitorType:
          type: string
      type: object
    DwellTimeReportRequest:
      properties:
        endDate:
          description: >-
            It is the upper bound of the date range for which to return data.
            The `endDate` is non-inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`
          format: date
          type: string
        occupancyMonitorIds:
          description: List of occupancy monitor ids in the report.
          items:
            format: uuid
            type: string
          type: array
        organisationId:
          format: uuid
          type: string
        peopleCountMonitorIds:
          description: List of people count monitor ids in the report.
          items:
            format: uuid
            type: string
          type: array
        startDate:
          description: >-
            It is the lower bound of the date range for which to return data.
            The `startDate` is inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`
          format: date
          type: string
      required:
        - endDate
        - organisationId
        - startDate
      type: object
    DwellTimeRequestResponse:
      properties:
        createdAt:
          format: datetime
          type: string
        dwellTimeReportId:
          format: uuid
          type: string
        endDate:
          description: >-
            It is the upper bound of the date range for which to return data.
            The `endDate` is non-inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`
          format: date
          type: string
        errorMessage:
          description: error in dwell time report.
          type: string
        occupancyMonitorIds:
          description: List of occupancy monitor ids in the report.
          items:
            format: uuid
            type: string
          type: array
        organisationId:
          format: uuid
          type: string
        peopleCountMonitorIds:
          description: List of people count monitor ids in the report.
          items:
            format: uuid
            type: string
          type: array
        reportData:
          items:
            $ref: '#/components/schemas/DwellTimeData'
          type: array
        startDate:
          description: >-
            It is the lower bound of the date range for which to return data.
            The `startDate` is inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`
          format: date
          type: string
        status:
          enum:
            - completed
            - completed_with_errors
            - pending
          type: string
      type: object
    Error:
      properties:
        code:
          type: integer
        message:
          type: string
      type: object
    Frame:
      properties:
        image:
          type: string
        timestamp:
          format: date-time
          type: string
      type: object
    FrameRequest:
      properties:
        cameraId:
          format: uuid
          type: string
      required:
        - cameraId
      type: object
    Job:
      properties:
        id:
          format: uuid
          readOnly: true
          type: string
        msg:
          type: string
        status:
          enum:
            - created
            - failed
            - success
          type: string
      required:
        - id
        - status
        - msg
    LiveOccupancy:
      properties:
        occupancy:
          readOnly: true
          type: integer
        occupancyMonitorId:
          format: uuid
          readOnly: true
          type: string
        time:
          format: date-time
          readOnly: true
          type: string
    LiveOccupancyReport:
      properties:
        occupancyMonitorIds:
          description: List of occupancy monitor ids in the report.
          items:
            format: uuid
            type: string
          type: array
          nullable: true
        organisationIds:
          description: List of organisation ids in the report.
          items:
            format: uuid
            type: string
          type: array
          nullable: true
        siteIds:
          description: List of site ids in the report.
          items:
            format: uuid
            type: string
          type: array
          nullable: true
    MetricPoint:
      properties:
        intervalEnd:
          description: >-
            intervalEnd is the end of the time interval in which the measurement
            was taken.
          format: date-time
          type: string
        intervalStart:
          description: >-
            intervalStart is the start of the time interval in which the
            measurement was taken.
          format: date-time
          type: string
        value:
          description: the value of the measurement for the given interval.
          type: number
      required:
        - intervalEnd
        - intervalStart
        - value
    NotificationGroup:
      properties:
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        emails:
          items:
            format: email
            type: string
          type: array
        id:
          format: uuid
          type: string
          nullable: true
        name:
          type: string
        organisationId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
        webhook:
          type: object
      required:
        - name
        - organisationId
      type: object
    NotificationGroupNotificationGroup:
      properties:
        childId:
          format: uuid
          type: string
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        organisationId:
          format: uuid
          type: string
        parentId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - organisationId
        - childId
        - parentId
      type: object
    OAuthClient:
      description: The organisations oauth2 client
      properties:
        callbacks:
          items:
            type: string
          type: array
        clientId:
          type: string
        clientSecret:
          readOnly: true
          type: string
        grantTypes:
          items:
            enum:
              - authorization_code
              - client_credentials
              - password
              - refresh_token
            type: string
          type: array
        name:
          type: string
      required:
        - name
        - grantTypes
    OAuthClientLink:
      properties:
        clientId:
          type: string
        organisationId:
          type: string
    Occupancy:
      properties:
        inCountSum:
          readOnly: true
          type: integer
          nullable: true
        occupancyAvg:
          readOnly: true
          type: integer
          nullable: true
        occupancyMax:
          readOnly: true
          type: integer
          nullable: true
        occupancyMonitorId:
          format: uuid
          readOnly: true
          type: string
        outCountSum:
          readOnly: true
          type: integer
          nullable: true
        time:
          format: date-time
          readOnly: true
          type: string
    OccupancyMonitor:
      properties:
        capacity:
          example: 100
          format: uint64
          minimum: 1
          type: integer
          nullable: true
        dailyResetMin:
          default: 0
          format: uint64
          maximum: 1440
          minimum: 0
          type: integer
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        name:
          type: string
        reportingEndDate:
          format: date
          type: string
          nullable: true
        reportingStartDate:
          format: date
          type: string
          nullable: true
        siteId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - dailyResetMin
        - name
        - siteId
      type: object
    OccupancyMonitorCameraPosition:
      properties:
        cameraPositionId:
          format: uuid
          type: string
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        inDirection:
          enum:
            - direction_1
            - direction_2
          type: string
        occupancyMonitorId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - cameraPositionId
        - inDirection
        - occupancyMonitorId
      type: object
    OccupancyReport:
      properties:
        endDate:
          description: >-
            It is the upper bound of the date range for which to return data.
            The `endDate` is non-inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`.
          format: date
          type: string
        id:
          format: uuid
          readOnly: true
          type: string
        isOpen:
          default: false
          description: Flag to filter output within site opening hour window
          type: boolean
        limit:
          description: >-
            Number of rows of returned data. A `0` value returns all rows in the
            requested time range.
          type: integer
        metrics:
          description: List of metrics associated with the monitors.
          items:
            enum:
              - occupancy_avg
              - occupancy_max
              - in_count_sum
              - out_count_sum
            type: string
          type: array
        occupancyMonitorIds:
          description: >-
            List of occupancy monitor ids in the report. At least one id is
            required.
          items:
            format: uuid
            type: string
          type: array
        startDate:
          description: >-
            It is the lower bound of the date range for which to return data.
            The `startDate` is inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`.
          format: date
          type: string
        timeGrain:
          default: 1m
          description: The time window in the requested range for data aggregation.
          enum:
            - 1m
            - 5m
            - 15m
            - 30m
            - 1h
            - 6h
            - 24h
          type: string
      type: object
    Organisation:
      properties:
        createdAt:
          format: date-time
          readOnly: true
          type: string
        id:
          format: uuid
          type: string
        licence:
          items:
            enum:
              - data_explorer
              - occupancy_monitor
              - people_count
              - real_time
              - dwell_time
            type: string
          type: array
        maxAdminSeats:
          format: uint64
          minimum: 0
          type: integer
          nullable: true
        maxUserSeats:
          format: uint64
          minimum: 0
          type: integer
          nullable: true
        name:
          type: string
        processingGroup:
          format: int64
          minimum: 0
          type: integer
          nullable: true
        state:
          enum:
            - active
            - deleted
            - disabled
          type: string
      type: object
    PatchCameraRequest:
      properties:
        direction1Alias:
          type: string
        direction2Alias:
          type: string
        name:
          type: string
      type: object
    PatchDwellTimeReportRequest:
      properties:
        errorMessage:
          type: string
        reportData:
          items:
            $ref: '#/components/schemas/DwellTimeData'
          type: array
        status:
          enum:
            - awaiting_approval
            - pending
          type: string
      type: object
    PeelOffData:
      properties:
        base:
          readOnly: true
          type: integer
          nullable: true
        id:
          format: uuid
          readOnly: true
          type: string
        name:
          readOnly: true
          type: string
        peelOff:
          readOnly: true
          type: integer
          nullable: true
        rate:
          format: float64
          readOnly: true
          type: number
          nullable: true
        time:
          format: date-time
          readOnly: true
          type: string
    PeelOffMonitor:
      properties:
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        name:
          type: string
        reportingEndDate:
          format: date
          type: string
          nullable: true
        reportingStartDate:
          format: date
          type: string
          nullable: true
        siteId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - siteId
      type: object
    PeelOffMonitorCameraPosition:
      properties:
        cameraPositionId:
          format: uuid
          type: string
        countDirection:
          enum:
            - direction_1
            - direction_2
            - direction_both
          type: string
        countType:
          enum:
            - base
            - peel_off
          type: string
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        id:
          format: uuid
          type: string
          nullable: true
        peelOffMonitorId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - cameraPositionId
        - countDirection
        - countType
        - peelOffMonitorId
      type: object
    PeelOffReport:
      properties:
        endDate:
          description: >-
            It is the upper bound of the date range for which to return data.
            The `endDate` is non-inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`. If provided will take
            precedence over endAt.
          format: date
          type: string
        isOpen:
          default: false
          description: Flag to filter output within site opening hour window
          type: boolean
        peelOffMonitorIds:
          description: >-
            List of peel off monitor ids in the report. At least one id is
            required.
          items:
            format: uuid
            type: string
          type: array
        startDate:
          description: >-
            It is the lower bound of the date range for which to return data.
            The `startDate` is inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`.
          format: date
          type: string
        timeGrain:
          default: 1h
          description: The time window in the requested range to for data aggregation.
          enum:
            - 1s
            - 1m
            - 5m
            - 15m
            - 30m
            - 1h
            - 6h
            - 24h
          type: string
      type: object
    PeopleCount:
      properties:
        direction1Alias:
          readOnly: true
          type: string
        direction1Count:
          readOnly: true
          type: integer
          nullable: true
        direction2Alias:
          readOnly: true
          type: string
        direction2Count:
          readOnly: true
          type: integer
          nullable: true
        monitorName:
          readOnly: true
          type: string
        peopleCountMonitorId:
          format: uuid
          readOnly: true
          type: string
        time:
          format: date-time
          readOnly: true
          type: string
    PeopleCountMonitor:
      properties:
        dailyResetMin:
          default: 0
          format: uint64
          maximum: 1440
          minimum: 0
          type: integer
          nullable: true
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        direction1Alias:
          type: string
        direction2Alias:
          type: string
        id:
          format: uuid
          type: string
          nullable: true
        name:
          type: string
        reportingEndDate:
          format: date
          type: string
          nullable: true
        reportingStartDate:
          format: date
          type: string
          nullable: true
        siteId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - siteId
      type: object
    PeopleCountMonitorCameraPosition:
      properties:
        cameraPositionId:
          format: uuid
          type: string
        deletedAt:
          format: date-time
          readOnly: true
          type: string
          nullable: true
        direction1:
          enum:
            - direction_1
            - direction_2
          type: string
        id:
          format: uuid
          type: string
          nullable: true
        peopleCountMonitorId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      required:
        - cameraPositionId
        - direction1
        - peopleCountMonitorId
      type: object
    PeopleCountReport:
      properties:
        endDate:
          description: >-
            It is the upper bound of the date range for which to return data.
            The `endDate` is non-inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`.
          format: date
          type: string
        isOpen:
          default: false
          description: Flag to filter output within site opening hour window
          type: boolean
        peopleCountMonitorIds:
          description: >-
            List of people count monitor ids in the report. At least one id is
            required.
          items:
            format: uuid
            type: string
          type: array
        startDate:
          description: >-
            It is the lower bound of the date range for which to return data.
            The `startDate` is inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`.
          format: date
          type: string
        timeGrain:
          default: 1h
          description: The time window in the requested range to for data aggregation.
          enum:
            - 1s
            - 1m
            - 5m
            - 15m
            - 30m
            - 1h
            - 6h
            - 24h
          type: string
      type: object
    PutDwellTimeReportRequest:
      properties:
        approvedBy:
          description: approver of dwell time report
          type: string
        errorMessage:
          description: error message if rejected
          type: string
        status:
          description: The status of a dwell time.
          enum:
            - approved
            - rejected
          type: string
      required:
        - approvedBy
        - status
    ReportFilter:
      properties:
        cameraIds:
          description: A list of IDs of the cameras to fetch the data for.
          items:
            format: uuid
            type: string
          type: array
        endAt:
          description: >-
            The non-inclusive upper bound of the time range for which to return
            data.
          format: date-time
          type: string
        format:
          default: csv
          description: >-
            The format of returned data. Should be either `csv` or `json`. The
            default is `csv`.
          type: string
        startAt:
          description: The include lower bound of the time range for which to return data.
          format: date-time
          type: string
        timeGrain:
          default: 1h
          description: The time window in the requested range to for data aggregation.
          enum:
            - 1m
            - 5m
            - 15m
            - 30m
            - 1h
            - 6h
            - 1d
          type: string
      type: object
    Site:
      properties:
        address:
          type: string
        id:
          format: uuid
          type: string
          nullable: true
        name:
          minLength: 1
          type: string
        openingHour:
          type: object
          x-go-type:
            hints:
              kind: interface
              noValidation: true
            type: hoxton.DayOpeningHour
          nullable: true
        organisationId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
        tz:
          type: string
      required:
        - name
      type: object
    TalkBackData:
      properties:
        createdAt:
          format: date-time
          readOnly: true
          type: string
        recordedAt:
          format: date-time
          readOnly: true
          type: string
        talkbackDeviceId:
          description: A ID of talkback device data for.
          format: uuid
          type: string
        talkbackId:
          description: A ID of talkback to fetch the data for.
          format: uuid
          type: string
        transcript:
          type: string
        transcriptLang:
          type: string
        translated:
          type: boolean
        translation:
          type: string
    TalkBackDevice:
      properties:
        createdAt:
          format: date-time
          readOnly: true
          type: string
        description:
          type: string
        id:
          format: uuid
          type: string
          nullable: true
        siteId:
          format: uuid
          type: string
        state:
          enum:
            - active
            - deleted
          type: string
      type: object
    TalkBackReportRequest:
      properties:
        endDate:
          description: >-
            It is the upper bound of the date range for which to return data.
            The `endDate` is non-inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`
          format: date
          type: string
        startDate:
          description: >-
            It is the lower bound of the date range for which to return data.
            The `startDate` is inclusive; i.e, the returned data will be for
            dates from `startDate` to `endDate-1`
          format: date
          type: string
        talkbackDeviceId:
          description: A ID of talkback to fetch the data for.
          format: uuid
          type: string
      type: object
    User:
      properties:
        email:
          format: email
          type: string
        firstName:
          type: string
        id:
          type: string
          nullable: true
        lastName:
          type: string
        name:
          type: string
        organisationId:
          format: uuid
          type: string
        organisationName:
          type: string
          nullable: true
        roles:
          items:
            enum:
              - member
              - admin
              - support
            type: string
          type: array
        siteIds:
          description: A list of IDs of the sites to user visibility.
          items:
            format: uuid
            type: string
          type: array
      required:
        - organisationId
        - email
        - firstName
        - lastName
      type: object
    VideoUploadMetrics:
      properties:
        uploadSize:
          type: integer
        uploadTime:
          type: number
      type: object
