openapi: 3.0.2
servers:
  - url: 'https://{server}'
    variables:
      server:
        default: dashboard.situm.com
externalDocs:
  description: Visit our Developer Docs for more information.
  url: 'https://developers.situm.com'
info:
  description: >
    This OpenAPI specification describes the Situm REST APIs. These APIs allow
    you to work with cartography and location data stored in <a
    href="https://dashboard.situm.com/">Situm Platform</a>.


    > **_Consuming this API:_**  You may use most HTTP clients & libraries. We
    recommend <a href="https://curl.se/">curl</a> from the command line or <a
    href="https://www.postman.com/">Postman</a>

    if you prefer a GUI.


    > **_Generating a Client library:_**  Download this OpenAPI spec and

    paste it into the<a href="https://editor.swagger.io/"> Swagger Editor</a>.
    Then click on "Generate client", and select the language in which you want
    to auto-generate your API Client library.



    <br/>

    <strong style="font-size:25px">Hello World</strong>


    First of all, <a
    href="https://situm.freshdesk.com/support/solutions/articles/35000154638">create
    an APIKEY</a>.

    Then, you may call any of the API methods using your favourite HTTP client.
    For example, you may retrieve the buildings in your account.


    ```

    //Example using the APIKEY T9NPlzk+jSI/Oi5DG6ODk57O0pZXdx4

    curl  -H 'X-API-KEY: T9NPlzk+jSI/Oi5DG6ODk57O0pZXdx4'
    'https://dashboard.situm.es/api/v1/buildings/'

    ```


    <br/>

    <strong style="font-size:25px">Authentication and Authorization</strong>



    All requests must be authenticated.  We allow three methods. For more
    information please visit: <a
    href="http://developers.situm.com/pages/rest/authentication">Authentication
    page</a>.


    <a name="auth_jwt_bearer"></a>

    <strong>JWT Bearer (RECOMMENDED)</strong>. Headers contain a <a
    href="https://jwt.io/">JWT token</a>. To retrieve a JWT, you may use <a
    href="#operation/getToken">this API call</a>. Sample use:


    ```

    //Example using the JWT
    eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjCJlbWFpbCI6InFhLmFjYW5lZG9Ac2l0dW0uZXMi

    curl -H 'Content-Type: application/json' -H 'Authorization: Bearer
    eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjCJlbWFpbCI6InFhLmFjYW5lZG9Ac2l0dW0uZXMi'
    'https://dashboard.situm.com/api/v1/buildings'

    ```


    <a name="auth_apikey"></a>

    <strong>APIKEY</strong>. Headers contain the user email and APIKEY. You may
    create your APIKEY <a
    href="https://situm.freshdesk.com/support/solutions/articles/35000154638">following
    this doc</a>.  Sample usage:


    ```

    //Example using the APIKEY T9NPlzk+jSI/Oi5DG6ODk57O0pZXdx4

    curl -H 'X-API-KEY: T9NPlzk+jSI/Oi5DG6ODk57O0pZXdx4'
    'https://dashboard.situm.com/api/v1/buildings'

    ```

    <strong>Types of API keys</strong>. There are three types of API keys that
    restrict access to endpoints. API Keys can be created or edited from the
    Situm dashboard

    <ul>

    <li><strong>Read-write:</strong> This API key can operate without
    restrictions and invoke all the endpoints of the Situm API. Please, be
    careful when using this type of API key.</li>

    <li><strong>Read-only:</strong> Allows positioning and executing all GET
    requests to the Situm API.</li>

    <li><strong>Positionig:</strong> Allows positioning. We highly recommend
    using this type for mobile applications.</li>

    </ul>

    <br>


    ![SBRM
    logo](https://situm.com/wp-content/uploads/2023/05/Logo-SBRM-para-miniaturas-de-noticias-ENG-1024x71.jpg)
  version: 1.103.0
  title: Situm REST API
  contact:
    email: situm@situm.com
    name: developers@situm.com
  x-logo:
    url: 'http://developers.situm.com/images/common/logo-situm.svg'
    backgroundColor: '#000000'
    altText: Situm logo
tags:
  - name: JWT
    description: Operations related Authentication.
    x-public: true
  - name: Api Keys
    x-public: true
  - name: Alarms
    x-public: true
    description: >
      An alarm is a warning notification that something interesting/unexpected
      has happened. When an alarm is triggered, it will displayed on <a
      href="https://situm.freshdesk.com/a/solutions/articles/35000167782">Situm'
      Dashboard Real Time Panel</a>

      and it will also be available in through this API. Alarms are mostly
      triggered by <a
      href="https://situm.freshdesk.com/a/solutions/categories/35000137686/folders/35000221406">Situm
      MRM application</a>, but can also be created using this API.

      Currently, Situm allows a reduced set of alarm types:
       * <strong>DANGER</strong>. Indicates that somebody is in danger. Situm MRM triggers this alarm when the user <a href="https://situm.freshdesk.com/a/solutions/articles/35000148027">hits the "Alarm Button" or taps the phone repeatedly</a>.
       * <strong>DEADMAN</strong>. Indicates that somebody has fallen down. Situm MRM triggers this alarm when the user <a href="https://situm.freshdesk.com/a/solutions/articles/35000148027">falls down and lays on the ground for some time</a>.
       * <strong>GEOFENCE_MAX_STAY_TIME</strong>. Indicates that someone has exceeded the maximum stay time in a geofence.
       * <strong>ASSISTANCE_REQUEST</strong>.  Indicates that someone request for assistance.
       * <strong>BREACH</strong>. (Do not use!) Indicates that an user of Situm MRM app has missed a step of a round.
       * <strong>EMERGENCY</strong>. (Do not use! Deprecated!) Indicates that an emergency has been triggered.
       * <strong>STATIONARY</strong>. (Do not use!) Indicates that an user of Situm MRM app has been idle for a long time.

      Alarms can go through a series of states:
       * <strong>OPEN</strong>. When an alarm is created, this is always the first state. It means that the alarm has not been attended yet.
       * <strong>CLOSED</strong>. This is the state that the alarm will be assigned when it has been attended.
       * <strong>CONFIRMED</strong>. Indicates that the alarm has been confirmed (e.g. it is not a false alarm).
       * <strong>MARKED_FALSE</strong>. Indicates that the alarm has been confirmed as a false alarm.
       * <strong>OTHER</strong>. Other unknown state.
  - name: Analytics
    x-public: true
    description: Our service can collect large amounts of data and process it to serve it.
  - name: Reports
    x-beta-analytic: true
    description: >
      Our service can collect large amounts of data and process it to serve it.
      If performance or bandwidth consumption are important for you, you can get
      the answers in csv format.

      To do this, invoke the endpoint with <strong>.csv</strong> instead of
      <strong>.json</strong> when you fill the  <strong>format</strong> field.

      When using this API, please take the following into consideration:

       * The responses from the reports endpoints, when queried in JSON format, return a  <strong>meta</strong> object that provides information about the attributes returned in the data object.
        Specifically, it includes the attribute name, type, and whether the attribute is Nullable or not. For more information about the data types that can be returned, please refer to the following <a href="https://clickhouse.com/docs/en/sql-reference/data-types">link</a>.
       * The responses from the reports endpoints also include a  <strong>statistics </strong> object that allows you to evaluate the efficiency of the query. If the query is made in CSV format, this information can be obtained by examining the response header 'X-Db-Statistics'. If a particular query is taking too long or is inefficient, consider applying the filtering parameters provided by each of the endpoints.
       * The  <strong>time_zone</strong> parameter in the endpoints allows you to retrieve date fields in a specific time zone. When a particular time zone (different from UTC) is required, the dates will be returned as local time with no UTC relation information. For more information, you can refer to sections 4.2.2 and 4.3.2 of the <a href="https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf">ISO 8601</a> standard (Data elements and interchange formats).
       To illustrate this, let's assume that the response from one of the endpoints for a date field without requiring a specific time zone is: "timestamp": "2023-05-20T16:59:02Z". If, for example, we request the result in the "Europe/Madrid" time zone, the returned date will be: "timestamp": "2023-05-20 18:59:02".
  - name: Buildings
    x-public: true
    description: >
      A building is any venue where Situm's indoor location platform can be
      configured. More details

      <a
      href="http://developers.situm.com/pages/terminology/#building_container">here</a>. 

      To access information regarding supported cartography formats, including
      GeoJSON, IMDF, and Raster Tiles, please  consult our

      <a
      href="https://situm.com/docs/cartography-management/#supported-cartography">documentation</a>.
  - name: Devices
    x-public: true
    description: >-
      Manage the data and specs of your devices. To have this functionality you
      must have a module activated. If you are interested, please contact our
      technical department
  - name: Floors
    x-public: true
    description: >
      A floor is an entity representing a certain level of a building. More
      details

      <a
      href="http://developers.situm.com/pages/terminology/#floor_container">here</a>.
  - name: Geofences
    x-public: true
    description: >-
      A geofence is an user-defined enclosed space. Geofences can be used for
      statistics, user tracking and events.
  - name: Groups
    x-public: true
    description: >
      Groups are entities that allow different users to be associated in subsets
      under a certain name. This relationship is limited so that a user can only
      belong to one group that is defined in the user entity by the groups
      parameter
  - name: Infrastructure
    x-public: true
    description: >
      Represents the infrastructure of wifi access points and bluetooth beacons
      installed on a building.
  - name: Paths
    x-public: true
    description: >
      Paths are graphs that represent all the navigation routes within the
      building. More details

      <a
      href="http://developers.situm.com/pages/terminology/#paths_container">here</a>.
  - name: Points of Interest
    x-public: true
    description: >
      Represents any entity that occupies a certain geographical location. More
      details

      <a
      href="http://developers.situm.com/pages/terminology/#pois_container">here</a>
  - name: Realtime
    x-public: true
    description: >
      Real time refers to a service provided by Situm that allows to retrieve
      the location of every user in a building in real time. More details

      <a
      href="http://developers.situm.com/pages/terminology/#real-time_container">here</a>
  - name: Users
    x-public: true
    x-beta-analytic: true
paths:
  /api/v1/auth/apikeys:
    get:
      tags:
        - Api Keys
      summary: Gets the API Keys of an user
      description: >-
        Returns the list of API keys for the user making the request or the user
        you specify using the user_id query parameter.
      operationId: getApiKeys
      parameters:
        - in: query
          name: user_id
          description: >-
            Search by user id. See <a href="#tag/Users">Users </a> for details
            on how to retrieve the identifier of an user.
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      x-code-samples:
        - lang: curl
          label: Bearer JWT Auth
          source: >-
            curl -H 'Content-Type: application/json' -H 'Authorization: Bearer
            eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjI3MWFlMS1'
            https://dashboard.situm.com/api/v1/auth/apikeys
      responses:
        '200':
          description: Returns the list of api keys.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiKey'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/realtime/positions:
    post:
      tags:
        - Realtime
      summary: Upload device positions
      description: Upload the device positions. Allows both outdoor and indoor.
      operationId: realtimePositionUpload
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadPosesForm'
        required: true
      responses:
        '204':
          description: Successful operation
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/reports/geofencing_stay_time.{format}':
    get:
      operationId: reportsGeofencingStayTime
      tags:
        - Reports
      description: >-
        <strong>Roles allowed: admin, user manager and user. </strong></br></br>
        This analytic allows you to know how much time a user or device has
        spent in a certain geofece. This endpoint calculates the stay times on
        the fly directly from user positions. This means that if a geofence is
        created or modified, the stay times in this geofence will be available
        even for time intervals prior to its creation or modification.
      summary: >-
        Geofencing stay time endpoint. Provides information about  the time that
        a user or device has spent in a certain geofece.
      parameters:
        - name: organization_id
          in: query
          description: >-
            Filter by organization id. If not provided, the organization id of
            the user providing the authentication header will be used.
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - name: building_ids
          in: query
          description: >-
            List of comma separated buildings identifiers to search into.  If
            not provided, the authentication header will be used to retrieve
            this information.
          required: false
          example:
            - 123456
            - 432145
          style: form
          explode: false
          schema:
            type: array
            items:
              type: integer
            minItems: 1
        - name: from_date
          in: query
          description: >
            "Date (YYYY-MM-DDTHH:mm:ssZ). Filter the times of stay that started
            later or were active at the date indicated. In UTC time"
          required: true
          example: '2020-01-17T00:00:00Z'
          schema:
            type: string
            format: date-time
        - name: to_date
          in: query
          description: >
            "Date (YYYY-MM-DDTHH:mm:ssZ). Filter the times of stay that end
            before or are active at the date indicated.  In UTC time"
          required: true
          example: '2020-02-17T00:00:00Z'
          schema:
            type: string
            format: date-time
        - name: device_ids
          in: query
          description: >
            "List of comma separated devices that that should be considered to
            filter ."
          required: false
          example:
            - 12345432
            - 1234543262
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
            minItems: 1
        - name: user_ids
          in: query
          description: >
            "List of comma separated user identifiers that that should be
            considered to filter."
          required: false
          example:
            - 7c95f153-7229-4539-9c90-f4168f665f99
            - accadb7e-d573-497d-b833-777cb5e6feb1
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              format: uuid
            minItems: 1
        - name: fence_ids
          in: query
          description: >
            "List of comma separated fence identifiers that that should be
            considered to filter."
          required: false
          example:
            - 7c327cf6-df3a-4fa2-a6bd-f86c7850b7e3
            - b9758d28-d4eb-40e0-8fc6-8fac20d79cb4
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              format: uuid
            minItems: 1
        - name: only_assigned
          in: query
          description: |
            "To include only assigned devices to user in the search"
          required: false
          example: false
          schema:
            type: boolean
            default: false
        - name: group
          in: query
          description: >-
            Defines how the results are temporaly grouped. By default the
            grouping is done by day.
          schema:
            type: string
            enum:
              - day
              - hour
            default: day
        - name: min_stay_time
          in: query
          description: >
            Filter by a minimun duration of positioning inside the geofence in
            seconds.
          required: false
          example: 60
          schema:
            type: number
        - name: max_stay_time
          in: query
          description: >
            Filter by a maximum duration of positioning inside the geofence in
            seconds.
          required: false
          example: 2000
          schema:
            type: number
        - name: time_zone
          in: query
          description: >-
            Timezone identifier. Set the timezone of the results. If it is sent,
            and the value is different from UTC, the results will be returned in
            the indicated timezone with no UTC relation information. <p>Check
            out the avaliable timezones <a
            href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"
            target="_blank"> here</a>. For further information about time zones
            click  <a href="https://data.iana.org/time-zones/tz-link.html"
            target="_blank"> here</a>.</p>
          schema:
            type: string
            default: UTC
            example: Europe/Madrid
        - name: session_threshold
          in: query
          description: >
            Threshold value, expressed in seconds, to consider a closed session
            if no positioning is detected
          required: false
          example: 30
          schema:
            type: number
            default: 15
        - name: format
          required: true
          in: path
          description: Response format
          schema:
            type: string
            enum:
              - json csv
            example: json
      responses:
        '200':
          $ref: '#/components/responses/GeofencingStayTimeResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/reports/geofencing_sessions_matches.{format}':
    get:
      operationId: reportsGeofencingSessions
      tags:
        - Reports
      description: >-
        <strong>Roles allowed: admin, user manager and user. </strong></br></br>
        This endpoint allows to search for devices that are or have  been inside
        the geofences of a list of buildings, within a certain period of time.
        The result is a list, where each element represents the stay of a device
        in a  geofence, indicating the entrance and exit time. </br></br> The
        endpoint allows to filter the results by specifying the list of
        buildings, devices and geofences that should be considered. It also
        allows to  filter the results by temporal range. This endpoint
        calculates the positioning sessions on geofences the directly from user
        positions. This means that if a geofence is created or modified, the
        sessions in this geofence will be available even for time intervals
        prior to its creation or modification.
      summary: >-
        Geofencing seesios endpoint. Allows to search for devices that are or
        have  been inside the geofences of a list of buildings, within a certain
        period of time.
      parameters:
        - name: organization_id
          in: query
          description: >-
            Filter by organization id. If not provided, the organization id of
            the user providing the authentication header will be used.
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - name: building_ids
          in: query
          description: >-
            List of comma separated buildings identifiers to search into.  If
            not provided, the authentication header will be used to retrieve
            this information.
          required: false
          example:
            - 123456
            - 432145
          style: form
          explode: false
          schema:
            type: array
            items:
              type: integer
            minItems: 1
        - name: from_date
          in: query
          description: >
            "Date (YYYY-MM-DDTHH:mm:ssZ). Filter the times of stay that started
            later or were active at the date indicated."
          required: true
          example: '2020-01-17T00:00:00Z'
          schema:
            type: string
            format: date-time
        - name: to_date
          in: query
          description: >
            "Date (YYYY-MM-DDTHH:mm:ssZ). Filter the times of stay that end
            before or are active at the date indicated."
          required: true
          example: '2020-02-17T00:00:00Z'
          schema:
            type: string
            format: date-time
        - name: device_ids
          in: query
          description: >
            "List of comma separated devices that that should be considered to
            filter ."
          required: false
          example:
            - 12345432
            - 1234543262
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
            minItems: 1
        - name: user_ids
          in: query
          description: >
            "List of comma separated user identifiers that that should be
            considered to filter."
          required: false
          example:
            - 7c95f153-7229-4539-9c90-f4168f665f99
            - accadb7e-d573-497d-b833-777cb5e6feb1
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              format: uuid
            minItems: 1
        - name: fence_ids
          in: query
          description: >
            "List of comma separated fence identifiers that that should be
            considered to filter."
          required: false
          example:
            - 7c327cf6-df3a-4fa2-a6bd-f86c7850b7e3
            - b9758d28-d4eb-40e0-8fc6-8fac20d79cb4
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
              format: uuid
            minItems: 1
        - name: only_assigned
          in: query
          description: |
            "To include only assigned devices to user in the search"
          required: false
          example: false
          schema:
            type: boolean
            default: false
        - name: min_stay_time
          in: query
          description: >
            "Filter by a minimun duration of positioning inside the geofence in
            seconds"
          required: false
          example: 60
          schema:
            type: number
        - name: max_stay_time
          in: query
          description: >
            "Filter by a maximum duration of positioning inside the geofence in
            seconds"
          required: false
          example: 2000
          schema:
            type: number
        - name: time_zone
          in: query
          description: >-
            Timezone identifier. Set the timezone of the results. If it is sent,
            and the value is different from UTC, the results will be returned in
            the indicated timezone with no UTC relation information. <p>Check
            out the avaliable timezones <a
            href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"
            target="_blank"> here</a>. For further information about time zones
            click  <a href="https://data.iana.org/time-zones/tz-link.html"
            target="_blank"> here</a>.</p>
          schema:
            type: string
            default: UTC
            example: Europe/Madrid
        - name: session_threshold
          in: query
          description: >
            "threshold value, expressed in seconds, to consider a closed session
            if no positioning is detected"
          required: false
          example: 30
          schema:
            type: number
            default: 15
        - name: format
          required: true
          in: path
          description: Response format
          schema:
            type: string
            enum:
              - json csv
            example: json
      responses:
        '200':
          $ref: '#/components/responses/GeofencingSessionsMatchesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/reports/visitors.{format}':
    get:
      operationId: visitorsReports
      tags:
        - Reports
      description: >-
        Returns the number of unique visitors according to the selected grouping
        (hour, day or month) in a given time interval.
      summary: >-
        Visitors endpoint. Provides information about the unique visitors in
        buildings in diferent time agrupations.
      parameters:
        - name: building_id
          in: query
          description: |
            "The building identifier"
          required: true
          example: 10
          schema:
            type: integer
        - name: floor_id
          in: query
          description: |
            "The floor identifier"
          schema:
            type: integer
            example: 3245
        - name: from_date
          in: query
          description: >
            Date (YYYY-MM-DDTHH:mm:ssZ). Indicates the start of period to
            retrieve data. In UTC time
          required: true
          schema:
            type: string
            format: date-time
            example: '2020-08-17T00:00:00Z'
        - name: to_date
          in: query
          description: >
            Date (YYYY-MM-DDTHH:mm:ssZ). Indicates the end of period to retrieve
            data.In UTC time
          required: true
          schema:
            type: string
            format: date-time
            example: '2020-02-17T00:00:00Z'
        - name: group
          in: query
          description: >-
            Defines how the results are temporarily grouped. By default the
            grouping is done by day.
          schema:
            type: string
            enum:
              - month
              - day
              - hour
            default: day
            example: day
        - name: time_zone
          in: query
          description: >-
            Timezone identifier. Set the timezone of the results. If it is sent,
            and the value is different from UTC, the results will be returned in
            the indicated timezone with no UTC relation information. <p>Check
            out the avaliable timezones <a
            href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"
            target="_blank"> here</a>. For further information about time zones
            click  <a href="https://data.iana.org/time-zones/tz-link.html"
            target="_blank"> here</a>.</p>
          schema:
            type: string
            default: UTC
            example: Europe/Madrid
        - name: format
          required: true
          in: path
          description: Response format
          schema:
            type: string
            enum:
              - json csv
            example: json
      responses:
        '200':
          $ref: '#/components/responses/UserVisitorsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/reports/positioning_time.{format}':
    get:
      operationId: stayTimeReports
      tags:
        - Reports
      description: >-
        Return descriptive statistics about the time spent on a building by the
        users
      summary: >-
        Positioning time endpoint. Provides information about the time spent on
        building.
      parameters:
        - name: building_id
          in: query
          description: |
            "The building identifier"
          required: true
          schema:
            type: integer
            example: 10
        - name: floor_id
          in: query
          description: |
            "The floor identifier"
          schema:
            type: integer
            example: 3245
        - name: from_date
          in: query
          description: >
            Date (YYYY-MM-DDTHH:mm:ssZ). Indicates the start of period to
            retrieve data. In UTC time
          required: true
          schema:
            type: string
            format: date-time
            example: '2020-08-17T00:00:00Z'
        - name: to_date
          in: query
          description: >
            Date (YYYY-MM-DDTHH:mm:ssZ). Indicates the end of period to retrieve
            data.  In UTC time
          required: true
          schema:
            type: string
            format: date-time
            example: '2020-02-17T00:00:00Z'
        - name: group
          in: query
          description: >-
            Defines how the results are temporarily grouped. By default the
            grouping is done by day.
          schema:
            type: string
            enum:
              - month
              - day
              - hour
              - day_of_week
            default: day_of_week
            example: day_of_week
        - name: time_zone
          in: query
          description: >-
            Timezone identifier. Set the timezone of the results. If it is sent,
            and the value is different from UTC, the results will be returned in
            the indicated timezone with no UTC relation information. <p>Check
            out the avaliable timezones <a
            href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"
            target="_blank"> here</a>. For further information about time zones
            click  <a href="https://data.iana.org/time-zones/tz-link.html"
            target="_blank"> here</a>.</p>
          schema:
            type: string
            default: UTC
            example: Europe/Madrid
        - name: format
          required: true
          in: path
          description: Response format
          schema:
            type: string
            enum:
              - json csv
            example: json
      responses:
        '200':
          $ref: '#/components/responses/PositioningTimeResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/reports/heatmap.{format}':
    get:
      operationId: heatmapReports
      tags:
        - Reports
      description: >-
        User heatmap. Returns a list of geohash precision of 10, and its
        associated latitude and longitude, by user with a weight, for a building
        and a floor in a given time range.
      summary: >-
        Heatmap endpoint. Provides information about positioning density in a
        building.
      parameters:
        - name: building_id
          in: query
          description: |
            "The building identifier"
          required: true
          schema:
            type: integer
            example: 10
        - name: device_id
          in: query
          description: |
            "The device identifier"
          schema:
            type: integer
            example: 10
        - name: user_id
          in: query
          description: User id
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - name: floor_id
          required: true
          in: query
          description: |
            The floor identifier
          schema:
            type: integer
            example: 3245
        - name: from_date
          in: query
          description: >
            Date (YYYY-MM-DDTHH:mm:ssZ). Indicates the start of period to
            retrieve data. In UTC time
          required: true
          schema:
            type: string
            format: date-time
            example: '2020-08-17T00:00:00Z'
        - name: to_date
          in: query
          description: >
            Date (YYYY-MM-DDTHH:mm:ssZ). Indicates the start of period to
            retrieve data. In UTC time
          required: true
          schema:
            type: string
            format: date-time
            example: '2020-08-25T00:00:00Z'
        - name: position_type
          in: query
          description: >-
            Type of positions to filter. If not sent, both types will be
            returned.
          schema:
            type: string
            enum:
              - indoor
              - outdoor
        - name: format
          required: true
          in: path
          description: Response format
          schema:
            type: string
            enum:
              - json csv
            example: json
      responses:
        '200':
          $ref: '#/components/responses/GeohashHeatmapResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/reports/raw_data.{format}':
    get:
      operationId: rawDataReports
      tags:
        - Reports
      description: >-
        Returns the positions of the devices in the buildings in a time range
        with geospatial and geometric information..
      summary: >-
        Raw data endpoint. Provides information on the positioning of users in
        buildings.
      parameters:
        - name: organization_id
          in: query
          description: >-
            Filter by organization id. If not provided, the organization id of
            the user providing the authentication header will be used.
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - name: building_ids
          in: query
          description: >-
            List of comma separated buildings identifiers to search into.  If
            not provided, the authentication header will be used to retrieve
            this information.
          required: false
          style: form
          explode: false
          schema:
            type: array
            items:
              type: integer
            example:
              - 123456
              - 432145
            minItems: 1
        - name: floor_ids
          in: query
          description: List of comma separated floors identifiers to search into.
          style: form
          explode: false
          schema:
            type: array
            items:
              type: integer
            example:
              - 123456
              - 432145
            minItems: 1
        - name: device_ids
          in: query
          description: >
            List of comma separated devices that that should be considered to
            filter.
          required: false
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
            example:
              - 12345432
              - 1234543262
            minItems: 1
        - name: user_ids
          in: query
          description: >
            List of comma separated users identifiers that should be considered
            in the query to filter.
          required: false
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
            example:
              - 7cc5dcbe-94e7-4270-b778-459bf88928f2
              - 944ddbd0-ec44-40d5-8041-3defee3faa67
            minItems: 1
        - name: order_by
          in: query
          description: |
            List of fields separated by commas to sort the results.
          required: false
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
            example:
              - timestamp
              - device_id
            minItems: 1
        - name: order_direction
          in: query
          description: >-
            Defines the type of ordering of the fields sent in the order_by
            parameter.
          schema:
            type: string
            enum:
              - asc
              - desc
            example: desc
            default: asc
        - name: from_date
          in: query
          description: >
            Date (YYYY-MM-DDTHH:mm:ssZ). Indicates the start of period to
            retrieve data. In UTC time
          required: true
          schema:
            type: string
            format: date-time
            example: '2020-08-17T00:00:00Z'
        - name: to_date
          in: query
          description: >
            Date (YYYY-MM-DDTHH:mm:ssZ). Indicates the end of period to retrieve
            data. In UTC time
          required: true
          schema:
            type: string
            format: date-time
            example: '2020-02-17T00:00:00Z'
        - name: position_type
          in: query
          description: >-
            Type of positions to filter. If not sent, both types will be
            returned.
          schema:
            type: string
            enum:
              - indoor
              - outdoor
            example: indoor
        - name: limit
          in: query
          description: |
            To limit the number of entries returned.
          example: 10
          schema:
            type: integer
        - name: time_zone
          in: query
          description: >-
            Timezone identifier. Set the timezone of the results. If it is sent,
            and the value is different from UTC, the results will be returned in
            the indicated timezone with no UTC relation information. <p>Check
            out the avaliable timezones <a
            href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"
            target="_blank"> here</a>. For further information about time zones
            click  <a href="https://data.iana.org/time-zones/tz-link.html"
            target="_blank"> here</a>.</p>
          schema:
            type: string
            default: UTC
            example: Europe/Madrid
        - name: format
          required: true
          in: path
          description: Response format.
          schema:
            type: string
            enum:
              - json csv
            example: json
      responses:
        '200':
          $ref: '#/components/responses/RawDataResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/reports/user_positions.{format}':
    get:
      operationId: userPositionsReports
      tags:
        - Reports
      description: Return user's positions in a temporal range.
      summary: >-
        User trajectory endpoint. Provides information about user's the movement
        in a building.
      parameters:
        - name: building_id
          in: query
          description: |
            The building identifier.
          required: true
          schema:
            type: integer
            example: 19434
        - name: floor_id
          in: query
          description: |
            The floor identifier.
          schema:
            type: integer
            example: 3245
        - name: position_type
          in: query
          description: >-
            Type of positions to filter. If not sent, both types will be
            returned.
          schema:
            type: string
            enum:
              - indoor
              - outdoor
            example: indoor
        - name: device_id
          in: query
          description: |
            The device identifier.
          schema:
            type: string
            example: '19434'
        - name: user_id
          in: query
          description: User id.
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - name: from_date
          in: query
          description: >
            Date (YYYY-MM-DDTHH:mm:ssZ). Indicates the start of period to
            retrieve data. In UTC time
          required: true
          schema:
            type: string
            format: date-time
            example: '2020-08-17T00:00:00Z'
        - name: to_date
          in: query
          description: >
            Date (YYYY-MM-DDTHH:mm:ssZ). Indicates the end of period to retrieve
            data. In UTC time
          required: true
          schema:
            type: string
            format: date-time
            example: '2020-08-25T00:00:00Z'
        - name: seconds_gap
          in: query
          description: >
            To control the flow of data. It allows to return a position every
            certain number of seconds. For example, if a value of 10 is sent,
            the time range will be split into 10 second intervals and the first
            matching position in that range will be returned.
          example: 10
          schema:
            type: integer
        - name: time_zone
          in: query
          description: >-
            Timezone identifier. Set the timezone of the results. If it is sent,
            and the value is different from UTC, the results will be returned in
            the indicated timezone with no UTC relation information. <p>Check
            out the avaliable timezones <a
            href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"
            target="_blank"> here</a>. For further information about time zones
            click  <a href="https://data.iana.org/time-zones/tz-link.html"
            target="_blank"> here</a>.</p>
          schema:
            type: string
            default: UTC
            example: Europe/Madrid
        - name: format
          required: true
          in: path
          description: Response format.
          schema:
            type: string
            enum:
              - json csv
            example: json
      responses:
        '200':
          $ref: '#/components/responses/userPositionsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/alarms:
    get:
      tags:
        - Alarms
      summary: Gets a list of alarms
      description: 'Allows to retrieve a list of alarms, searching by multiple criteria.'
      operationId: getAlarms
      parameters:
        - name: organization_id
          in: query
          description: >-
            Filter alarms by organization id. If not provided, the organization
            id of the user providing the authentication header will be used.
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - name: active
          in: query
          description: >-
            If true, retrieves only alarms that are still active (have not been
            attended). If false, retrieves only alarms that are not active (have
            been attended already).  If not provided, retrieves all the alarms
            regardless of their active status.
          schema:
            type: boolean
        - name: building_id
          in: query
          required: true
          description: >-
            Filter alarms by building id. If not provided, alarms of any
            building will be returned.
          schema:
            type: integer
            format: long
            example: 17
        - name: type
          in: query
          description: >-
            Filter by alarm type (<a href="#tag/Alarms">see Alarms Section</a>
            for details). If not provided, alarms of any type will be returned.
          schema:
            type: array
            items:
              $ref: '#/components/schemas/AlarmType'
        - name: startDate
          in: query
          description: >-
            Search from the timestamp indicated. If not provided, no start
            timestamp limit is applied.
          explode: true
          schema:
            type: string
            format: date-time
            example: '2019-05-21T15:17:21.000000+01:00'
            description: Timestamp when the user enter in the fence.
        - name: endDate
          in: query
          description: >-
            Search until the timestamp indicated. If not provided,the current
            timestamp will be used by default. timestamp
          explode: true
          schema:
            type: string
            format: date-time
            example: '2019-05-31T15:17:21.000000+01:00'
            description: Timestamp when the user enter in the fence.
        - name: created_by
          in: query
          description: >-
            Filters by user that has created the alarm. If not provided, alarms
            created by any user will be returned.
          schema:
            type: string
            format: uuid
        - name: secondsFromCreation
          in: query
          description: >-
            Filter by alarms no older than the specified time in seconds.  If
            not provided, alarms irregardless of how old they are will be
            returned.
          schema:
            type: integer
      x-code-samples:
        - lang: curl
          label: Bearer JWT Auth
          source: >-
            curl -H 'Content-Type: application/json' -H 'Authorization: Bearer
            eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjI3MWFlMS1'
            https://dashboard.situm.com/api/v1/alarms?building_id=1234
      responses:
        '200':
          description: Returns the list of alarms that match the criteria.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Alarm'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
        - Alarms
      summary: Creates an alarm
      description: Creates a new alarm at a specific location.
      operationId: createAlarm
      x-code-samples:
        - lang: curl
          label: Bearer JWT Auth
          source: >-
            curl -X POST  -H 'Content-Type: application/json' -H 'Authorization:
            Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjI3MWFlMS1' -d '{ "type":
            "DANGER", "building_id": 6543, "floor_id": 13485, "x": 1, "y": 1}'  
            https://dashboard.situm.es/api/v1/alarms
      requestBody:
        required: true
        $ref: '#/components/requestBodies/AlarmForm'
      responses:
        '201':
          description: Returns the alarm created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alarm'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/alarms/{id}':
    get:
      tags:
        - Alarms
      summary: Gets an alarm
      description: Retrieves the information of an specific alarm.
      operationId: getAlarm
      parameters:
        - in: path
          name: id
          description: The identifier of the alarm that you want to retrieve.
          required: true
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      x-code-samples:
        - lang: curl
          label: Bearer JWT Auth
          source: >-
            curl -H 'Content-Type: application/json' -H 'Authorization: Bearer
            eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjI3MWFlMS1'
            https://dashboard.situm.com/api/v1/alarms/3fa85f64-5717-4562-b3fc-2c963f66afa6
      responses:
        '200':
          description: Returns the alarm information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alarm'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
        - Alarms
      summary: Updates an alarm
      description: >
        Updates an alarm. DO NOT USE THIS METHOD!

        This method does not update most of the parameters of the alarm and has
        evil business logic buried in it.

        For example, requires that either the "active" or "custom fields"
        parameters are available. Other example, assigns automatically an
        user_uuid to the status

        change if "active=true", but does not do it if "active=false".
      operationId: updateAlarm
      parameters:
        - in: path
          name: id
          description: The Alarm identifier to modify.
          required: true
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      x-code-samples:
        - lang: curl
          label: Curl JWT
          source: >-
            curl -X PUT -H 'Content-Type: application/json' -H 'Authorization:
            Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjI3MWFlMS1'
            https://dashboard.situm.com/api/v1/alarms/3fa85f64-5717-4562-b3fc-2c963f66afa6
      requestBody:
        description: Updates an alarm.
        required: true
        $ref: '#/components/requestBodies/AlarmUpdateForm'
      responses:
        '204':
          description: The alarm was updated properly
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
        - Alarms
      summary: Delete an alarm
      description: Deletes an alarm given its identifier.
      operationId: deleteAlarm
      parameters:
        - in: path
          name: id
          description: The identifier of the alarm to delete.
          required: true
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      x-code-samples:
        - lang: curl
          label: APIKEY Auth
          source: >-
            curl -X DELETE -H 'Content-Type: application/json' -H  
            'Authorization: Bearer
            eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjI3MWFlMS1' 
            https://dashboard.situm.com/api/v1/alarms/ecaded91-f30b-423b-970f-a8ad5e250d38
      responses:
        '204':
          description: The key was deleted properly
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/alarms/{id}/status_changes':
    post:
      tags:
        - Alarms
      summary: Creates an alarm status change
      description: >-
        Creates a new alarm status change from the provided info. See <a
        href="#tag/Alarms"> Alarms Section</a> for a list of the available alarm
        status.
      operationId: createAlarmStatusChange
      x-code-samples:
        - lang: curl
          label: Curl JWT
          source: >-
            curl -X POST -H 'Content-Type: application/json' -H  
            'Authorization: Bearer
            eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjI3MWFlMS1'  -d '$PAYLOAD'
            https://dashboard.situm.es/api/v1/alarms/bc6a2743-5588-4e62-b4b3-8b61ddf3b4c0/status_changes
      parameters:
        - in: path
          name: id
          description: The alarm identifier.
          required: true
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      requestBody:
        $ref: '#/components/requestBodies/AlarmStatusCreateForm'
      responses:
        '200':
          description: Returns the alarm status created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alarm'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/alarms/status_changes:
    post:
      tags:
        - Alarms
      summary: >-
        Creates a new list of alarm status change from the provided info. See
        Alarms Section for a list of the available alarm status.
      description: >-
        Creates a new list of alarm status change from the provided info. See <a
        href="#tag/Alarms"> Alarms Section</a> for a list of the available alarm
        status. For the moment we are just accepting the status CLOSED
      operationId: createAllAlarmStatusChange
      requestBody:
        $ref: '#/components/requestBodies/AlarmStatusChangeForm'
      responses:
        '200':
          description: The alarm status where created.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '501':
          $ref: '#/components/responses/NotImplemented'
  '/api/v1/alarms/{id}/status_changes/{status_id}':
    put:
      tags:
        - Alarms
      summary: Updates an alarm status change.
      description: >-
        Updates an alarm status change from the provided info. See <a
        href="#tag/Alarms"> Alarms Section</a> for a list of the available alarm
        sta
      operationId: updateAlarmStatusChange
      parameters:
        - in: path
          name: id
          description: The alarm identifier.
          required: true
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - in: path
          name: status_id
          description: The identifier of the status change  that will be updated.
          required: true
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      x-code-samples:
        - lang: curl
          label: Curl JWT
          source: >-
            curl -X PUT -H 'Content-Type: application/json' -H   'Authorization:
            Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjI3MWFlMS1'  -d '$PAYLOAD'
            https://dashboard.situm.es/api/v1/alarms/bc6a2743-5588-4e62-b4b3-8b61ddf3b4c0/status_changes/57eacccd-892b-40da-b482-12af71224212
      requestBody:
        required: true
        $ref: '#/components/requestBodies/AlarmStatusUpdateForm'
      responses:
        '204':
          description: The status was succesfully updated.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/geofencing/analytics:
    get:
      deprecated: true
      tags:
        - Analytics
      summary: >-
        Get the list of stays of users in geofences. Deprecated use
        /api/v1/reports/geofencing_sessions_matches.{format} instead.
      description: >-
        This endpoint allows to search for devices that are or have  been inside
        the geofences of a list of buildings, within a certain period of time.
        The result is a list, where each element represents the stay of a device
        in a  geofence, indicating the entrance and exit time. </br></br> The
        endpoint allows to filter the results by specifying the list of
        buildings, devices and geofences that should be considered. It also
        allows to  filter the results by start and end date.</br></br> This is
        an historical data endpoint and has to be treated as such. This endpoint
        will always return the stays according to how the geofences where when
        the user was being located, not how the geofences are at the current
        moment. This means that if you change (resize, move, delete) a geofence,
        the historical stays will NOT be modified accordingly, and therefore the
        stays returned may not be consistent  with the current geofences.
      parameters:
        - name: user_ids
          in: query
          description: >
            List of users identifiers that should be considered in the query.

            In case no identifier is passed, the query will be applied to all

            the devices. If you want to retrieve only the users assigned to a
            device, please take a look at the only-users query param. </br></br>

            Examples:
              <ul>
                <li>
                  user_ids=5bb86f35-5717-5462-c4fc-4d963f66ada6,3fa85f64-5717-4562-b3fc-2c963f66afa5
                  Only the results of users 5bb86f35-5717-5462-c4fc-4d963f66ada6
                  and 3fa85f64-5717-4562-b3fc-2c963f66afa5 will be returned.
                </li>
                <li>
                  user_ids=5bb86f35-5717-5462-c4fc-4d963f66ada6&user_ids=3fa85f64-5717-4562-b3fc-2c963f66afa5.
                  Only the results of users 5bb86f35-5717-5462-c4fc-4d963f66ada6
                  and 3fa85f64-5717-4562-b3fc-2c963f66afa5 will be returned.
                </li>
            </ul>
          explode: true
          schema:
            type: array
            items:
              type: string
              format: uuid
            minItems: 1
        - name: building_ids
          in: query
          description: >
            List of building identifiers that should be considered in the query.
            In case no identifier is passed, the query will be applied to all
            the buildings. </br></br>

            Examples: <ul> <li>building_ids=123,421. The query applies to
            buildings 123, 421.</li> <li>building_ids=123&building_ids=421. The
            query applies to buildings 123, 421.</li></ul>
          explode: true
          schema:
            type: array
            items:
              type: integer
            minItems: 1
        - name: device_ids
          in: query
          description: >
            Only the results related to these device identifiers will be
            returned. In case no identifier is passed, this filter will not be
            applied and the results of all the devices will be
            returned.</br></br>

            Examples: <ul> <li>device_ids=1323423123,738748598. Only the results
            of devices 1323423123 and 738748598 will be returned.</li>
            <li>device_ids=13234231236&device_ids=738748598. Only the results of
            devices 1323423123 and 738748598 will be returned.</li></ul>
          explode: true
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: fence_ids
          in: query
          description: >
            Only the results related to these fence identifiers will be
            returned. In case no identifier is passed, this filter will not be
            applied and the results of all the fences will be
            returned.</br></br>

            Examples: <ul>
            <li>fence_ids=5bb86f35-5717-5462-c4fc-4d963f66ada6,3fa85f64-5717-4562-b3fc-2c963f66afa5.
            Only the results of fences 5bb86f35-5717-5462-c4fc-4d963f66ada6 and
            3fa85f64-5717-4562-b3fc-2c963f66afa5 will be returned.</li>
            <li>fence_ids=5bb86f35-5717-5462-c4fc-4d963f66ada6&fence_ids=3fa85f64-5717-4562-b3fc-2c963f66afa5.
            Only the results of fences 5bb86f35-5717-5462-c4fc-4d963f66ada6 and
            3fa85f64-5717-4562-b3fc-2c963f66afa5 will be returned.</li></ul>
          explode: true
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: from
          in: query
          description: >
            Only the results that happen at this date or after will be returned.
            In case no date is passed, the current time minus 15 seconds will be
            used.</br></br>

            Examples: <ul> <li>from="2019-05-21T15:17:21.000000+01:00".  The
            query applies at date "2019-05-21T15:17:21.000000+01:00" or
            after.</li> <li>from="2019-05-21T15:17:21.000000+01:00".  The query
            applies at date "2019-05-21T15:17:21.000000+01:00" or after.</li>
            </ul>
          explode: true
          schema:
            type: string
            format: date-time
            example: '2019-05-21T15:17:21.000000+01:00'
            description: Timestamp when the user enter in the fence.
        - name: to
          in: query
          description: >-
            Only the results that happen at this date or before. In case no date
            is passed, the current time will be used.
          explode: true
          schema:
            type: string
            format: date-time
            example: '2019-05-21T15:17:21.000000+01:00'
            description: Timestamp when the user enter in the fence.
        - name: only_assigned
          in: query
          description: >-
            If is true only return devices assigned if not the devices is not
            assigned to a user.
          explode: true
          schema:
            type: boolean
        - name: size
          in: query
          description: >-
            This parameter allows to paginate the results, defining the maximum
            number of elements per page. If not specified, all the results will
            be returned in a single page. Must be greater than zero.
          explode: true
          schema:
            type: integer
        - name: page
          in: query
          description: >-
            This parameter allows to retrieve a certain page of the results,
            only if the results have been paginated (parameter size has been
            specified with a correct value). Must be greater or equal to zero.
          explode: true
          schema:
            type: integer
      responses:
        '200':
          description: Successful operation
          $ref: '#/components/responses/UserFencesPagedResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/geofences/search:
    get:
      tags:
        - Geofences
      summary: Get all geofences.
      description: >-
        This endpoint allows you to search the fences created for the
        organization. The endpoint allows to filter the results by specifying
        the list of buildings, the name of fence or the status of fence (deleted
        or not).All params organization_id,name,building_ids can't be empty. One
        of them must be provided.
      parameters:
        - name: organization_id
          in: query
          description: The identifier of the organization.
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
        - name: building_id
          in: query
          description: >-
            List of building identifiers that should be considered in the query.
            In case no identifier is passed, the query will be applied to all
            the buildings. </br></br> Examples: <ul> <li>building_id=123, 421.
            The query applies to buildings 123, 421.</li>
            <li>building_id=123&building_id=421. The query applies to buildings
            123, 421.</li> </ul>
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: integer
            minItems: 1
        - name: name
          in: query
          description: >-
            Only the results related to this fence name will be returned. In
            case no name is passed, this filter will not be applied.</br></br>
          required: false
          style: form
          explode: true
          schema:
            type: string
            example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
        - name: deleted
          in: query
          description: >-
            If the value of this field is true, only the deleted (soft delete)
            fences will be returned.</br></br>
          style: form
          explode: true
          schema:
            type: boolean
            default: false
        - name: size
          in: query
          description: >-
            This parameter allows to paginate the results, defining the maximum
            number of elements per page. If not specified, all the results will
            be returned in a single page. Must be greater than zero.
          required: false
          style: form
          explode: true
          schema:
            type: integer
            default: 10
        - name: page
          in: query
          description: >-
            This parameter allows to retrieve a certain page of the results,
            only if the results have been paginated (parameter size has been
            specified with a correct value). Must be greater or equal to zero.
          required: false
          style: form
          explode: true
          schema:
            type: integer
            default: 1
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      allOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                          example:
                            id: 533b7796-0ca8-45dc-82df-55f3b1fcd0f5
                        - $ref: '#/components/schemas/Geofence'
                  metadata:
                    $ref: '#/components/schemas/PaginationMetadata'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
        - Geofences
      summary: Search Geofence with POST request.
      description: >-
        This endpoint allows you to search the fences created for the
        organization. The endpoint allows to filter the results by specifying
        the list of buildings, the name of fence or the status of fence
        (deleted).
      requestBody:
        $ref: '#/components/requestBodies/GeofencesSearchForm'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      allOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                          example:
                            id: 533b7796-0ca8-45dc-82df-55f3b1fcd0f5
                        - $ref: '#/components/schemas/Geofence'
                  metadata:
                    $ref: '#/components/schemas/PaginationMetadata'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/geofences:
    post:
      tags:
        - Geofences
      summary: Create a geofence.
      description: Creates a geofence.
      requestBody:
        $ref: '#/components/requestBodies/GeofenceCreationForm'
        required: true
      responses:
        '201':
          description: the entity was created Sucessfuly
          $ref: '#/components/responses/GeofenceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/geofences/{id}':
    get:
      tags:
        - Geofences
      summary: Get one geofence.
      description: Returns the geofence information given its id.
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
            example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
        - name: organization_id
          in: query
          required: false
          style: form
          schema:
            type: string
            example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
      responses:
        '200':
          $ref: '#/components/responses/GeofenceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
        - Geofences
      summary: Update a geofence.
      description: Updates an geofence.
      parameters:
        - name: id
          required: true
          in: path
          description: The fence identifier that will be updated
          explode: true
          schema:
            type: string
            example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
      requestBody:
        $ref: '#/components/requestBodies/GeofenceUpdateForm'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/GeofenceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
        - Geofences
      summary: Delete Geofence.
      description: Delete an Geofence.
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
            example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
        - name: organization_id
          in: query
          required: false
          style: form
          schema:
            type: string
            example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
      responses:
        '204':
          description: The entity was deleted Sucessfuly.
          headers: {}
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/groups:
    get:
      tags:
        - Groups
      summary: Get the list of groups.
      description: Returns a list of groups filtered using the specified parameters.
      operationId: getGroups
      parameters:
        - name: has_parent
          in: query
          description: Search by if group have parent or not.
          schema:
            type: boolean
            example: true
        - name: is_staff
          in: query
          description: find the groups that belong to staff.
          deprecated: true
          schema:
            type: boolean
            example: true
      responses:
        '200':
          description: Returns the list of groups.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
        - Groups
      summary: Creates a Group.
      description: Creates a group.
      operationId: createGroup
      requestBody:
        $ref: '#/components/requestBodies/GroupCreateForm'
      responses:
        '201':
          description: the entity was created Sucessfuly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/groups/{id}':
    put:
      tags:
        - Groups
      summary: Update  group.
      description: Updates a group.
      operationId: updateGroups
      parameters:
        - in: path
          name: id
          description: The Group identifier to update.
          required: true
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      requestBody:
        $ref: '#/components/requestBodies/GroupUpdateForm'
      responses:
        '201':
          description: the entity was updated properly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
        - Groups
      summary: Delete a group.
      description: Deletes a group given its id.
      operationId: deleteGroups
      parameters:
        - in: path
          name: id
          description: The group identifier tho delete.
          required: true
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      responses:
        '204':
          description: The key was deleted properly
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/organizations/current_organization:
    get:
      tags:
        - Organizations
      summary: Get user's current organization.
      description: This endpoint retrieve the current user organization
      operationId: getCurrentOrganization
      responses:
        '200':
          $ref: '#/components/responses/OrganizationResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
      deprecated: false
  /api/v1/auth/access_tokens:
    post:
      tags:
        - JWT
      summary: Generates a JWT Bearer.
      description: >-
        Returns a JWT Bearer that you may use to authenticate your requests
        using <a href="#auth_jwt_bearer"> JWT Bearer Authentication</a>.
      security:
        - AuthorizationAPIKEY: []
        - AuthorizationBearerJWT: []
      operationId: getToken
      x-code-samples:
        - lang: curl
          label: Curl APIKEY
          source: >-
            curl -X POST -H 'Content-Type: application/json' -H 'X-API-KEY:
            T9NP2lzk+jSI/Oi5DG6ODk57O0pZXdx4'
            https://dashboard.situm.com/api/v1/auth/access_tokens
        - lang: curl
          label: Curl JWT
          source: >-
            curl -X POST -H 'Content-Type: application/json' -H 'Authorization:
            Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiMjI3MWFlMS1'
            https://dashboard.situm.com/api/v1/auth/access_tokens
      responses:
        '201':
          description: Sucessful operation.
          content:
            application/json:
              schema:
                type: string
                example:
                  access_token: >-
                    eyJhbGciOiJIUzI1NiJ9.ewogICJzdWIiOiAiODIwODNlNmYtMmVhMy05OTk5LTliNDQtZTRiMmRjNWI2NTg1IiwKICAiZW1haWwiOiAiZXhhbXBsZWVtYWlsQHNpdHVtLmVzIiwKICAib3JnYW5pemF0aW9uX3V1aWQiOiAieW91ci1vcmdhbml6YXRpb24taWQiLAogICJpYXQiOiAxNTcwNDQzMjA5LAogICJleHAiOiAxNTcwODAzMjA5Cn0.4cIUbGmnihyZADs3OwFyin-6wbmJUiO1UH8EOnA4sfk
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/auth/access_tokens_apikey:
    post:
      deprecated: true
      tags:
        - JWT
      summary: Generates a JWT from an user/Curl APIKEYentication.
      security:
        - AuthorizationAPIKEY: []
      description: >-
        Returns a JWT that you may use to authenticate your requests (see Login
        Section for details).
      operationId: getTokenFromApiKey
      parameters:
        - in: header
          required: true
          name: Authorization
          description: 'Basic <"user:apiKey" encoded in Base64>'
          schema:
            type: string
            format: byte
      x-code-samples:
        - lang: curl
          label: Basic Auth
          source: >-
            curl -X POST -H 'Authorization: Basic <user:apikey encoded in base
            64>' https://dashboard.situm.com/api/v1/auth/access_tokens
      responses:
        '201':
          description: Sucessful operation.
          content:
            application/json:
              schema:
                type: string
                example:
                  access_token: >-
                    eyJhbGciOiJIUzI1NiJ9.ewogICJzdWIiOiAiODIwODNlNmYtMmVhMy05OTk5LTliNDQtZTRiMmRjNWI2NTg1IiwKICAiZW1haWwiOiAiZXhhbXBsZWVtYWlsQHNpdHVtLmVzIiwKICAib3JnYW5pemF0aW9uX3V1aWQiOiAieW91ci1vcmdhbml6YXRpb24taWQiLAogICJpYXQiOiAxNTcwNDQzMjA5LAogICJleHAiOiAxNTcwODAzMjA5Cn0.4cIUbGmnihyZADs3OwFyin-6wbmJUiO1UH8EOnA4sfk
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/buildings:
    get:
      tags:
        - Buildings
      operationId: getBuildings
      summary: Get all your buildings.
      description: Returns all the buildings you can access and their basic data.
      responses:
        '200':
          description: Returns the list of buildings.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Building'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
        - Buildings
      summary: Create a building.
      description: >
        Creates the geometry of a building. The calculation is automatically
        performed based on the provided data in the request.

        Through the building's dimensions, location (center), and rotation, the
        system automatically determines the

        precise latitude and longitude of its corners. To fully understand the
        underlying concepts, we recommend consulting

        the following <a href="https://situm.com/docs/cartography-management"
        target="_blank">documentation</a>.

        Please consider the following when creating a building.
          *  Dimensions should be expressed in meters.
          *  Location should be expressed in decimal degrees (DD).
          *  Rotation should be expressed in radians. In starting from the west in a counter-clockwise order.
          *  To assign the building icon, you first need to upload the image using <a href="#/Images/uploadImage" > `Images API`</a> .
          *  Once a building is created with a certain width and height, the dimensions cannot be modified if the aspect ratio is not maintained.
          *  Once a building is created, a floor must be created either through the dashboard or using the  <a href="#/Floors/createFloor" >`Floors API`</a>  in order to start operating with it and create other entities such as points of interest or geofences.
      operationId: createBuilding.
      requestBody:
        $ref: '#/components/requestBodies/BuildingCreateForm'
      responses:
        '201':
          description: Returns the list of buildings.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Building'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/buildings/{id}':
    get:
      tags:
        - Buildings
      summary: Get one building.
      operationId: getBuilding
      description: >-
        This method is an aggregation of all the information of a certain
        building, including: basic building information, floors, paths, events,
        indoor POIs and outdoor POIs. This information can be retrieved
        consulting each resource individually.
      parameters:
        - in: path
          name: id
          description: The building id.
          required: true
          schema:
            type: integer
            minimum: 1
            format: long
            example: '12345'
      responses:
        '200':
          $ref: '#/components/responses/BuildingResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
        - Buildings
      summary: Updates an existing building.
      description: >
        Updates an existing building. Please be advised that when using this
        endpoint to make a PUT request, it is important to understand  that the
        entire existing object will be replaced with the new provided
        information.

        Ensure that all required fields and data are included to prevent data
        loss. Any omitted field in the request will be considered null in the
        object update.
      operationId: updateBuilding
      requestBody:
        $ref: '#/components/requestBodies/BuildingUpdateForm'
      parameters:
        - in: path
          name: id
          description: The building id.
          required: true
          schema:
            type: integer
            minimum: 1
            example: '12345'
      responses:
        '200':
          description: Returns the building.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Building'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
        - Buildings
      summary: Delete a building.
      description: Deletes a building given its id.
      operationId: deleteBuilding
      parameters:
        - name: id
          required: true
          in: path
          description: Building identifier.
          explode: true
          schema:
            type: string
            example: 1
      responses:
        '200':
          description: the building was deleted properly.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                  status:
                    type: integer
                    example: 200
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/buildings/{id}/floors':
    get:
      tags:
        - Floors
      summary: Get all the floors of a building.
      description: >-
        Returns all the floors of the building specified by the identifier query
        param.
      parameters:
        - in: path
          name: id
          description: The building id.
          required: true
          schema:
            type: integer
            minimum: 1
            example: '12345'
      responses:
        '200':
          description: Returns the floors.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Floor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/buildings/{id}/vector_map':
    post:
      summary: Upload a vector map to a building in IMDF or GeoJSON format.
      description: >
        Allows you to upload the vector map of a building in IMDF/GeoJSON
        format. Uploaded file should have '.geojson' extension. 

        More info in our <a
        href='https://situm.com/docs/cartography-management/#geojson'>GeoJSON</a> 
        or <a
        href='https://situm.com/docs/cartography-management/#imdf'>IMDF</a>
        docs.
      tags:
        - Buildings
      parameters:
        - name: id
          in: path
          description: The building Identifier
          required: true
          schema:
            type: integer
            example: 123456
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The  IMDF or GeoJSON file with .geojson extension
              required:
                - file
      responses:
        '204':
          description: Successful operation.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    get:
      summary: Export vector maps from a building.
      description: |
        Retrieves the vector map file (IMDF or GeoJSON) of the building
      tags:
        - Buildings
      parameters:
        - name: id
          in: path
          description: The building Identifier
          required: true
          schema:
            type: integer
            example: 123456
      responses:
        '200':
          description: Successful operation.
          content:
            application/octet-stream:
              schema:
                type: string
                example: >-
                  attachment;
                  filename="vector_maps_8112_BuildingName_20240131115959.zip"
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/buildings/{id}/raster_tiles':
    post:
      summary: Upload raster tiles to a building.
      description: >
        Allows you to upload raster tiles to a building. Uploaded file should
        have '.zip' extension, containing a directory structure as detailed <a
        href='https://situm.com/docs/cartography-management/#raster-tiles'>here</a>.
      tags:
        - Buildings
      parameters:
        - name: id
          in: path
          description: The building Identifier
          required: true
          schema:
            type: integer
            example: 123456
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The  Raster Tiles file with .zip extension
              required:
                - file
      responses:
        '204':
          description: Successful operation.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    get:
      summary: Export raster tiles from a building.
      description: Retrieves the raster tiles map of the building.
      tags:
        - Buildings
      parameters:
        - name: id
          in: path
          description: The building Identifier
          required: true
          schema:
            type: integer
            example: 123456
      responses:
        '200':
          description: Successful operation.
          content:
            application/octet-stream:
              schema:
                type: string
                example: >-
                  attachment;
                  filename="raster_tiles_8112_BuildingName_20240131115959.zip"
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/floors:
    post:
      summary: Creates a new floor on a building.
      description: >
        Creates a new floor on a building. Please consider the following when
        creating a floor:
           *  Please consider when creating a floor and assigning a floor map, you first need to upload the floor map image using <a href="#/Images/uploadImage" > `Images API`</a> .
      operationId: createFloor
      tags:
        - Floors
      requestBody:
        required: true
        $ref: '#/components/requestBodies/FloorForm'
      responses:
        '201':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/Floor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/paths:
    get:
      tags:
        - Paths
      summary: Get all the paths.
      description: Returns all the paths.
      parameters:
        - in: query
          name: building_id
          description: The building id.
          schema:
            type: integer
            minimum: 1
            example: '12345'
        - name: organization_id
          in: query
          description: The organization identifier where events belong.
          schema:
            type: string
            format: uui
      responses:
        '200':
          description: Returns the paths.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Path'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/buildings/{building_id}/paths':
    get:
      tags:
        - Paths
      summary: Get all the paths of a building.
      description: >-
        Returns all the paths inside a building specified by the identifier
        query param.
      parameters:
        - in: path
          name: building_id
          description: The building id
          required: true
          schema:
            type: integer
            minimum: 1
            example: '12345'
      responses:
        '200':
          description: Returns the paths.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Path'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
        - Paths
      summary: Updates the paths of a building.
      description: >-
        Updates the paths of a  building specified by the identifier query
        param.
      parameters:
        - in: path
          name: building_id
          description: The building id
          required: true
          schema:
            type: integer
            minimum: 1
            example: '12345'
      requestBody:
        $ref: '#/components/requestBodies/PathForm'
      responses:
        '200':
          description: The path was updated properly.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/buildings/{id}/pois':
    get:
      tags:
        - Points of Interest
      summary: Get all the points of interest of a building.
      description: >-
        Retrieve all the points of interest of a building. Those with floor_id
        with null value are interpreted as outdoor ones.
      parameters:
        - in: path
          name: id
          description: The building id.
          required: true
          schema:
            type: integer
            minimum: 1
            example: '12345'
        - in: query
          name: type
          description: Type of point of interest. A poi can be indoor or outdoor.
          schema:
            type: string
            enum:
              - indoor
              - outdoor
            example: outdoor
      responses:
        '200':
          description: List of points of interest in a building.
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/PoiOutdoor'
                    - $ref: '#/components/schemas/PoiIndoor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/buildings/{id}/exterior_pois':
    get:
      deprecated: true
      tags:
        - Points of Interest
      summary: Get all the points of interest outside the building.
      description: >-
        Get all the points of interest outside the building. All this list of
        poses must have floor_id as null. Use
        /api/v1/buildings/{id}/pois?type=outdoor instead
      parameters:
        - in: path
          name: id
          description: The building id.
          required: true
          schema:
            type: integer
            minimum: 1
            example: '12345'
      responses:
        '200':
          description: Returns the paths.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PoiOutdoor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/poi_categories:
    get:
      parameters:
        - in: query
          name: base64_enabled
          description: Enable return images in the same response
          schema:
            type: boolean
            example: 'true'
      tags:
        - Points of Interest
      summary: Get all the pois categories.
      operationId: getPoiCategories
      description: >-
        Each Point of Interest can have a category (e.g. "toilet", "shop", etc).

        Each category has an unique identifier, a name in english, a name in
        spanish and an icon.

        The platform provides a set of categories by default, but the user can
        also define its own categories.
      responses:
        '200':
          description: Returns the list of categories.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PoiCategory'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
        - Points of Interest
      summary: Creates a new Point of Interest (POI) category.
      description: >-
        Creates a new Point of Interest (POI) category. It will belong privately
        to the user that creates it.
      operationId: createPoiCategory
      requestBody:
        $ref: '#/components/requestBodies/PoiCategoryForm'
      responses:
        '201':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/PoiCategory'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/poi_categories/{id}':
    put:
      summary: Updates an existing POI category with POI category id.
      operationId: putPoiCategories
      tags:
        - Points of Interest
      parameters:
        - in: path
          name: id
          description: The poi category id.
          required: true
          schema:
            type: integer
            minimum: 1
            example: '12345'
      requestBody:
        $ref: '#/components/requestBodies/PoiCategoryForm'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/PoiCategory'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      summary: Delete an existing POI category with POI category id.
      tags:
        - Points of Interest
      parameters:
        - in: path
          name: id
          description: The poi category id.
          required: true
          schema:
            type: integer
            minimum: 1
            example: '12345'
      responses:
        '200':
          description: Successful operation.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/pois:
    get:
      tags:
        - Points of Interest
      summary: Get all the points of interest.
      parameters:
        - in: query
          name: building_id
          description: The building id
          schema:
            type: integer
            minimum: 1
            example: '12345'
      responses:
        '200':
          description: List of points of interest in a building
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/PoiOutdoor'
                    - $ref: '#/components/schemas/PoiIndoor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
        - Points of Interest
      summary: Creates a POI.
      description: >-
        Creates a point of interest inside a building in the specified location.
        A POI of interest can share the same location with another point of
        interest. To assign an icon and a selected icon to Poi, you first need
        to upload the images using <a href="#/Images/uploadImage" > Images
        API</a>.
      operationId: createPoi
      responses:
        '201':
          description: Returns the point of interest created
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/PoiOutdoor'
                  - $ref: '#/components/schemas/PoiIndoor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      requestBody:
        $ref: '#/components/requestBodies/PoiCreateForm'
  '/api/v1/pois/{id}':
    put:
      tags:
        - Points of Interest
      summary: Updates a POI.
      description: >
        Updates a point of interest. When using this API, please take the
        following into consideration:

        * It is important to understand  that the entire existing object will be
        replaced with the new provided information.

        Ensure that all fields and data are included to prevent data loss. Any
        omitted field in the request will be considered null in the object
        update.

        *  A POI of interest can share the same location with another point of
        interest.

        *  You can use this endpoint to transform an indoor POI into an outdoor
        one by passing the floor_id to null.

        *  To assign an icon and a selected icon to Poi, you first need to
        upload the images using <a href="#/Images/uploadImage" > Images API</a>.

        * If you want to modify a POI and keep the images, you should send the
        fields icon and selected_icon with their current values. To unassign an
        image from a POI, set the corresponding field for icon or selected_icon
        to null.
      operationId: updatePoi
      parameters:
        - in: path
          name: id
          description: Point of interest identifier
          required: true
          schema:
            type: integer
            minimum: 1
            example: '13345'
      requestBody:
        required: true
        $ref: '#/components/requestBodies/PoiUpdateForm'
      responses:
        '200':
          description: Returns the point of interest updated
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/PoiOutdoor'
                  - $ref: '#/components/schemas/PoiIndoor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
        - Points of Interest
      summary: Deletes a POI.
      description: Deletes a point of interest given its id.
      operationId: deletePoi
      parameters:
        - in: path
          name: id
          description: The point of interest id
          required: true
          schema:
            type: integer
            minimum: 1
            example: '12345'
      responses:
        '200':
          description: Returns a message
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                    example: The POI was deleted
                  status:
                    type: integer
                    example: 200
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/infrastructure:
    get:
      tags:
        - Infrastructure
      summary: >-
        Obtain useful data from the bluetooth and wifi infrastructure of a
        building.
      description: >
        This endpoint will provide information for all the wifi APs (access
        points)

        and bluetooth beacons of a building, such as their position, when it

        was last listened, battery level if available...
      operationId: getInfraestructure
      parameters:
        - in: query
          name: building_id
          description: identifier of the building.
          required: true
          schema:
            type: integer
            format: long
            example: 1234
        - in: query
          name: sensor
          description: Indicates the type of APs that will be returned.
          required: true
          schema:
            type: string
            enum:
              - wifi
              - ble
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - FeatureCollection
                  features:
                    type: array
                    items:
                      allOf:
                        - type: object
                          properties:
                            properties:
                              $ref: '#/components/schemas/ApInformation'
                        - $ref: '#/components/schemas/GeoJSONFeaturePoint'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/images:
    post:
      summary: Upload a image into platform to use it in other requests.
      tags:
        - Images
      parameters:
        - in: query
          name: rtf
          schema:
            type: boolean
          description: indicates if the image is rtf format.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: binary
              required:
                - image
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/Image'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/floors/{id}':
    get:
      tags:
        - Floors
      summary: Get one floor.
      description: >
        Each floor resource contains, among other information, the physical
        level of the floor, the floorplan image and its scale (pixels/meter).
      parameters:
        - name: id
          in: path
          description: The floor id.
          required: true
          schema:
            type: integer
            minimum: 1
            example: 12345
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Floor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      summary: Updates a floor with given id.
      description: >
        Updates a floor with with a given id. Please be advised that when using
        this endpoint to make a PUT request, it is important to understand  that
        the entire existing object will be replaced with the new provided
        information.
         Ensure that all fields and data are included to prevent data loss. Any omitted field in the request will be considered null in the object update.
      tags:
        - Floors
      parameters:
        - name: id
          in: path
          description: The floor id
          required: true
          schema:
            type: integer
            minimum: 1
            example: 12345
      requestBody:
        $ref: '#/components/requestBodies/FloorForm'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/Floor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      summary: Deletes a floor with given id.
      tags:
        - Floors
      parameters:
        - name: id
          in: path
          description: The floor id
          required: true
          schema:
            type: integer
            minimum: 1
            example: 12345
      responses:
        '200':
          description: The floor was deleted properly.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/realtime/organization/{id}':
    get:
      tags:
        - Realtime
      summary: Get all realtime users positions of an organization.
      description: Returns the positions of the users who are currently positioning.
      operationId: realtimePositionByOrganization.
      parameters:
        - in: path
          name: id
          required: true
          description: Search by organization id.
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - in: query
          name: indoor
          description: Select only filter for indoor positions.
          schema:
            type: boolean
        - in: query
          name: max_sec_threshold
          description: >-
            Sets the threshold to compute some positioning data as the same
            session.
          schema:
            type: number
            format: integer
      responses:
        '200':
          description: Returns the positions of the users who are currently positioning.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeoJSONFeatureCollection'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/realtime/building/{id}':
    get:
      tags:
        - Realtime
      summary: Get all realtime user positions in a building.
      description: Returns the positions of the users who are currently positioning.
      operationId: realtimePositionByBuilding
      parameters:
        - in: path
          name: id
          required: true
          description: Search by building id.
          schema:
            type: number
            format: long
            example: 14
        - in: query
          name: device
          description: Search by device id.
          schema:
            type: integer
            format: long
            example: 1234
        - in: query
          name: indoor
          description: Select only filter for indoor positions.
          schema:
            type: boolean
        - in: query
          name: max_sec_threshold
          description: >-
            Sets the threshold to compute some positioning data as the same
            session.
          schema:
            type: integer
      responses:
        '200':
          description: Returns the positions of the users who are currently positioning.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeoJSONFeatureCollection'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/devices/{organization_id}/{id}':
    get:
      tags:
        - Devices
      summary: Get one device given its id.
      description: Get one device given its id.
      operationId: getDevice
      parameters:
        - name: organization_id
          in: path
          description: The organization id.
          required: true
          schema:
            type: string
        - name: id
          in: path
          description: The device id.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The device information response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceTo'
        '400':
          description: Bad Request.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not Found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '422':
          description: Unprocessable Entity.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal Server Error.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    put:
      tags:
        - Devices
      summary: Update or create device if not exist.
      description: Update or create device if not exist.
      operationId: updateDevice
      parameters:
        - name: organization_id
          in: path
          description: The organization id.
          required: true
          schema:
            type: string
        - name: id
          in: path
          description: Device id.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeviceForm'
        required: true
      responses:
        '200':
          description: The device information response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceTo'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal Server Error.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
    delete:
      tags:
        - Devices
      summary: Get one device given its id.
      description: Get one device given its id.
      operationId: getDevice_2
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The device information response.
        '400':
          description: Bad Request.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not Found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '422':
          description: Unprocessable Entity.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal Server Error.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
  /api/v1/devices:
    get:
      tags:
        - Devices
      summary: Search for devices in the current organization.
      description: >-
        This endpoint allows you to search for devices created for the
        organization specified by the query param 'organizations' if you have
        the required privileges. The endpoint allows filtering the results by
        specifying some of the criteria that are mentioned below.
      operationId: getDevice_1
      parameters:
        - name: group_ids
          in: query
          description: >-
            the identifiers for the assigned groups. You can search in more than
            one group split values by ",".
          required: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: groups
          in: query
          required: false
          deprecated: true
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: building_ids
          in: query
          description: >-
            the identifiers for the assigned buildings. You can search in more
            than one building split values by ",".
          required: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: buildings
          in: query
          required: false
          deprecated: true
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: user_ids
          in: query
          description: >-
            The identifiers for the assigned users. You can search in more than
            one user split. values by ",".
          required: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: users
          in: query
          required: false
          deprecated: true
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: codes
          in: query
          description: 'Device`s codes, split by ",".'
          required: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: code_like
          in: query
          description: |
            Device`s codes include this.
          required: false
          schema:
            type: string
        - name: id_like
          in: query
          description: |
            Device`s identifier include this.
          required: false
          schema:
            type: string
        - name: ids
          in: query
          description: 'Numbers, split by ",".'
          required: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: organization_ids
          in: query
          description: >-
            the identifier of your organization. You can search in more than one
            organization split values by ",".
          required: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: organizations
          in: query
          required: false
          deprecated: true
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: users_any
          in: query
          description: >-
            If the value of this field is true, only the devices with an
            associated user will be returned.
          required: false
          schema:
            type: boolean
        - name: types
          in: query
          description: 'Device`s types, split by ",".'
          required: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: page
          in: query
          description: >-
            This parameter allows to retrieve a certain page of the results,
            only if the results have been paginated (parameter size has been
            specified with a correct value). Must be greater or equal to zero.
          required: false
          schema:
            type: integer
            format: int32
        - name: size
          in: query
          description: >-
            This parameter allows to paginate the results, defining the maximum
            number of elements per page. If not specified, all the results will
            be returned in a single page. Must be greater than zero.
          required: false
          schema:
            type: integer
            format: int32
        - name: sort
          in: query
          description: >-
            This parameter allows to order the results, defining the fields and
            directions for sort the page. If not specified, all the results will
            be returned whithout order.
          required: false
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: The device information response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResponseDeviceTo'
        '400':
          description: Bad Request.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not Found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '422':
          description: Unprocessable Entity.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal Server Error.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
  /api/v1/devices/unassign:
    post:
      tags:
        - Devices
      summary: Unnassign all devices from the organization identifiers provided.
      description: Unnassign all devices from the organization identifiers provided.
      operationId: unnasignDevice
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnassignCriteria'
        required: true
      responses:
        '200':
          description: The device information response
        '400':
          description: Bad Request.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not Found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '422':
          description: Unprocessable Entity.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal Server Error.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
  /api/v1/devices/notify_deleted:
    post:
      tags:
        - Devices
      summary: Notify the realtime service that a building or group has been deleted.
      description: >-
        Designate all devices in a list of groups and or buildings that are
        passed to you. At least one building or group must be passed in order to
        execute this operation.
      operationId: notifyDeletedDevice
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeletedEntities'
        required: true
      responses:
        '204':
          description: The device information response.
        '400':
          description: Bad Request.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Unauthorized.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not Found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '422':
          description: Unprocessable Entity.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '500':
          description: Internal Server Error.
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorMessage'
  /api/v1/users:
    get:
      tags:
        - Users
      summary: Get users filtered by different parameters.
      description: This endpoint allows you to search users.
      operationId: getUsers
      parameters:
        - name: page
          description: Page number if exist pagination.
          in: query
          schema:
            type: number
            format: integer
            example: 1
        - name: size
          description: Number of elements by page.
          in: query
          schema:
            type: number
            format: integer
            example: 15
        - name: sort
          description: Field with the word 'user.' before to sort the result of the list.
          in: query
          schema:
            type: string
            example: user.name
        - name: direction
          in: query
          description: Sort order.
          schema:
            type: string
            enum:
              - asc
              - desc
            example: asc
        - name: email
          description: filter by email field.
          in: query
          schema:
            type: string
            example: situm@situm.com
        - name: search
          description: >-
            filter users whose any of email or full_name contains the value to
            search for.
          in: query
          schema:
            type: string
            example: situm
        - name: ids
          description: >-
            list of users uuids we want to filter by. These identifiers are
            linked by commas.
          in: query
          schema:
            type: string
            example: >-
              1da42f5e-dbdf-4f2a-997f-ed582110bc32,59c4329b-7ed5-4a67-bb92-36e93091d12b
        - name: exclude_ids
          description: >-
            list of users uuids to exclude of the response. These identifiers
            are linked by commas. This param can be passed through the body.
          in: query
          schema:
            type: string
            example: >-
              1da42f5e-dbdf-4f2a-997f-ed582110bc32,59c4329b-7ed5-4a67-bb92-36e93091d12b
        - name: only_group_id
          description: returns users who belong only to this group.
          in: query
          deprecated: true
          schema:
            type: string
            format: uuid
            example: 59c4329b-7ed5-4a67-bb92-36e93091d12b
        - name: group_ids
          description: List of groups to filter the users.
          in: query
          schema:
            type: string
            example: >-
              1da42f5e-dbdf-4f2a-997f-ed582110bc32,59c4329b-7ed5-4a67-bb92-36e93091d12b
        - name: exclude_groups
          description: returns users who not belong to this groups.
          in: query
          deprecated: true
          schema:
            type: string
            example: >-
              1da42f5e-dbdf-4f2a-997f-ed582110bc32,59c4329b-7ed5-4a67-bb92-36e93091d12b
        - name: building_ids
          in: query
          description: filter users by this buildings. These building are linked by commas.
          schema:
            type: string
            example: '1111, 2222'
        - name: buildings_or_none
          in: query
          deprecated: true
          description: >-
            filter users by this buildings including also users without
            buildings assigned. These building are linked by commas. This
            parameter is not compatible with buildings parameter.
          schema:
            type: string
            example: '1111, 2222'
        - name: has_buildings
          in: query
          description: >-
            if it is true returns users who have at least one building and with
            false the users without any building.
          schema:
            type: boolean
        - name: exclude_admins
          description: exclude the admin users.
          in: query
          deprecated: true
          schema:
            type: boolean
            example: true
        - name: full_name
          description: filter by fullname field.
          in: query
          schema:
            type: string
            example: Gonzalez
        - name: group_quick_id
          description: List of groups to filter the users.
          deprecated: true
          in: query
          schema:
            type: string
            example: >-
              1da42f5e-dbdf-4f2a-997f-ed582110bc32,59c4329b-7ed5-4a67-bb92-36e93091d12b
            deprecated: true
        - name: after_shift_start
          description: Filter the users where this shift start after this date.
          in: query
          deprecated: true
          schema:
            format: date-time
            example: '2019-05-21T15:17:21.000000+01:00'
        - name: before_shift_start
          description: Filter the users where this shift start before this date.
          in: query
          deprecated: true
          schema:
            format: date-time
            example: '2019-05-21T15:17:21.000000+01:00'
        - name: importation_date
          description: Users imported this day.
          in: query
          deprecated: true
          schema:
            format: date-time
            example: '2019-05-21T15:17:21.000000+01:00'
        - name: is_staff
          description: Filter by users staff or not.
          deprecated: true
          in: query
          schema:
            type: boolean
            example: true
        - name: codes
          description: List of users codes for filter. These codes are linked by comas.
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserExtraView'
                  metadata:
                    deprecated: true
                    type: object
                    properties:
                      first:
                        type: boolean
                      last:
                        type: boolean
                      totalPages:
                        type: integer
                        example: 122
                      totalElements:
                        type: integer
                        example: 1824
                      numberOfElements:
                        type: integer
                        example: 15
                      size:
                        type: integer
                        example: 15
                      number:
                        type: integer
                        example: 1
                      links:
                        type: object
                        properties:
                          first:
                            type: string
                            example: BASE_URL/api/v1/organizations/search?page=1
                          last:
                            type: string
                            example: BASE_URL/api/v1/organizations/search?page=122
                          self:
                            type: string
                            example: BASE_URL/api/v1/organizations/search?page=1
                          next:
                            type: string
                            example: BASE_URL/api/v1/organizations/search?page=2
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      tags:
        - Users
      summary: Create a User.
      description: >-
        Create a user in the platform. Required fields are password and one of
        email or code. In order to assing permissions both of is_manager and
        buildings fields must be provided.
      operationId: createuser
      requestBody:
        $ref: '#/components/requestBodies/UserCreateForm'
      responses:
        '204':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/UserExtraView'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
  '/api/v1/users/{id}':
    get:
      tags:
        - Users
      summary: Get a User by his id.
      description: Get user  by the id.
      operationId: GetUserByUUID
      parameters:
        - name: id
          required: true
          in: path
          description: User identifier.
          explode: true
          schema:
            type: string
            example: 1f65314c-7ae6-4341-8e08-68962272fa4d
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/UserExtraView'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    put:
      tags:
        - Users
      summary: Update a User.
      description: >-
        Update a user in the platform. In order to assing permisisos both of
        is_manager and buildings fields must be provided. If empty array of
        buildings is provided the permissions of user over the building will be
        deleted.
      operationId: Updateuser
      parameters:
        - name: id
          required: true
          in: path
          description: User identifier.
          explode: true
          schema:
            type: string
            example: 1f65314c-7ae6-4341-8e08-68962272fa4d
      requestBody:
        $ref: '#/components/requestBodies/UserUpdateForm'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/UserExtraView'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
    delete:
      tags:
        - Users
      summary: Delete a User.
      description: This endpoint allows you to delete a user
      operationId: deleteUserByUuid
      parameters:
        - in: path
          name: id
          description: The identifier of the user to delete.
          required: true
          schema:
            type: string
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/UserExtraView'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      tags:
        - Users
      summary: Patch a User.
      description: >
        Patch a user in the platform. The patch operation works as follows:

        * If the request contains members that do not appear within the target
        entity, those members are added.

        * If the target does contain the member, the value is replaced.

        * null values in the patch indicate that existing values in the target
        entity are to be removed. Please note that not all values ​​can be
        removed.
          For example, if a null value is sent in the role field, it will be ignored and the existing value will be kept.
        * Other values in the target entity will remain untouched
      operationId: PatchUser
      parameters:
        - name: id
          required: true
          in: path
          description: User identifier.
          explode: true
          schema:
            type: string
            example: 1f65314c-7ae6-4341-8e08-68962272fa4d
      requestBody:
        $ref: '#/components/requestBodies/UserPatchForm'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/UserExtraView'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v1/version:
    get:
      tags:
        - Version
      summary: Get api version.
      operationId: getApiVersion
      description: This endpoint allows you to get the api version.
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  api_version:
                    type: string
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    LicenseResponse:
      description: The response that contains the device.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/License'
    Unauthorized:
      description: Unauthorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 401
            code: ''
            message: Authentication credentials are not valid.
            errors: []
    Forbidden:
      description: Forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 403
            code: ''
            message: You don't have permission to execute this operation
            errors: []
    OrganizationResponse:
      description: The organization response.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/OrganizationForm'
              - type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    example: 502a17a9-8b52-4448-949c-8195468b6db4
                  organization_uuid:
                    type: string
                    format: uuid
                    deprecated: true
                  created_at:
                    type: string
                    format: date-time
                    example: {}
                  updated_at:
                    type: string
                    format: date-time
                    example: {}
                  license:
                    $ref: '#/components/schemas/License'
    NotFound:
      description: Not Found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 404
            code: ''
            message: Entity not found
            errors: []
    NotAllowed:
      description: Method Not Allowed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 405
            code: ''
            message: Method not allowed
            errors: []
    UnprocessableEntity:
      description: Unprocessable Entity.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 422
            code: ''
            message: Unprocessable entity
            errors: []
    Conflict:
      description: Conflict.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 409
            code: conflict
            message: Conflict found
            errors: []
    BadRequest:
      description: >-
        Bad Request.

        Malformed request syntax, size too large, invalid request message
        framing, or deceptive request routing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 400
            code: ''
            message: Bad request
            errors: []
    ReportsBadRequest:
      description: >-
        Bad Request.

        Malformed request syntax, size too large, invalid request message
        framing, or deceptive request routing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ReportsError'
          example:
            status: 400
            code: ''
            message: Bad request
            errors: []
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 500
            code: ''
            message: Internal Server Error
            errors: []
    BadGateway:
      description: Bad Gateway.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 502
            code: ''
            message: Bad Gateway
            errors: []
    NotImplemented:
      description: Not implemented
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 501
            code: ''
            message: Not implemented
            errors: []
    UserFencesPagedResponse:
      description: The list of user geofences paged.
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  $ref: '#/components/schemas/AnalyticsUserFences'
              metadata:
                $ref: '#/components/schemas/PaginationMetadata'
    UserPoisPathsResponse:
      description: user's route while staying close to some poi.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserPoiPath'
        text/csv:
          schema:
            $ref: '#/components/schemas/UserPoiPath'
          example: >
            "user_id","building_id","building_name","poi_id","poi_name","timestamp_position","latitude","longitude","t_latitude","t_longitude"

            "081ba7a8-6d21-4c93-8811-f2cad2e9552a",6782,"Provisional","45831","OtroPoi","2020-08-20T10:32:09Z",42.8999771,-8.431212,42.8999767,-8.4312135

            "081ba7a8-6d21-4c93-8811-f2cad2e9552a",6782,"Provisional","45831","OtroPoi","2020-08-20T10:32:10Z",42.8999767,-8.4312135,42.899979,-8.4312138
    UserPoisSessionsMatchesResponse:
      description: Response for user sessions near of pois.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserPoiSessions'
        text/csv:
          schema:
            $ref: '#/components/schemas/UserPoiSessions'
          example: >
            "user_id","building_id","building_name","poi_id","poi_name","start","end","stay_time"

            "081ba7a8-6d21-4c93-8811-f2cad2e9552a",\N,\N,\N,\N,"2020-08-20T10:31:19Z","2020-08-20T10:32:09Z",50

            "081ba7a8-6d21-4c93-8811-f2cad2e9552a",\N,\N,\N,\N,"2020-09-11T08:46:20Z","2020-09-11T08:47:05Z",45
    UserVisitorsResponse:
      description: Response for user visitor stats.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserVisitors'
        text/csv:
          schema:
            $ref: '#/components/schemas/UserPoiPath'
          example: |
            date,visitors
            2020-11-03,0
            2020-11-04,0
            2020-11-05,0
            2020-11-06,0
            2020-11-07,0
            2020-11-08,0
            2020-11-09,0
            2020-11-10,0
            2020-11-11,0
            2020-11-12,0
            2020-11-13,0
            2020-11-14,0
            2020-11-15,0
            2020-11-16,0
            2020-11-17,0
    RawDataResponse:
      description: Response for positions raw data.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/RawData'
        text/csv:
          schema:
            $ref: '#/components/schemas/RawData'
          example: >
            "device_id","timestamp","indoor","building_id","floor_id","lat","lng","x","y","accuracy","user_id"

            "233198712398","2020-11-03T10:09:14Z","true",1234,98765,60.4986137,-7.669871,7.26,11.08,243.66,"9ef63ede-7faf-4966-bb48-63338e0f3760"

            "543894707034","2020-11-03T10:09:14Z","true",1234,98765,60.4985867,-7.6698322,7.17,6.63,25.97,"88b2888b-1422-4521-84df-1ade59c766ae"

            "233198712398","2020-11-03T10:09:15Z","true",1234,98765,60.4986137,-7.669871,7.26,11.08,243.66,"9ef63ede-7faf-4966-bb48-63338e0f3760"

            "543894707034","2020-11-03T10:09:15Z","true",1234,98765,60.4985867,-7.6698322,7.17,6.63,25.97,"88b2888b-1422-4521-84df-1ade59c766ae"

            "233198712398","2020-11-03T10:09:16Z","true",1234,98765,60.4986137,-7.669871,7.26,11.08,243.66,"9ef63ede-7faf-4966-bb48-63338e0f3760"

            "543894707034","2020-11-03T10:09:16Z","true",1234,98765,60.4985867,-7.6698322,7.17,6.63,25.97,"88b2888b-1422-4521-84df-1ade59c766ae"

            "233198712398","2020-11-03T10:09:17Z","true",1234,98765,60.4986137,-7.669871,7.26,11.08,243.66,"9ef63ede-7faf-4966-bb48-63338e0f3760"

            "543894707034","2020-11-03T10:09:17Z","true",1234,98765,60.4985867,-7.6698322,7.17,6.63,25.97,"88b2888b-1422-4521-84df-1ade59c766ae"

            "233198712398","2020-11-03T10:09:18Z","true",1234,98765,60.4986137,-7.669871,7.26,11.08,243.66,"9ef63ede-7faf-4966-bb48-63338e0f3760"

            "543894707034","2020-11-03T10:09:18Z","true",1234,98765,60.4985867,-7.6698322,7.17,6.63,25.97,"88b2888b-1422-4521-84df-1ade59c766ae"
    PositioningTimeResponse:
      description: >-
        Response fors tatistics about the time spent in the building in minutes.
        The avg (average) field is calculated as the total time divided by the
        number of unique devices, in this sense the std (standard deviation)
        field only applies to the day_of_week grouping, which will allow knowing
        the deviations of the time positioned on a given day for a certain
        period encompassing several weeks. In the rest of the groupings (month,
        day, hour) it will be equal to zero.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PositioningTime'
        text/csv:
          schema:
            $ref: '#/components/schemas/PositioningTime'
          example: |
            "timestamp","total","avg","std"
              1,0,0,0
              2,0,0,0
              3,0,0,0
              4,0,0,0
              5,0,0,0
              6,0,0,0
              7,0,0,0
    UserPositionsResponse:
      description: Response forstatistics about the time spent in the building.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserPositions'
        text/csv:
          schema:
            $ref: '#/components/schemas/UserPositions'
          example: >
            "timestamp","lat","lng","building_id","indoor","user_id","device_id"

            "2020-11-03T11:06:06Z",40.49859,-7.669871,7890,true,"9ef63ede-7faf-4966-bb48-63338e0f3760","1234556"

            "2020-11-03T11:06:07Z",40.49859,-7.669871,7890,true,9ef63ede-7faf-4966-bb48-63338e0f3760","1234556"

            "2020-11-03T11:06:08Z",40.49859,-7.669871,7890,true,"9ef63ede-7faf-4966-bb48-63338e0f3760","1234556"

            "2020-11-03T11:06:09Z",40.49859,-7.669871,7890,true,"9ef63ede-7faf-4966-bb48-63338e0f3760","1234556"

            "2020-11-03T11:06:10Z",40.49859,-7.669871,7890,true,"9ef63ede-7faf-4966-bb48-63338e0f3760","1234556"

            "2020-11-03T11:06:11Z",40.49859,-7.669871,7890,true,"9ef63ede-7faf-4966-bb48-63338e0f3760","1234556"

            "2020-11-03T11:06:12Z",40.49859,-7.669871,7890,true,"9ef63ede-7faf-4966-bb48-63338e0f3760","1234556"

            "2020-11-03T11:06:13Z",40.49859,-7.669871,7890,true,"9ef63ede-7faf-4966-bb48-63338e0f3760","1234556"

            "2020-11-03T11:06:14Z",40.49859,-7.669871,7890,true,"9ef63ede-7faf-4966-bb48-63338e0f3760","1234556"

            "2020-11-03T11:06:15Z",40.49860,-7.669871,7890,true,"9ef63ede-7faf-4966-bb48-63338e0f3760","1234556"
    TraceSesionsResponse:
      description: Response for statistics about device sesions.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserPositions'
        text/csv:
          schema:
            $ref: '#/components/schemas/UserPositions'
          example: >
            "timestamp_session","device_id","user_id","building_id"

            1605787443628,"96813705790","9ef63ede-7faf-4966-bb48-63338e0f3760",3840

            1605782326691,"96813705790","9ef63ede-7faf-4966-bb48-63338e0f3760",3840

            1605782925917,"96813705790","9ef63ede-7faf-4966-bb48-63338e0f3760",3840
    GeohashHeatmapResponse:
      description: Response for statistics about heatmap of a  building.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/GeohashHeatmap'
        text/csv:
          schema:
            $ref: '#/components/schemas/GeohashHeatmap'
          example: >
            "user_id","geohash","lat","lng","weight"

            "9db93bcc-cdb9-471f-a97f-fd9669ad2fa2","ez9gvhsm0d",42.87227064371109,-8.563472628593445,455

            "cf50a181-381a-4451-964c-a017c2b59d58","ez9gvhsjp0",42.87225991487503,-8.563537001609802,546

            "9db93bcc-cdb9-471f-a97f-fd9669ad2fa2","ez9gvhstf3",42.872394025325775,-8.563054203987122,72
    GeofenceResponse:
      description: The geofence information response.
      content:
        application/json:
          schema:
            title: Geofence
            allOf:
              - type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  created:
                    type: string
                    format: date
                  updated:
                    type: string
                    format: date
                example:
                  id: 533b7796-0ca8-45dc-82df-55f3b1fcd0f5
                  created: '2019-07-01T15:21:54.276Z'
                  updated: '2019-07-01T15:21:54.276Z'
              - $ref: '#/components/schemas/Geofence'
    PathPoseResponse:
      description: Returns the user or device path.
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/PathPose'
    AnalyticsGeofencingMatchesBetweenUserResponse:
      description: Returns the matched times between users in the same geofence.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: >-
                        #/components/schemas/AnalyticsGeofencingMatchesBetweenUser
        text/csv:
          schema:
            $ref: '#/components/schemas/AnalyticsGeofencingMatchesBetweenUser'
          example: >
            "origin_user_id","origin_device_id","matched_user_id","matched_device_id","building_id","fence_id","start_shared_time","end_shared_time","total_shared_time"

            "bfb85bb3-b2c3-460d-8dab-23b195f34315","81211685669","47a88947-edf0-4e9f-8830-f73f33e112df","834211389785",6850,"b50cba00-8f8d-4b42-aedd-00eabf65a50e","2020-08-31T07:02:56Z","2020-08-31T09:19:22Z",8186

            "bfb85bb3-b2c3-460d-8dab-23b195f34315","81211685669","a3fbc164-9c18-4aa0-a12e-3034d0d6a54d","952334819123",6850,"b50cba00-8f8d-4b42-aedd-00eabf65a50e","2020-08-31T07:02:56Z","2020-08-31T11:33:48Z",16252
    AnalyticsDistanceBetweenUserResponse:
      description: Returns the mesaure of distance between users a time interval.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AnalyticsDistanceBetweenUser'
        text/csv:
          schema:
            $ref: '#/components/schemas/AnalyticsDistanceBetweenUser'
          example: >
            "origin_user_id","origin_device_id","matched_user_id","matched_device_id","building_id","floor_id","time_bucket","distance"

            "a3fbc164-9c18-4aa0-a12e-3034d0d6a54d","952334819123","bfb85bb3-b2c3-460d-8dab-23b195f34315","81211685669",6850,14132,"2020-08-31T07:02:00Z",7.55610408782959

            "a3fbc164-9c18-4aa0-a12e-3034d0d6a54d","952334819123","bfb85bb3-b2c3-460d-8dab-23b195f34315","81211685669",6850,14132,"2020-08-31T07:04:00Z",4.014425754547119

            "a3fbc164-9c18-4aa0-a12e-3034d0d6a54d","952334819123","bfb85bb3-b2c3-460d-8dab-23b195f34315","81211685669",6850,14132,"2020-08-31T07:06:00Z",3.936992645263672
    GeofencingStayTimeResponse:
      description: Return the time spend in a geofence.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/GeofencingStayTime'
        text/csv:
          schema:
            $ref: '#/components/schemas/GeofencingStayTime'
          example: >
            "timestamp","device_id","user_id","building_id","floor_id","matched_fence_id","seconds_in_fence","stay_time","sessions_count"

            "2021-02-02","5323811","05bdd7f7-a714-4fb6-803e-2d4c414dd8f5",7033,14469,"d2d24997-1e07-4c3b-86df-1c879fc69247",9864,"02:44:24",1

            "2021-02-02","123436","41dce707-d2e4-4f1f-9b2c-6317e8dbe647",7033,14469,"d2d24997-1e07-4c3b-86df-1c879fc69247",10430,"02:53:50",3

            "2021-02-02","8239012","8f00b03a-e057-4a5b-9532-ab3401dd178d",7033,14469,"d2d24997-1e07-4c3b-86df-1c879fc69247",9814,"02:43:34",5
    GeofencingSessionsMatchesResponse:
      description: Return the time spend in a geofence.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/GeofencingSesionMatch'
        text/csv:
          schema:
            $ref: '#/components/schemas/GeofencingSesionMatch'
          example: >
            "device_id","user_id","building_id","floor_id","matched_fence_id","ts_start","ts_end","seconds_in_fence"

            "1973123","e37f1a7f-6bc1-4b71-8564-0bc8401494e7",7033,14467,"a57ead3d-af2e-442a-86ae-071c665d869a","2021-02-08T00:54:14Z","2021-02-08T00:54:47Z",33

            "1973123","e37f1a7f-6bc1-4b71-8564-0bc8401494e7",7033,14467,"a57ead3d-af2e-442a-86ae-071c665d869a","2021-02-08T01:05:54Z","2021-02-08T01:06:21Z",27

            "1973123","e37f1a7f-6bc1-4b71-8564-0bc8401494e7",7033,14467,"a57ead3d-af2e-442a-86ae-071c665d869a","2021-02-08T01:45:36Z","2021-02-08T01:46:45Z",69

            "1973123","e37f1a7f-6bc1-4b71-8564-0bc8401494e7",7033,14467,"a57ead3d-af2e-442a-86ae-071c665d869a","2021-02-08T01:55:57Z","2021-02-08T01:56:30Z",33
    userPositionsResponse:
      description: Response forstatistics about the time spent in the building.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/userPosition'
        text/csv:
          schema:
            $ref: '#/components/schemas/userPosition'
          example: >
            "timestamp","session_mark","building_id","floor_id","user_id","device_id","lat","lng"

            "2020-12-01T23:05:55Z",324748959,7033,14466,"e37f1a7f-6bc1-4b71-8564-0bc8401494e7","1973123",43.3519482,-8.4249118

            "2020-12-01T23:05:58Z",324748959,7033,14466,"e37f1a7f-6bc1-4b71-8564-0bc8401494e7","1973123",43.3519557,-8.4249548

            "2020-12-01T23:06:01Z",324748959,7033,14466,"e37f1a7f-6bc1-4b71-8564-0bc8401494e7","1973123",43.3519998,-8.425025
    HasDataResponse:
      description: Returns information about the user's positioning activity.
      content:
        application/json:
          schema:
            type: object
            allOf:
              - $ref: '#/components/schemas/MetaCommonData'
              - type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AnalyticsHasData'
    BuildingResponse:
      description: The building information response.
      content:
        application/json:
          schema:
            title: Building
            allOf:
              - $ref: '#/components/schemas/Building'
              - type: object
                properties:
                  geofences:
                    type: array
                    items:
                      $ref: '#/components/schemas/Geofence'
                example:
                  geofences:
                    - code: geofenceCode
                      name: Geofence human readable name
                      organization_id: 7cc5dcbe-94e7-4270-b778-459bf88928f2
                      info: Information of the geofence in HTML
                      type: POLYGON
                      geometric:
                        - - 42.87222393230354
                          - -8.563449931291075
                        - - 42.8721964122444
                          - -8.563451272395582
                        - - 42.87219542938491
                          - -8.563330572989912
                        - - 42.87222294944449
                          - -8.563330572989912
                        - - 42.87222393230354
                          - -8.563449931291075
                      floor_id: 4263
                      level_id: 4263
                      building_id: '2872'
                      deleted: false
    RealTimeUsers:
      description: Successful operation.
      content:
        application/json:
          schema:
            type: object
            properties:
              real_time_users:
                type: array
                items:
                  type: object
                  properties:
                    uuid:
                      type: string
                      format: uuid
                      example: 87077852-f298-4e93-ab6d-c93e44d291f1
                    email:
                      type: string
                      example: developers@situm.com
                    device_id:
                      type: number
                      example: 1234
                    guard:
                      type: string
                      example: null
                    full_name:
                      type: string
                      example: Developers Situm
                    device:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                          example: 1234
                        code:
                          type: string
                        description:
                          type: string
                          example: Motorola G20 Plus
                        organization:
                          type: string
                          format: uuid
                          example: 87077852-f298-4e93-ab6d-c93e44d291f1
                        group_ids:
                          type: array
                          items:
                            type: number
                        building_ids:
                          type: array
                          items:
                            type: number
                        user_id:
                          type: string
                          format: uuid
                        type:
                          type: string
                          example: SMARTPHONE
    TaskResponse:
      description: The task information response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Task'
  schemas:
    Alarm:
      title: Alarm
      type: object
      x-examples: {}
      properties:
        uuid:
          type: string
          format: uuid
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
          description: UUID of the alarm.
        x:
          type: number
          format: float
          example: 10
          description: >-
            The cartesian X coordinate where the alarm has been created. Is is
            specified in meters from the bottom-left corner of the floorplan.
            See <a
            href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
            this explanation</a> for details.
        'y':
          type: number
          format: float
          example: 23.5
          description: >-
            The cartesian Y coordinate where the alarm has been created. Is is
            specified in meters from the bottom-left corner of the floorplan.
            See <a
            href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
            this explanation</a> for details.
        lat:
          type: number
          format: float
          example: 43.360238068498255
          description: >-
            The latitude in WSG84 format where the alarm has been created. See
            <a
            href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
            this explanation</a> for details.
        lng:
          type: number
          format: float
          example: -8.409432085091224
          description: >-
            The longitude in WSG84 format where the alarm has been created. See
            <a
            href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
            this explanation</a> for details.
        building_id:
          type: number
          format: long
          example: 1234
          description: The identifier of the building where the alarm has been created.
        floor_id:
          type: number
          format: long
          example: 12345
          description: The identifier of the floor where the alarm has been created.
        outside:
          type: boolean
          example: false
          description: Whether the alarm has been created outdoors.
        inside:
          type: boolean
          example: true
          description: Whether the alarm has been created indoors.
        created_at:
          type: string
          format: time-date
          example: '2019-07-01T15:21:54.276Z'
          description: Alarm creation time.
        updated_at:
          type: string
          format: time-date
          example: '2019-07-01T15:21:54.276Z'
          description: Alarm last update time.
        type:
          $ref: '#/components/schemas/AlarmType'
        status_changes:
          type: array
          description: The sequence of states that the alarm has passed through.
          items:
            $ref: '#/components/schemas/AlarmStatusChange'
        chat_room:
          type: string
          nullable: true
          description: (DEPRECATED) Do not use.
        active:
          type: boolean
          example: true
          description: >-
            Tells whether or not the alarm is still active. An alarm is active
            if it has not been attended. One way of <a
            href="https://situm.freshdesk.com/a/solutions/articles/35000167782">attending
            the alarm is to do it from Situm Dashboard</a>.
        current_state:
          description: >-
            The current status of the alarm (is the same as the status of the
            last alarm change).
          example: CLOSED
          $ref: '#/components/schemas/AlarmStatus'
        custom_fields:
          type: array
          description: >-
            Free key-value pairs where you may store additional information
            associated to the alarm.
          items:
            $ref: '#/components/schemas/CustomField'
    AlarmType:
      type: string
      description: >-
        The type of alarm. See <a href="#tag/Alarms"> Alarms Section</a> for
        details.
      enum:
        - BREACH
        - DANGER
        - DEADMAN
        - EMERGENCY
        - STATIONARY
        - GEOFENCE_MAX_STAY_TIME
        - ASSISTANCE_REQUEST
    AlarmStatus:
      type: string
      description: >-
        The states that an alarm can go through. See <a href="#tag/Alarms">
        Alarms Section</a> for details.
      enum:
        - CLOSED
        - CONFIRMED
        - MARKED_FALSE
        - OTHER
    AlarmStatusUpdate:
      type: string
      description: >-
        The states that an alarm can go through. See <a href="#tag/Alarms">
        Alarms Section</a> for details.
      enum:
        - OPEN
        - CLOSED
        - CONFIRMED
        - MARKED_FALSE
        - OTHER
    AlarmStatusChangeBase:
      type: object
      properties:
        message:
          type: string
          maxLength: 255
          description: The registered message that explains the status change.
          example: Suspicious red handbag in the lobby.
        location_description:
          type: string
          maxLength: 255
          example: Main hall near the elevator
          description: >-
            A free description of the location where the status change was
            triggered (e.g. "Main hall near the elevator").
        action:
          type: string
          maxLength: 255
          description: A free description of the action that must be done.
          example: Send tactical team.
    AlarmStatusChange:
      allOf:
        - $ref: '#/components/schemas/AlarmStatusChangeBase'
        - type: object
          properties:
            status:
              $ref: '#/components/schemas/AlarmStatusUpdate'
            uuid:
              type: string
              format: uuid
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            user_uuid:
              type: string
              format: uuid
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            created_at:
              type: string
              format: time-date
              example: '2019-07-01T15:21:54.276Z'
    AlarmStatusChangeUpdate:
      type: object
      allOf:
        - type: object
          required:
            - user_id
            - status
          properties:
            alarm_id:
              description: >-
                The identifier of the alarm that creates the alarm status
                change.
              type: string
              format: uuid
            user_id:
              description: The identifier of the user that creates the alarm status change.
              type: string
              format: uuid
        - $ref: '#/components/schemas/AlarmStatusChangeBase'
    AnalyticsUserFences:
      type: object
      example:
        - fence_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
          matched_fence_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
          user_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
          device_id: 232062580255773
          start: '2019-05-21T15:17:21.000000+01:00'
          end: '2019-05-22T15:17:21.000000+01:00'
          building_id: '5217'
          level_id: '10246'
          duration: 9575338
          seconds_in_fence: 9575338
          closed: false
        - fence_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
          matched_fence_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
          user_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
          device_id: 232062580255773
          start: '2019-05-21T15:17:21.000000+01:00'
          end: '2019-05-22T15:17:21.000000+01:00'
          building_id: '5217'
          level_id: '10246'
          duration: 9575338
          seconds_in_fence: 9575338
          closed: true
      properties:
        device_id:
          type: string
          format: uuid
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
          description: Identifier of the device.
        matched_fence_id:
          type: string
          format: uuid
          example: '2019-05-21T15:17:21.000000+01:00'
          description: Identifier of the geofence where the device is.
        fence_id:
          type: string
          format: uuid
          example: '2019-05-21T15:17:21.000000+01:00'
          description: Identifier of the geofence where the device is.
          deprecated: true
        start:
          type: string
          format: date-time
          example: '2019-05-21T15:17:21.000000+01:00'
          description: Timestamp when the user entered in the geofence.
        end:
          type: string
          format: date-time
          example: '2019-05-22T15:17:21.000000+01:00'
          description: Timestamp of the last known position of the device for this session.
        seconds_in_fence:
          type: integer
          example: 1654
          description: Number of seconds between the from and to dates.
        duration:
          type: integer
          example: 1654
          description: Number of seconds between the from and to dates.
          deprecated: true
        building_id:
          type: string
          description: Building where geofence is located.
        floor_id:
          type: string
          description: Floor where geofence is located.
        level_id:
          type: string
          description: Level(floor) where geofence is located.
          deprecated: true
        user_id:
          type: string
          format: uuid
        closed:
          type: boolean
          description: If the session is close or not.
    ApInformation:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the AP or beacon.
          example: '12345678'
        floor_id:
          type: integer
          description: Id of the floor that the AP or beacon is in.
          example: 1234
        last_listened:
          type: string
          format: date-time
          description: >-
            Based on positioning data, the date on which the AP or beacon was
            last listened.
        is_5ghz:
          type: boolean
          description: Indicates if the AP works at 5Ghz (only available for wifi APs).
        ssid:
          type: string
          description: SSID of the AP (only available for wifi APs).
        uuid:
          type: string
          description: UUID of the beacon (only available for bluetooth beacons).
        battery_level:
          type: integer
          description: >-
            Last battery level known of the AP (only available for bluetooth
            beacons).
        battery_level_date:
          type: string
          format: date-time
          description: >-
            Time on which the last known battery level was obtained (only
            available for bluetooth beacons).
        major:
          type: string
          description: >-
            Major identifier of the beacon, in hexadecimal format (only
            available for bluetooth beacons).
        minor:
          type: string
          description: >-
            Minor identifier of the beacon, in hexadecimal format (only
            available for bluetooth beacons).
        type:
          type: string
          description: >-
            Sensor type. Indicates whether the object is a bluetooth beacon or a
            wifi AP.
          enum:
            - wifi
            - ble
    ApiKey:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        apikey:
          type: string
          example: d5dbe1e18ed4a7e5b913e3f3f64a9e0b65be52060664079e8c7745086458a6c6
        created_at:
          type: string
          format: time-date
          example: '2019-07-01T15:21:54.276Z'
        updated_at:
          type: string
          format: time-date
          example: '2019-07-01T15:21:54.276Z'
        deleted_at:
          type: string
          format: time-date
          nullable: true
          example: '2019-07-01T15:21:54.276Z'
        permission:
          $ref: '#/components/schemas/ApiKeyPermission'
        description:
          type: string
          example: Human readable description of the api key
        user_id:
          type: string
          format: uuid
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
    ApiKeyPermission:
      type: string
      enum:
        - read-only
        - read-write
        - disabled
    Building:
      title: Building
      type: object
      properties:
        id:
          type: integer
          description: >-
            Building identifier (retrieve all you buildings to know their
            identifiers).
        user_uuid:
          type: string
          format: uuid
          description: User identifier.
          deprecated: true
        name:
          type: string
          description: Building name.
        description:
          type: string
          description: Building address.
          deprecated: true
        created_at:
          type: string
          format: date-time
          description: Time when the building was created.
        updated_at:
          type: string
          format: date-time
          description: Last time when the building was updated.
        location:
          $ref: '#/components/schemas/Location'
        corners:
          type: array
          items:
            type: object
            minItems: 4
            maxItems: 4
            items:
              $ref: '#/components/schemas/Location'
          description: 'The order  is topleft, topright, bottomright, bottomleft.'
        dimensions:
          description: Building dimensions in meters.
          type: object
          properties:
            width:
              description: Distance between the topleft corner and the topright corner.
              type: number
              format: float
            lenght:
              description: Distance between the topright corner and the bottomright corner.
              type: number
              format: float
        rotation:
          description: >-
            Building rotation in radians. In starting from the west in a
            counter-clockwise order.
          type: number
          format: float
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
        picture_url:
          type: string
          nullable: true
        picture_thumb_url:
          type: string
          nullable: true
        server_url:
          type: string
          nullable: true
        calibration_model:
          description: Calibration model of the building.
          type: object
          properties:
            id:
              type: integer
              description: Calibration identifier.
            updated_at:
              type: string
              format: date-time
              description: Last time when the calibration model was updated.
            download:
              type: string
              description: Our API url for download the calibration model.
              nullable: true
        info:
          type: string
          description: Aditional information of the building in HTML.
        user_id:
          type: string
          format: uuid
          description: User identifier.
        address:
          type: string
          description: Building address.
      example:
        id: 1000
        user_uuid: ffe70d04-b20b-4aea-a0e8-39d25e062db1
        name: My building
        description: Some description
        created_at: '2018-01-11T09:30:51.803+01:00'
        updated_at: '2018-07-19T12:31:23.395+02:00'
        location:
          lat: 42.3307132892641
          lng: -7.87168136788409
        dimensions:
          width: 36.6006156111518
          length: 20.5051547583146
        corners:
          - lat: 42.330684
            lng: -7.871932
          - lat: 42.330888
            lng: -7.871583
          - lat: 42.330742
            lng: -7.871429
          - lat: 42.330539
            lng: -7.871779
        rotation: -0.664248151098747
        custom_fields: []
        picture_url: /uploads/building/1000/9e3213d1-1a70-4cc4-a9d3-d74fd8b47172.png
        picture_thumb_url: /uploads/building/1000/9e3213c1-1a70-4cc4-a9d3-d74fd8b47172.png
        server_url: '*'
        calibration_model:
          id: '96919,'
          updated_at: '2019-04-17T16:06:20.140+00:00'
          download: /api/v1/model/75/latest/file
        info: ''
    CustomField:
      title: CustomField
      description: >
        Key-value pairs that the user can use to extend and fully customize the
        information associated with some objects.

        For more information please visit this <a
        href="http://developers.situm.com/pages/terminology/#custom-values_container">link</a>
      type: object
      properties:
        key:
          type: string
        value:
          type: string
      example:
        key: key1
        value: value1
    DeletedEntities:
      required:
        - organization_id
      type: object
      properties:
        organization_id:
          type: string
          description: Organization identifier where delete devices.
          format: uuid
          example: 0034b291-a209-4c6b-a610-69e1c0503a0b
        group_ids:
          uniqueItems: true
          type: array
          items:
            type: string
            example: 69e1c0503a0b-bc4c-a209-a30e-5231eef98a22
        building_ids:
          uniqueItems: true
          type: array
          items:
            type: string
            description: >-
              building identifier to which users can be associated with the
              device. An empty array means that the device is available for all
              buildings in the organization.
            example: '1111'
        groups:
          uniqueItems: true
          type: array
          deprecated: true
          items:
            type: string
            deprecated: true
        buildings:
          uniqueItems: true
          type: array
          deprecated: true
          items:
            type: string
            deprecated: true
        organization:
          type: string
          deprecated: true
    DeviceForm:
      type: object
      properties:
        code:
          type: string
          description: >-
            Code for identifier of other applications if is needed or a natural
            identifier for humans.
          example: device0000001
        description:
          type: string
          description: Description for device.
          example: Android 10 device
        group_ids:
          type: array
          items:
            type: string
            format: uuid
        building_ids:
          uniqueItems: true
          type: array
          items:
            type: string
            description: >-
              building to which users can be associated with the device. An
              empty array means that the device is available for all buildings
              in the organization.
            example: '2222'
        type:
          type: string
          description: >-
            The type of the device. Each organization would like to segment
            devices by type, this is the name of the segment to include the
            device into. Only enabled by demand so we can activate you the
            feature flag.
          example: SMARTPHONE
        force_user_assignment:
          type: boolean
          description: >-
            Forces to unassign the user from it's current device, if any, before
            assigning it to this.
          default: false
        user_id:
          type: string
          description: User identifier assign to the device.
          format: uuid
          example: 72edd2aa-bc83-478c-9393-02adbfcd339e
        groups:
          uniqueItems: true
          type: array
          writeOnly: true
          deprecated: true
          items:
            type: string
            deprecated: true
        buildings:
          uniqueItems: true
          type: array
          writeOnly: true
          deprecated: true
          items:
            type: string
            deprecated: true
        user:
          type: array
          writeOnly: true
          deprecated: true
          items:
            type: string
            deprecated: true
    DeviceTo:
      required:
        - created_at
        - id
        - organization_id
        - updated_at
      type: object
      properties:
        id:
          type: string
          description: Device id.
          example: '0000001'
        organization:
          type: string
          deprecated: true
        code:
          type: string
          description: >-
            Code for identifier of other applications if is needed or a natural.
            identifier for humans
          example: device0000001
        description:
          type: string
          description: Description for device.
          example: Android 10 device
        user:
          type: string
          deprecated: true
        groups:
          uniqueItems: true
          type: array
          deprecated: true
          items:
            type: string
            deprecated: true
        buildings:
          uniqueItems: true
          type: array
          deprecated: true
          items:
            type: string
            deprecated: true
        type:
          type: string
          description: >-
            The type of the device. Each organization would like to segment
            devices by type, this is the name of the segment to include the
            device into. Only enabled by demand so we can activate you the
            feature flag.
          example: SMARTPHONE
        user_id:
          type: string
          description: User identifier assign to the device.
          format: uuid
          example: 72edd2aa-bc83-478c-9393-02adbfcd339e
        created_at:
          type: string
          description: Creation date.
          format: date-time
        updated_at:
          type: string
          description: Last update date.
          format: date-time
        organization_id:
          type: string
          description: Organization id.
          format: uuid
          example: 0034b291-a209-4c6b-a610-69e1c0503a0b
        group_ids:
          type: array
          items:
            type: string
            format: uuid
        building_ids:
          uniqueItems: true
          type: array
          items:
            type: string
            description: >-
              building identifier to which users can be associated with the
              device. An empty array means that the device is available for all
              buildings in the organization
            example: '1111'
    DeviceSummaryTO:
      required:
        - created_at
        - updated_at
      type: object
      properties:
        user_id:
          type: string
          description: User identifier assign to the device
          format: uuid
          example: 72edd2aa-bc83-478c-9393-02adbfcd339e
        created_at:
          type: string
          description: Creation date
          format: date-time
        updated_at:
          type: string
          description: Last update date
          format: date-time
        type:
          type: string
          description: >-
            The type of the device. Each organization would like to segment
            devices by type, this is the name of the segment to include the
            device into. Only enabled by demand so we can activate you the
            feature flag
          example: SMARTPHONE
        description:
          type: string
          description: Description for device
          example: Android 10 device
    Error:
      type: object
      properties:
        status:
          type: integer
        code:
          type: string
        message:
          type: string
        errors:
          type: array
          items:
            type: string
    ErrorMessage:
      type: object
      properties:
        status:
          type: integer
          format: int32
        code:
          type: string
        message:
          type: string
        errors:
          type: array
          items:
            type: object
    Event:
      title: Event
      type: object
      description: >-
        An event refers to an area that has been associated with a certain
        information that will be shown to the users when they pass by. Events
        can only be defined inside a building (indoors), and they have a
        circular shape. Information is always an HTML snippet (text, images,
        videos, etc.) that has been introduced in the dashboard using a Rich
        Text Editor.
      properties:
        id:
          type: integer
          description: Event identifier.
        building_id:
          type: integer
          description: >-
            Building identifier (retrieve all you buildings to know their
            identifiers).
        name:
          type: string
          description: Event name.
        created_at:
          type: string
          format: date-time
          description: Time when the event was created.
        updated_at:
          type: string
          format: date-time
          description: Last time when the event was updated.
        info:
          type: string
          description: Event aditional information.
        position:
          $ref: '#/components/schemas/CartographyPosition'
        conversion_area:
          $ref: '#/components/schemas/CartographyPosition'
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
    EventOcurrence:
      title: EventOcurrence
      description: An Event Ocurrence refers a materialization of an Event.
      type: object
      properties:
        id:
          type: integer
          description: Event Ocurrence identifier.
        event_id:
          type: integer
          description: Event identifier.
        created_at:
          type: string
          format: date-time
          description: Time when the event ocurrence was created.
        updated_at:
          type: string
          format: date-time
          description: Last time when the event ocurrence was updated.
        clicked_at:
          type: string
          format: date-time
          description: Time when the event ocurrence was triggered.
        conversion_at:
          type: string
          format: date-time
          description: Time when the event conversion action was triggered.
        encoded_macaddr:
          type: integer
          description: a device id.
    Image:
      title: Image
      type: object
      properties:
        id:
          type: string
          description: imageId
        url:
          type: string
          description: Image url.
      example:
        id: ba45edf9-3dec-46fa-8db2-3ce86574d6fe.jpg
        url: >-
          https://dashboars.situm.com/uploads/unlinked/9175/ba45edf9-3dec-46fa-8db2-3ce86574d6fe.jpg
    FloorBase:
      title: FloorBase
      type: object
      properties:
        name:
          type: string
          description: Floor name.
          example: Basement
        building_id:
          type: integer
          description: >-
            Building identifier (retrieve all you buildings to know their
            identifiers).
        level:
          type: integer
          description: >-
            Floor level. Represents the phisical level of the building. If the
            building has a basement, its level will be -1.
        level_height:
          type: integer
          description: >-
            Floor level height in meters. It is 0 by default. Represents the
            distance between the floor and the ground. For more information
            please visit this <a
            href="http://developers.situm.com/pages/terminology/#level-height_container">link</a>
        created_at:
          type: string
          format: date-time
          description: Time when the floor was created.
        updated_at:
          type: string
          format: date-time
          description: Time when the floor was updated.
        maps:
          type: object
          description: Floorplan
          properties:
            scale:
              type: number
              format: float
              description: >
                'Floorplan image scale in pixels/meters.

                If buildings dimensions are 72.77 meters long by 43.27 meters
                wide

                and the building image dimensions are 1264 pixels long by 758
                pixels wide

                the scale will be 1264 pixels / 72.77 meters = 17.3698
                pixels/meters'.
            map_url:
              type: string
              description: Floorplan image url
            map_id:
              type: string
              description: Name of the map image file
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
          minItems: 0
      example:
        id: 1001
        name: Basement
        building_id: 1000
        level: -1
        level_height: 5
        created_at: '2016-09-16T09:45:20.098+02:00'
        updated_at: '2016-09-16T09:45:20.098+02:00'
        maps:
          scale: 20.138829737835003
          map_url: >-
            http://dashboard.situm.com/uploads/situm/floor/map/995/80radc8f-df52-48e1-aa0b-2e5abd1262dd.PNG
          map_id: 80eazc8f-df52-48e1-aa0b-2e5abd1362dd.PNG
    Floor:
      title: Floor
      type: object
      allOf:
        - type: object
          properties:
            id:
              type: integer
              description: Floor identifier
              example: '3333'
        - $ref: '#/components/schemas/FloorBase'
    FoundItem:
      required:
        - id
        - lat
        - lng
        - type
      type: object
      properties:
        id:
          type: string
          description: identifier of the found item.
          example: '4444'
        type:
          type: string
          description: Type of the found item.
          example: BUILDING
        lat:
          type: number
          description: Geographic latitude in `WGS84`.
          format: double
          example: 0
        lng:
          type: number
          description: Geographic longitude in `WGS84`.
          format: double
          example: 0
        x:
          type: number
          description: Building relative position in x axis.
          format: double
          example: 2.22
        'y':
          type: number
          description: Building relative position in y axis.
          format: double
          example: 2.22
        level_id:
          type: integer
          description: Floor identifier for this.
          format: int64
          example: 111221
      description: Other elements to position found by the device.
    Geofence:
      title: Geofence
      required:
        - name
        - organization_id
        - type
        - geometric
      type: object
      properties:
        code:
          type: string
        name:
          type: string
        organization_id:
          type: string
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
          minItems: 0
        info:
          type: string
        type:
          type: string
        geometric:
          type: array
          minItems: 3
          items:
            type: array
            maxItems: 2
            minItems: 2
            items:
              type: integer
              format: float
        building_id:
          type: string
        floor_id:
          type: integer
        level_id:
          type: integer
          deprecated: true
        description:
          type: string
          deprecated: true
        deleted:
          type: boolean
      example:
        code: geofenceCode
        name: Geofence human readable name
        organization_id: 7cc5dcbe-94e7-4270-b778-459bf88928f2
        info: Information of the geofence in HTML
        type: POLYGON
        geometric:
          - - 42.87222393230354
            - -8.563449931291075
          - - 42.8721964122444
            - -8.563451272395582
          - - 42.87219542938491
            - -8.563330572989912
          - - 42.87222294944449
            - -8.563330572989912
          - - 42.87222393230354
            - -8.563449931291075
        floor_id: 4263
        level_id: 4263
        building_id: '2872'
        deleted: false
        custom_fields:
          - key: a
            value: z
          - key: b
            value: m
          - key: a
            value: j
    GeoJSONFeatureCollection:
      title: GeoJSONFeatureCollection
      type: object
      properties:
        type:
          type: string
          enum:
            - FeatureCollection
        features:
          type: array
          items:
            $ref: '#/components/schemas/GeoJSONFeature'
        devicesInfo:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/DeviceSummaryTO'
    GeoJSONFeature:
      title: GeoJSONFeature
      type: object
      properties:
        type:
          type: string
          enum:
            - Feature
        geometry:
          type: object
          properties:
            type:
              type: string
              enum:
                - Point
            coordinates:
              type: array
              minItems: 2
              maxItems: 2
              example:
                - 3.14
                - -42
              items:
                type: integer
                format: float
        properties:
          type: object
          properties:
            accuracy:
              type: integer
              format: float
            time:
              type: string
              format: date-time
            yaw:
              type: integer
              format: float
            building_id:
              type: integer
            floor_id:
              type: integer
        id:
          type: string
        userId:
          type: string
          format: uuid
    GeoJSONFeaturePoint:
      title: GeoJSONFeaturePoint
      type: object
      properties:
        type:
          type: string
          enum:
            - Feature
        geometry:
          type: object
          properties:
            type:
              type: string
              enum:
                - Point
            coordinates:
              description: >-
                GeoJSON standard field to indicate the coordinates of the
                object.
              type: array
              minItems: 2
              maxItems: 2
              example:
                - -8.563
                - 42.872
              items:
                type: integer
                format: float
        properties:
          description: >-
            GeoJSON standard field which includes custom properties of the
            object.
          type: object
    GeoJSONRealtime:
      title: GeoJSONRealtime
      description: Position in `GeoJSON` format.
      type: object
      properties:
        id:
          type: string
          description: Feature identifier.
        type:
          type: string
          enum:
            - Feature
          description: The value is always Feature.
          example: Feature
        geometry:
          type: object
          properties:
            type:
              type: string
              enum:
                - Point
              description: The value is always Point. It must be a single position.
              example: Point
            coordinates:
              type: array
              description: The location data are represented in `WGS84` coordinate system
              items:
                minItems: 2
                maxItems: 2
                type: number
                format: double
        userId:
          type: string
        properties:
          type: object
          properties:
            time:
              type: string
              format: time-date
              description: Last time when the user was positioned.
              example: '2019-07-01T15:21:54.276Z'
            yaw:
              type: number
              format: float
              description: User rotation angle relative to earth in radians.
            local_coordinates:
              type: array
              items:
                type: number
                format: double
              description: >-
                Cartesian coordinates in meters taking the bottomleft corner as
                the origin.
            floor_id:
              type: number
              format: long
              description: |
                Floor identifier in which the user is positioned.
                It will not appear if the user is outdoors.
            building_id:
              type: number
              format: long
            level_height:
              type: number
              format: long
            volatil:
              type: object
              properties:
                buildingOrigin:
                  type: number
                  format: long
                buildingDestination:
                  type: number
                  format: long
      example:
        geometry:
          type: Point
          coordinates:
            - 42.252243560791015
            - -3.906458316256714
        id: '352188336370'
        properties:
          time: '2018-10-17T13:34:15.226Z'
          yaw: 0.09320058471965828
          local_coordinates:
            - 205.0399932861328
            - 106.47000122070312
          floor_id: 10961
          building_id: 4590
          level_height: 0
        userId: e7ad2cf5-ae00-4db5-ac9a-3f254ff5b66f
    GroupBase:
      title: GroupBase
      type: object
      description: The group data.
      properties:
        name:
          type: string
          description: Group name.
        organization_id:
          type: string
          format: uuid
          description: Organization identifier.
          default: Current user organization
        icon_colour:
          type: string
          deprecated: true
          description: >-
            Hex color code for the group. This color will be used in the
            realtime icons in case the associated users do not have one.
          example: b0694d
          default: null
        parent_group_id:
          type: string
          format: uuid
          description: >-
            Indicates the group to which the current subgroup belongs. If the
            value is null is because is a root group.
        is_staff:
          type: boolean
          deprecated: true
          description: indicates if the users of this group are staff.
          default: false
    Group:
      title: Group
      allOf:
        - type: object
          properties:
            id:
              type: string
              format: uuid
              description: group id
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            uuid:
              type: string
              format: uuid
              description: group id
              deprecated: true
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - $ref: '#/components/schemas/GroupBase'
    License:
      title: License
      allOf:
        - type: object
          properties:
            uuid:
              type: string
              format: uuid
              description: Identifier of the license
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        - $ref: '#/components/schemas/LicenseBase'
    LicenseBase:
      title: LicenseBase
      type: object
      description: The license request object
      properties:
        description_en:
          type: string
          description: Description of the license in english.
          example: License description
        description_es:
          type: string
          description: Description of the license in spanish.
          example: Descripcion de licencia
        expiration_date:
          type: string
          format: date
          description: Expiration date of the license.
          example: '2025-12-13'
    Location:
      title: Location
      type: object
      description: The location data are represented in `WGS84` coordinate system.
      properties:
        lat:
          type: number
          format: float
          description: Geographic latitude.
        lng:
          type: number
          format: float
          description: Geographic longitude.
    Metadata:
      type: object
      properties:
        first:
          type: boolean
        last:
          type: boolean
        total_pages:
          type: integer
          format: int32
        total_elements:
          type: integer
          format: int64
        number_of_elements:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        number:
          type: integer
          format: int32
    GeofenceForm:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        geometric:
          type: array
          minItems: 3
          items:
            type: array
            maxItems: 2
            minItems: 2
            items:
              type: integer
              format: float
        building_id:
          type: string
        floor_id:
          type: integer
          format: long
        code:
          type: string
        organization_id:
          type: string
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
          minItems: 0
        info:
          type: string
        description:
          type: string
          deprecated: true
    OrganizationColorForm:
      x-public: true
      type: object
      properties:
        default:
          type: string
          example: CDD0D6
        primary:
          type: string
          example: 464646
        secondary:
          type: string
          example: F2F1EF
        success:
          type: string
          example: 47A96E
        warning:
          type: string
          example: 37408B
        danger:
          type: string
          example: A94751
        info:
          type: string
          example: 4B8EBB
    OrganizationForm:
      type: object
      properties:
        organization_name:
          type: string
          deprecated: true
        name:
          type: string
          example: My organization
        colors:
          $ref: '#/components/schemas/OrganizationColorForm'
        logo_path:
          type: string
        logo_login_path:
          type: string
        logo_favicon_path:
          type: string
        cookies_message:
          type: string
        support_email:
          type: string
        copyright:
          type: string
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
        feature_flags:
          type: object
          additionalProperties:
            type: string
        original_feature_flags_pack:
          type: string
          enum:
            - WORKFORCE_TRACKING
            - WAY_FINDING
        current_feature_flags_pack:
          type: string
          enum:
            - WORKFORCE_TRACKING
            - WAY_FINDING
      example:
        name: 9414297797.ts@gmail.com
        colors: null
        logo_path: null
        logo_login_path: null
        logo_favicon_path: null
        cookies_message: null
        support_email: null
        copyright: null
        custom_fields:
          - key: a
            value: z
          - key: b
            value: m
          - key: a
            value: j
        feature_flags:
          collectives: 1
          devices: 1
        original_feature_flags_pack: WORKFORCE_TRACKING
        current_feature_flags_pack: WAY_FINDING
    PagedResponseDeviceTo:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DeviceTo'
        metadata:
          $ref: '#/components/schemas/Metadata'
    PaginationMetadata:
      description: Metadata for  paged responses.
      type: object
      properties:
        first:
          type: boolean
        last:
          type: boolean
        total_pages:
          type: integer
        total_elements:
          type: integer
        number_of_elements:
          type: integer
        size:
          type: integer
        number:
          type: integer
    Path:
      description: >-
        This graph represents all the routes by which the user can move within
        the building.
      type: object
      properties:
        nodes:
          type: array
          description: >-
            Each node represents a certain location within the building (x, y,
            floor).
          items:
            type: object
            title: Node
            properties:
              id:
                type: integer
                description: Node identifier
              floor_id:
                type: integer
                description: Floor identifier in which the node is situated.
              x:
                type: number
                format: float
                description: >-
                  Cartesian coordinate in meters taking the bottomleft corner as
                  the origin.
              'y':
                type: number
                format: float
                description: >-
                  Cartesian coordinate in meters taking the bottomleft corner as
                  the origin.
        links:
          type: array
          items:
            title: Link
            type: object
            properties:
              source:
                type: integer
                description: Node identifier.
              target:
                type: integer
                description: Node identifier.
              origin:
                type: string
                enum:
                  - source
                  - target
                  - both
                description: >
                  Indicates if the link is uni or bidirectional depending on
                  whether the origin is in one, another or both nodes.
              accesible:
                type: boolean
                description: >-
                  Indicates if the path is situable for persons with reduced
                  mobility.
              tags:
                description: Indicates some properties of the links
                type: array
                items:
                  type: string
    PathPose:
      type: object
      properties:
        x:
          description: >-
            The cartesian X coordinate of the position. Is is specified in
            meters from the bottom-left corner of the floorplan.
          type: number
          format: double
          example: 36.44999999996873
          deprecated: true
        'y':
          description: >-
            The cartesian Y coordinate of the position. Is is specified in
            meters from the bottom-left corner of the floorplan.
          type: number
          format: double
          example: 28.335999999976487
          deprecated: true
        lat:
          description: The latitude in WSG84 format of the position.
          type: number
          format: double
          example: 42.87228353762896
        lng:
          description: The longitude in WSG84 format of the position.
          type: number
          format: double
          example: -8.563248747722891
        lon:
          description: The longitude in WSG84 format of the position.
          type: number
          format: double
          example: -8.563248747722891
          deprecated: true
        session_mark:
          type: integer
          format: int64
          example: 1213548
        t:
          type: string
          format: date-time
          example: '2021-03-22T03:36:22'
        l:
          type: integer
          format: int64
          example: 11915
        b:
          type: integer
          format: int64
          example: 5962
    PoiCategory:
      type: object
      properties:
        id:
          type: integer
          description: POI category identifier.
        name_en:
          type: string
          description: The name of the category in English.
        name_es:
          type: string
          description: The name of the category in Spanish.
        code:
          type: string
          description: POI category code.
        icon_url:
          type: string
          description: POI image url.
        selected_icon_url:
          type: string
          description: POI selected image url.
        created_at:
          type: string
          format: date-time
          description: Time when the POI category was created.
        updated_at:
          type: string
          format: date-time
          description: Last time when the POI category was updated.
        public:
          type: boolean
          description: POI categories can be public or private.
        icon_base64: null
        selected_icon_base64: null
        parent_poi_category_id:
          type: integer
          description: POI category parent id.
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
      example:
        id: 608
        name_en: Entrance
        name_es: Entrada
        code: CODERANDOM
        icon_url: >-
          /assets/map/poi_icon-60c6f0b39e5b0a8222abf82beb814aa90658546cd96d9c7aaf6120cd128b8af6.png
        selected_icon_url: >-
          /assets/map/poi_icon_sel-83ad85f42d8ef30355e5846c2254ba1891aa394068eb32949d4ee7fcfa564a9d.png
        updated_at: '2019-03-18T18:24:38.273+01:00'
        created_at: '2019-03-18T18:24:38.273+01:00'
        public: false
        parent_poi_category_id: 609
        custom_fields:
          - key: key1
            value: value1
    PoiIndoor:
      description: Represents a point inside a building.
      allOf:
        - type: object
          properties:
            position:
              $ref: '#/components/schemas/CartographyPosition'
        - $ref: '#/components/schemas/PoiBase'
    PoiOutdoor:
      description: Represents a point inside a building.
      allOf:
        - type: object
          properties:
            location:
              $ref: '#/components/schemas/Location'
        - $ref: '#/components/schemas/PoiBase'
    PoiBase:
      description: Default fields for a indoor or outdoor POI
      type: object
      properties:
        id:
          type: integer
          description: Indoor POI identifier.
          example: 1234
        building_id:
          type: integer
          description: >-
            Building identifier (retrieve all you buildings to know their
            identifiers).
          example: 1234
        floor_id:
          type: integer
          description: Floor identifier.
          example: 1234
        name:
          type: string
          description: Indoor POI name.
          example: POI name
        created_at:
          type: string
          format: date-time
          description: Time when the indoor POI was created.
          example: '2016-06-23T09:13:44.273+02:00'
        updated_at:
          type: string
          format: date-time
          description: Time when the indoor POI was created.
          example: '2016-06-23T09:13:44.273+02:00'
        category_id:
          type: integer
          description: >-
            The identifier of main the category asigned to POI. POIs can be
            differenciated by categories.
          example: 1
        categories:
          items:
            $ref: '#/components/schemas/PoiCategory'
        category_name:
          type: string
          description: The name of the category. POIs can be differenciated by categories.
        info:
          type: string
          description: Indoor POI aditional information.
          example: Random information of the POI
        info_unsafe:
          type: string
          description: 'Indoor POI aditional information, not escaped.'
        type:
          type: string
          description: This field allways null.
          example: ''
        icon:
          type: string
          description: Poi icon image
          example: /uploads/poi/170366/ab7979ae-dc43-4267-9ba5-bdd1bdccfa95.png
        selected_icon:
          type: string
          description: Poi selected icon image
          example: /uploads/poiselected/170366/7ef5589d-e1ab-4ad9-85a5-895589e81864.png
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
    CartographyPosition:
      type: object
      properties:
        floor_id:
          description: Floor identifier where position is located.
          type: number
        radius:
          description: Position radius in meters.
          type: number
          format: float
        georeferences:
          $ref: '#/components/schemas/Location'
        cartesians:
          $ref: '#/components/schemas/Point'
        custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
        x:
          deprecated: true
          type: integer
          format: float
        'y':
          deprecated: true
          type: integer
          format: float
        lat:
          deprecated: true
          type: integer
          format: float
        lng:
          deprecated: true
          type: integer
          format: float
    Point:
      type: object
      description: >-
        Position in cartesian coordinates in meters taking the bottomleft corner
        as the origin.
      properties:
        x:
          type: number
          format: float
        'y':
          type: number
          format: float
    UnassignCriteria:
      required:
        - organization_ids
      type: object
      properties:
        organization_ids:
          uniqueItems: true
          type: array
          items:
            type: string
            description: >-
              List of groups to which users can be associated with the device.
              An empty array means that the device is available for all groups
              in the organization.
            example: 69e1c0503a0b-bc4c-a209-a30e-5231eef98a22
        organization:
          uniqueItems: true
          type: array
          writeOnly: true
          items:
            type: string
            deprecated: true
    UploadIndoorPoseForm:
      required:
        - accuracy
        - building_id
        - device_id
        - lat
        - level_id
        - lng
        - timestamp
        - x
        - 'y'
        - yaw
      type: object
      properties:
        device_id:
          type: integer
          description: Device id
          format: int64
          example: 122311111
        lat:
          type: number
          description: Geographic latitude in `WGS84`.
          format: double
          example: 0
        lng:
          type: number
          description: Geographic longitude in `WGS84`.
          format: double
          example: 0
        yaw:
          type: number
          description: Angle in grades.
          format: float
          example: 0
        timestamp:
          type: integer
          description: >-
            when the positioning occurred in milliseconds unix epoch timestamp.
            `
          format: int64
          example: 1602166298525
        accuracy:
          type: number
          description: radius of coordinate accuracy in meters.
          format: float
          example: 0
        timestamp_session:
          type: integer
          description: Positioning start time in milliseconds unix epoch.
          format: int64
          example: 1602166288525
        found_items:
          type: array
          description: Other elements to position found by the device.
          items:
            $ref: '#/components/schemas/FoundItem'
        x:
          type: number
          description: Building relative position in x axis.
          format: double
          example: 2.22
        'y':
          type: number
          description: Building relative position in y axis.
          format: double
          example: 2.22
        building_id:
          type: integer
          description: Building id.
          format: int64
          example: 1111
        level_id:
          type: integer
          description: Building floor id.
          format: int64
          example: 1111
        floorId:
          type: integer
          format: int64
          writeOnly: true
        volatile:
          $ref: '#/components/schemas/Volatile'
    UploadOutdoorPoseForm:
      required:
        - accuracy
        - building_ids
        - device_id
        - lat
        - lng
        - timestamp
        - yaw
      type: object
      properties:
        device_id:
          type: integer
          description: Device id
          format: int64
          example: 122311111
        lat:
          type: number
          description: Geographic latitude in `WGS84`.
          format: double
          example: 0
        lng:
          type: number
          description: Geographic longitude in `WGS84`.
          format: double
          example: 0
        yaw:
          type: number
          description: Angle in grades.
          format: float
          example: 0
        timestamp:
          type: integer
          description: >-
            when the positioning occurred in milliseconds unix epoch timestamp.
            `
          format: int64
          example: 1602166298525
        accuracy:
          type: number
          description: radius of coordinate accuracy in meters.
          format: float
          example: 0
        timestamp_session:
          type: integer
          description: Positioning start time in milliseconds unix epoch.
          format: int64
          example: 1602166288525
        found_items:
          type: array
          description: Other elements to position found by the device.
          items:
            $ref: '#/components/schemas/FoundItem'
        volatile:
          $ref: '#/components/schemas/Volatile'
        building_ids:
          type: array
          description: Buildings where the user has permissions.
          example:
            - 1111
            - 2222
          items:
            type: integer
            description: Buildings where the user has permissions.
            format: int64
        snr:
          type: number
          description: >-
            A GPS receiver measures signal strength or signal to noise. ratio
            (SNR)
          format: float
          example: 2.22
    UploadPosesForm:
      type: object
      properties:
        indoor_position:
          type: array
          items:
            $ref: '#/components/schemas/UploadIndoorPoseForm'
        outdoor_position:
          type: array
          items:
            $ref: '#/components/schemas/UploadOutdoorPoseForm'
    User:
      title: User
      type: object
      properties:
        situm_maps:
          type: boolean
          example: true
        sos_alarm:
          type: boolean
          example: true
          deprecated: true
        deadman_alarm:
          type: boolean
          example: true
          deprecated: true
        see_alarm:
          type: boolean
          example: true
          deprecated: true
        declare_emergency:
          type: boolean
          example: true
          deprecated: true
        cancel_emergency:
          type: boolean
          example: true
          deprecated: true
        confirm_emergency:
          type: boolean
          example: true
          deprecated: true
        collective_id:
          type: string
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
          deprecated: true
        assignment_id:
          type: string
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
          deprecated: true
        last_activity:
          type: string
        organization_uuid:
          type: string
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
          deprecated: true
        organization_id:
          type: string
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
        permissions:
          type: array
          deprecated: true
          items:
            $ref: '#/components/schemas/Permission'
        terms_accepted_at:
          type: string
          format: date-time
          description: Stores the date at which the user accepted the terms and conditions.
        is_staff:
          type: boolean
          example: true
          deprecated: true
    UserPoiPath:
      description: User poi.
      title: user_poi_path
      properties:
        user_id:
          type: string
          format: uuid
          example: 71asdfa-187a-4144-945d-6d8da94fac9c
        building_name:
          type: string
          description: Building name.
          example: shopping mall
        building_id:
          type: integer
          description: Building id.
          format: int32
          example: 1111
        poi_name:
          type: string
          description: Poi name.
          example: shopping mall
        poi_id:
          type: integer
          description: Poi id
          format: int32
          example: 1111
        timestamp_position:
          type: string
          description: Timestamp when position occurred.
          format: date-time
        latitude:
          type: number
          format: float
          description: Geographic latitude represented in `WGS84` coordinate system.
          example: 42.3307132892641
        longitude:
          type: number
          format: float
          description: Geographic longitude represented in `WGS84` coordinate system.
          example: -7.87168136788409
        t_latitude:
          type: number
          format: float
          description: >-
            Next Geographic latitude represented in `WGS84` coordinate system in
            the user path.
          example: 42.3307132892641
        t_longitude:
          type: number
          format: float
          description: >-
            Next Geographic longitude represented in `WGS84` coordinate system
            in the user path.
          example: -7.87168136788409
    UserPoiSessions:
      description: Sessions and time of stay of users in pois.
      title: user_poi_sessions_matches
      properties:
        user_id:
          type: string
          format: uuid
          example: 71asdfa-187a-4144-945d-6d8da94fac9c
        building_name:
          type: string
          description: Building name.
          example: shopping mall
        building_id:
          type: integer
          description: Building id.
          format: int32
          example: 1111
        poi_name:
          type: string
          description: Poi name.
          example: shopping mall
        poi_id:
          type: integer
          description: Poi id
          format: int32
          example: 1111
        start:
          type: string
          description: Session start date.
          format: date-time
        end:
          type: string
          description: Session end date.
          format: date-time
        stay_time:
          type: integer
          description: Stay time the user near of the poi.
    UserVisitors:
      type: object
      properties:
        date:
          type: string
          description: Date.
          format: date-time
          example: '2017-05-25'
        visitors:
          type: number
          description: Number of unique devices.
          example: 240
    RawData:
      type: object
      properties:
        deviceId:
          type: number
          description: Device unique identifier.
          example: 109112065234
        indoor:
          type: boolean
          description: Position type.
          example: true
        timestamp:
          type: string
          description: Position timestamp.
          format: date-time
          example: '2020-11-15T05:21:49Z'
        building_id:
          type: number
          description: Building unique identifier.
          example: 1234
        floor_id:
          type: number
          description: floor unique identifier.
          example: 4567
        lat:
          type: number
          description: Geographic latitude in `WGS84`  coordinate system.
          example: 48.2586649
        lng:
          type: number
          description: Geographic longitude in `WGS84`  coordinate system.
          example: -3.9073326
        x:
          type: number
          description: Cartesian coordinate x.
          example: 202.19
        'y':
          type: number
          description: Cartesian coordinate y.
          example: 198.73
        accuracy:
          type: number
          description: accuracy
          example: 274.36
        user_id:
          type: string
          format: uuid
          description: User unique identifier.
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
    PositioningTime:
      type: object
      properties:
        timestamp:
          type: integer
          description: 'day of week (ordinal) 1 = Monday , 7 = Sunday.'
          example: 1
        total:
          type: integer
          description: total positioning minutes (all users).
          example: 8036
        avg:
          type: number
          description: mean positioning minutes.
          example: 730
        std:
          type: number
          description: standard deviation.
          example: 642
    TraceSessions:
      type: object
      properties:
        timestamp_session:
          type: number
          description: Position timestamp.
          example: 1605787443628
        device_id:
          type: string
          description: device unique identifier.
          example: '1234567'
        user_id:
          type: string
          description: User unique identifier.
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
        building_id:
          type: number
          description: Building unique identifier.
          example: 1234
    UserPositions:
      type: object
      properties:
        timestamp:
          type: string
          description: Position timestamp.
          format: date-time
          example: '2020-11-15T05:21:49Z'
        lat:
          type: number
          description: Geographic latitude in `WGS84` coordinate system.
          example: 48.2586649
        lng:
          type: number
          description: Geographic longitude in `WGS84`  coordinate system.
          example: -3.9073326
        building_id:
          type: number
          description: Building unique identifier.
          example: 1234
        indoor:
          type: boolean
          description: Position type.
          example: true
        user_id:
          type: string
          description: User unique identifier.
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
        device_id:
          type: string
          description: device unique identifier.
          example: '1234567'
    GeohashHeatmap:
      type: object
      properties:
        user_id:
          type: string
          description: User unique identifier.
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
        geohash:
          type: string
          description: level 10 precission geohash.
          example: eztyqcdsey
        lat:
          type: number
          description: geohasg latitude.
          example: 42.87227064371109
        lon:
          type: number
          description: geohash longitude.
          example: -8.563472628593445
        weight:
          type: number
          description: Number of positions in the geohash.
          example: 854
    UserSummaryView:
      description: Complete view for users.
      title: UserSummaryView
      allOf:
        - $ref: '#/components/schemas/User'
        - type: object
          properties:
            full_name:
              type: string
            email:
              type: string
              format: email
            uuid:
              type: string
              format: uuid
              deprecated: true
            id:
              type: string
              format: uuid
            code:
              type: string
              description: >-
                This field is available to the user in order to identify the
                user by his own code with which he is familiar (file number,
                bank account, employee number). Although it can be used to
                identify the user and filter through it, we do not currently
                allow the use of this parameter to access the website or change
                the password.
            created_at:
              type: string
              format: time-date
              example: '2019-07-01T15:21:54.276Z'
            updated_at:
              type: string
              format: time-date
              example: '2019-07-01T15:21:54.276Z'
            admin:
              type: boolean
              deprecated: true
            admin_org:
              type: boolean
              deprecated: true
            last_activity:
              type: string
              format: time-date
              example: '2019-07-01T15:21:54.276Z'
            locale:
              type: string
              enum:
                - es
                - en
              example: es
    UserExtraView:
      title: UserExtraView
      allOf:
        - $ref: '#/components/schemas/UserSummaryView'
        - type: object
          properties:
            subscribed_to_newsletter:
              type: boolean
            has_write_building:
              type: boolean
              deprecated: true
            is_verified:
              type: boolean
            has_building:
              type: boolean
              description: >-
                Indicates if the user is associated with any building.In order
                to associate it, it must be indicated in the user's buildings
                field.
            groups:
              deprecated: true
              type: array
              items:
                type: object
                format: uuid
                example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
            group_ids:
              type: array
              items:
                type: object
                format: uuid
                example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
            license:
              $ref: '#/components/schemas/License'
        - type: object
          properties:
            license:
              deprecated: true
    UserAdminView:
      title: UserAdminView
      allOf:
        - $ref: '#/components/schemas/UserExtraView'
        - type: object
          properties:
            verified_by_admin:
              type: boolean
              deprecated: true
    UserForm:
      title: UserForm
      description: User form to post
      type: object
      properties:
        email:
          type: string
          example: mail@mail.es
        password:
          type: string
          example: pass
        organization_uuid:
          type: string
          deprecated: true
          example: 09bcfc18-5df4-11ea-bc55-0242ac130003
        organization_id:
          type: string
          example: 09bcfc18-5df4-11ea-bc55-0242ac130003
        full_name:
          type: string
          example: My name
        locale:
          type: string
          example: en
        code:
          type: string
          example: user_code
        role_id:
          type: string
          example: ZONE_MANAGER
          enum:
            - ADMIN_ORG
            - ZONE_MANAGER
            - COLLECTIVE_MANAGER
            - USER
            - STAFF
        subscribed_to_newsletter:
          type: boolean
          example: false
        verified_by_Admin:
          type: boolean
          example: false
        is_manager:
          type: boolean
          deprecated: true
          example: false
        is_staff:
          type: boolean
          example: false
        rol_ids:
          type: array
          description: >-
            Role_ids are actually groups. In future versions the field will be
            renamed to group_ids.
          deprecated: true
          items:
            type: string
            format: uuid
          example:
            - ba8bc8ee-5df4-11ea-bc55-0242ac130003
            - a9c0193a-28c3-11eb-adc1-0242ac120002
        group_ids:
          type: array
          items:
            type: string
            format: uuid
          example:
            - ba8bc8ee-5df4-11ea-bc55-0242ac130003
            - a9c0193a-28c3-11eb-adc1-0242ac120002
        buildings:
          type: array
          deprecated: true
          items:
            type: number
          example:
            - 2233
            - 4432
        building_ids:
          type: array
          items:
            type: number
          example:
            - 2233
            - 4432
        situm_maps:
          type: boolean
          example: true
        sos_alarm:
          type: boolean
          example: true
          deprecated: true
        deadman_alarm:
          type: boolean
          example: true
          deprecated: true
        see_alarm:
          type: boolean
          example: true
          deprecated: true
        declare_emergency:
          type: boolean
          example: true
          deprecated: true
        cancel_emergency:
          type: boolean
          example: true
          deprecated: true
        confirm_emergency:
          type: boolean
          example: true
          deprecated: true
        collective_id:
          type: string
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
          deprecated: true
        assignment_id:
          type: string
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
          deprecated: true
        icon_colour:
          type: string
          example: '656465'
        info:
          type: string
          example: Some info
          description: User aditional information.
        custom_fields:
          type: object
          example:
            customfiel1: 10
            customfiel2: value cuestomfield2
    UserPatch:
      title: UserFormPatch
      description: User form to patch operation
      type: object
      properties:
        email:
          type: string
          example: mail@mail.es
        password:
          type: string
          example: password
        organization_id:
          type: string
          example: 09bcfc18-5df4-11ea-bc55-0242ac130003
        full_name:
          type: string
          example: My name
        locale:
          type: string
          example: en
        code:
          type: string
          example: user_code
        subscribed_to_newsletter:
          type: boolean
          example: false
        verified_by_Admin:
          type: boolean
          example: false
        role:
          type: string
          example: ZONE_MANAGER
          enum:
            - ADMIN_ORG
            - ZONE_MANAGER
            - COLLECTIVE_MANAGER
            - USER
            - STAFF
        group_ids:
          type: array
          items:
            type: string
            format: uuid
          example:
            - ba8bc8ee-5df4-11ea-bc55-0242ac130003
            - a9c0193a-28c3-11eb-adc1-0242ac120002
        building_ids:
          type: array
          items:
            type: number
          example:
            - 2233
            - 4432
        icon_colour:
          type: string
          example: '656465'
        info:
          type: string
          example: Some info
          description: User aditional information.
    Permission:
      title: Permission
      properties:
        uuid:
          type: string
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
        permission:
          type: string
          example: ALL
          enum:
            - ALL
            - WRITE
            - ANALYTICS
            - READ
        typeEntityTarget:
          type: string
          example: BUILDING
          enum:
            - BUILDING
            - USER
            - GROUP
        idEntityTargetBuilding:
          type: number
          example: 1234
        idEntityTarget:
          type: string
          format: uuid
          example: 71asdfa-187a-4144-945d-6d8da94fac9c
    AnalyticsGeofencingMatchesBetweenUser:
      properties:
        origin_user_id:
          type: string
          format: uuid
          example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
        origin_device_id:
          type: string
          example: 3674847383738
        start_shared_time:
          type: string
          format: date-time
          example: '2017-05-25T21:55:00.000Z'
        end_shared_time:
          type: string
          format: date-time
          example: '2017-05-25T21:59:00.000Z'
        total_shared_time:
          type: number
          example: 240
        matched_user_id:
          type: string
          format: uuid
          example: 71asdfa-187a-4144-945d-6d8da94fac9c
        matched_device_id:
          type: string
          example: 342143214321421440
        building_id:
          type: number
          format: long
          example: 4444
        fence_id:
          type: string
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
    AnalyticsDistanceBetweenUser:
      type: object
      properties:
        origin_user_id:
          type: string
          format: uuid
          example: a0e115d1-0b32-44a2-8d56-21ba36b710f0
        origin_device_id:
          type: string
          example: 222333882898393820
        matched_user_id:
          type: string
          format: uuid
          example: 71asdfa-187a-4144-945d-6d8da94fac9c
        matched_device_id:
          type: string
          example: 342143214321421440
        building_id:
          type: number
          format: long
          example: 4444
        floor_id:
          type: number
          format: long
          example: 4444
        time_bucket:
          type: string
          format: date-time
          example: '2017-05-25T21:55:00Z'
        distance:
          type: number
          example: 5.843
    AnalyticsHasData:
      type: object
      properties:
        building_ids:
          type: array
          items:
            type: integer
            example:
              - 9476947494
              - 7886599875
        dates:
          type: array
          items:
            type: string
            format: date
            example:
              - '2020-12-15'
              - '2020-12-16'
        device_ids:
          type: array
          items:
            type: string
            example:
              - '952334819123'
              - '952334819124'
        floor_ids:
          type: array
          items:
            type: integer
            example: '4356'
        users_ids:
          type: array
          items:
            type: string
            format: uuid
            example:
              - 9ef69edc-3faf-4966-bb48-63338e0f3760
              - 9ef69edc-3faf-4966-bb48-63338e0f3761
    rawPoseAnalyticResult:
      type: object
      properties:
        analytics:
          type: array
          items:
            type: object
            properties:
              device_id:
                type: string
              floor_id:
                type: integer
              position:
                type: array
                items:
                  minimum: 2
                  maximum: 2
                  type: integer
                  format: float
              geographic:
                type: object
                properties:
                  lat:
                    type: integer
                    format: float
                  lng:
                    type: integer
                    format: float
              time_sec:
                type: string
                format: date-time
      example:
        analytics:
          - device_id: 255716529991690
            floor_id: 50
            position:
              - 8.77718353
              - 17.8887081
            yaw: 267
            accuracy: 0.9884532322
            time_sec: '2015-04-15T21:03:06.000Z'
          - device_id: 255716529991691
            floor_id: 50
            position:
              - 8.77718354
              - 17.88877648
            yaw: 267
            accuracy: 0.9884532322
            time_sec: '2015-04-15T21:03:06.000Z'
    GeofencingStayTime:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          example: '2020-11-15T05:21:49Z'
        device_id:
          type: string
          example: 222333882898393820
        user_id:
          type: string
          format: uuid
          example: 71asdfa-187a-4144-945d-6d8da94fac9c
        building_id:
          type: number
          format: long
          example: 4444
        floor_id:
          type: number
          format: long
          example: 4444
        matched_fence_id:
          type: string
          format: uuid
          example: 71asdfa-187a-4144-945d-6d8da94fac9c
        seconds_in_fence:
          type: number
          example: 5843
        stay_time:
          type: string
          example: '02:44:24'
        sessions_count:
          type: number
          example: 3
    GeofencingSesionMatch:
      type: object
      properties:
        device_id:
          type: string
          example: 98393820
        user_id:
          type: string
          format: uuid
          example: 71asdfa-187a-4144-945d-6d8da94fac9c
        building_id:
          type: number
          format: long
          example: 4444
        floor_id:
          type: number
          format: long
          example: 4444
        matched_fence_id:
          type: string
          format: uuid
          example: 71asdfa-187a-4144-945d-6d8da94fac9c
        ts_start:
          type: string
          format: date-time
          example: '2020-11-15T05:21:49Z'
        ts_end:
          type: string
          format: date-time
          example: '2020-11-15T06:21:49Z'
        seconds_in_fence:
          type: number
          example: 60
    userPosition:
      type: object
      properties:
        timestamp:
          type: string
          description: Position timestamp.
          format: date-time
          example: '2020-11-15T05:21:49Z'
        session_mark:
          type: integer
          description: User positioning sesion mark.
          example: 435434
        building_id:
          type: integer
          description: Building unique identifier.
          example: 6584
        floor_id:
          type: integer
          description: floor unique identifier.
          example: 1232
        user_id:
          type: string
          description: User unique identifier.
          format: uuid
          example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
        device_id:
          type: string
          description: device unique identifier.
          example: '1234567'
        lat:
          type: number
          description: Geographic latitude in `WGS84` coordinate system.
          example: 48.2586649
        lng:
          type: number
          description: Geographic longitude in `WGS84`  coordinate system.
          example: -3.9073326
    MetaCommonData:
      title: MetaCommonData
      type: object
      description: Stats and info about request.
      properties:
        meta:
          type: array
          items:
            $ref: '#/components/schemas/ReportsMeta'
        statistics:
          $ref: '#/components/schemas/ReportsStatistics'
        rows:
          type: number
          format: integer
          example: 1
          description: Number of items returned in the response.
    ReportsError:
      title: ReportsError
      type: object
      description: Reports error
      properties:
        error:
          type: string
          description: Error description.
          example: Error validating 'ddd' to type Int8
    ReportsMeta:
      title: ReportsMeta
      type: object
      description: Field and type of response.
      properties:
        name:
          type: string
          description: Field name
        type:
          type: string
          enum:
            - String
            - Int32
            - DateTime
            - Int64
    ReportsStatistics:
      title: ReportsStatistics
      type: object
      description: Request statistics.
      properties:
        elapsed:
          type: number
          format: float
          description: Time elapsed in the query.
        rows_read:
          type: number
          format: integer
          description: Number of rows read in the database.
        bytes_read:
          type: number
          format: integer
          description: Number of bytes read in the database.
    visitorAnalylicResult:
      type: object
      properties:
        result:
          type: array
          items:
            type: object
            properties:
              value:
                type: object
                properties:
                  ends:
                    type: string
                    format: date-time
                    example: '2017-05-25T21:55:00.000-03:00'
                  starts:
                    type: string
                    format: date-time
                    example: '2017-05-25T21:55:00.000-03:00'
                  floor_id:
                    type: integer
                    example: 5342
                  minutes_session:
                    type: integer
                    example: 215
                  x:
                    type: integer
                    format: long
                    example: 66.11375427246094
                  'y':
                    type: integer
                    format: long
                    example: 29.11375427246094
    Volatile:
      type: object
      properties:
        building_origin:
          type: integer
          description: Identifier of the building from which the user comes.
          format: int64
          example: 1111
        building_destination:
          type: integer
          description: Identifier of the building where the user goes.
          format: int64
          example: 2222
        poi_id:
          type: integer
          description: Identifier of the poi found.
          format: int64
          example: 33333
    positioningSessionsAnalyticResult:
      type: object
      properties:
        result:
          type: array
          items:
            type: object
            properties:
              value:
                type: object
                properties:
                  ends:
                    type: string
                    format: date-time
                    example: '2017-05-25T21:55:00.000-03:00'
                  starts:
                    type: string
                    format: date-time
                    example: '2017-05-25T21:55:00.000-03:00'
                  floor_id:
                    type: integer
                    example: 5342
                  minutes_session:
                    type: integer
                    example: 215
                  x:
                    type: integer
                    format: long
                    example: 66.11375427246094
                  'y':
                    type: integer
                    format: long
                    example: 29.11375427246094
    positioningTimeAreaAnalyticResult:
      type: object
      properties:
        result:
          type: array
          items:
            type: object
            properties:
              user:
                type: string
                format: uuid
                example: 0f1a3d9a-9ff4-4974-ba21-cebcfeb98cd6
              matched_poses:
                type: integer
                example: 3032
              stay_duration:
                type: string
                example: '00:47:32'
              device:
                type: string
                example: '1003415738024'
              timestamp:
                type: string
                format: date-time
                example: '2020-05-14T00:00:00+02:00'
    positioningTimeAnalyticResult:
      type: object
      properties:
        result:
          type: array
          items:
            type: object
            properties:
              day:
                type: string
              timestamp:
                type: string
                format: timestamp
              total:
                type: integer
              avg:
                type: integer
              std:
                type: integer
              buildingId:
                type: integer
              levelId:
                type: integer
              isIndoor:
                type: boolean
    TaskBase:
      title: TaskBase
      type: object
      description: >-
        Task or event that will be monitored to make it happen and in what
        conditions it has been executed. This event or task can be planned in a
        temporary space and assigned to a user or none.
      properties:
        name:
          type: string
          example: Check that the doors are close.
          description: Task name
          minLength: 1
          maxLength: 200
        description:
          type: string
          example: Go through all the perimeter doors to make sure they are closed
          description: A more extensive description of what the task consists of.
        enabled:
          type: boolean
          example: true
          description: Indicates whether the task is to be performed or not.
        lat:
          type: number
          format: float
          description: Geographic latitude represented in `WGS84` coordinate system.
          example: 42.3307132892641
        lng:
          type: number
          format: float
          description: Geographic longitude represented in `WGS84` coordinate system.
          example: -7.87168136788409
        user_id:
          description: The uuid of the user that execute the task.
          type: string
          format: uuid
          example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
        organization_id:
          description: The uuid of the organization.
          type: string
          format: uuid
          example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
        executed_at:
          type: string
          format: date-time
          description: Time when the task was executed.
    TaskForm:
      allOf:
        - $ref: '#/components/schemas/TaskBase'
        - type: object
          properties:
            id:
              type: string
              format: uuid
              example: 7cc5dcbe-94e7-4270-b778-459bf88928f2
    Task:
      allOf:
        - $ref: '#/components/schemas/TaskForm'
        - type: object
          properties:
            organization_id:
              type: string
              format: uuid
              description: The organization id.
            created_at:
              type: string
              format: date-time
              description: Time when the task was created.
            updated_at:
              type: string
              format: date-time
              description: Last time when the task was updated.
            deleted_at:
              type: string
              format: date-time
              description: Last time when the task was deleted.
  requestBodies:
    AlarmForm:
      content:
        application/json:
          schema:
            type: object
            required:
              - type
              - building_id
              - floor_id
              - x
              - 'y'
            properties:
              type:
                $ref: '#/components/schemas/AlarmType'
              building_id:
                type: integer
                format: long
                description: >-
                  The identifier of the building where the alarm will be
                  created.
              x:
                type: integer
                format: float
                description: >-
                  The cartesian X coordinate where the alarm will be created. Is
                  is specified in meters from the bottom-left corner of the
                  floorplan. See <a
                  href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
                  this explanation</a> for details.
              'y':
                type: integer
                format: float
                description: >-
                  The cartesian Y coordinate where the alarm will be created. Is
                  is specified in meters from the bottom-left corner of the
                  floorplan. See <a
                  href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
                  this explanation</a> for details.
              lat:
                type: integer
                format: float
                description: >-
                  The latitude in WSG84 format where the alarm will be created.
                  See <a
                  href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
                  this explanation</a> for details.
              lng:
                type: integer
                format: float
                description: >-
                  The longitude in WSG84 format where the alarm will be created.
                  See <a
                  href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
                  this explanation</a> for details.
              floor_id:
                type: integer
                format: long
                description: The identifier of the floor where the alarm will be created.
              location_description:
                maxLength: 255
                type: string
                example: Main hall near the elevator
                description: >-
                  A free description of the location where the alarm was
                  triggered (e.g. "Main hall near the elevator").
              action:
                type: string
                description: A free description of the action that must be done.
                example: Send tactical team.
                maxLength: 255
              message:
                type: string
                example: Suspicious red bacpack.
                maxLength: 255
                description: >-
                  A free text that will be attached to the alarm (e.g.
                  "Suspicious red bagpack").
              custom_fields:
                type: array
                description: An array of custom fields that can be attached to the alarm.
                items:
                  $ref: '#/components/schemas/CustomField'
          example:
            type: DANGER
            building_id: 2038
            x: 20.25
            'y': 20.47
            floor_id: 4014
    AlarmUpdateForm:
      content:
        application/json:
          schema:
            type: object
            required:
              - user_uuid
            properties:
              attended_by:
                type: string
                format: uuid
                example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                description: Use id who attended to the alarm
              attended_at:
                type: string
                format: date-time
                description: Last time when the event was updated
              active:
                type: boolean
                description: If the alarms is active or not
                example: true
              custom_fields:
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
              location_description:
                type: string
                maxLength: 255
                example: Main hall near the elevator
                description: >-
                  A free description of the location where the status change was
                  triggered (e.g. "Main hall near the elevator").
              building_id:
                type: integer
                format: long
                description: >-
                  The identifier of the building where the alarm will be
                  updated.
              x:
                type: integer
                format: float
                description: >-
                  The cartesian X coordinate where the alarm will be updated. Is
                  is specified in meters from the bottom-left corner of the
                  floorplan. See <a
                  href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
                  this explanation</a> for details.
              'y':
                type: integer
                format: float
                description: >-
                  The cartesian Y coordinate where the alarm will be updated. Is
                  is specified in meters from the bottom-left corner of the
                  floorplan. See <a
                  href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
                  this explanation</a> for details.
              lat:
                type: integer
                format: float
                description: >-
                  The latitude in WSG84 format where the alarm will be updated.
                  See <a
                  href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
                  this explanation</a> for details.
              lng:
                type: integer
                format: float
                description: >-
                  The longitude in WSG84 format where the alarm will be updated.
                  See <a
                  href="https://situm.freshdesk.com/a/solutions/articles/35000168185">
                  this explanation</a> for details.
              floor_id:
                type: integer
                format: long
                description: The identifier of the floor where the alarm will be updated.
    AlarmStatusCreateForm:
      content:
        application/json:
          schema:
            type: object
            required:
              - custom_fields
              - user_id
              - status
            allOf:
              - $ref: '#/components/schemas/AlarmStatusChangeBase'
    AlarmStatusUpdateForm:
      content:
        application/json:
          schema:
            required:
              - active
            type: object
            properties:
              message:
                type: string
                maxLength: 255
                description: The registered message that explains the status change.
                example: Suspicious red handbag in the lobby.
              location_description:
                type: string
                maxLength: 255
                example: Main hall near the elevator
                description: >-
                  A free description of the location where the status change was
                  triggered (e.g. "Main hall near the elevator").
              action:
                type: string
                maxLength: 255
                description: A free description of the action that must be done.
                example: Send tactical team.
    AlarmStatusChangeForm:
      description: List with all the alarm status changes.
      content:
        application/json:
          schema:
            type: object
            required:
              - user_id
              - status
            allOf:
              - $ref: '#/components/schemas/AlarmStatusChangeUpdate'
      required: true
    ApiKeyForm:
      description: Api key content
      content:
        application/json:
          schema:
            type: object
            required:
              - permission
            properties:
              permission:
                $ref: '#/components/schemas/ApiKeyPermission'
              user_id:
                type: string
                format: uuid
              description:
                type: string
                maxLength: 255
    FloorForm:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - building_id
              - level
              - map_id
            properties:
              building_id:
                type: integer
                example: 1234
              level:
                type: integer
                example: 1
              level_height:
                type: number
                format: float
                example: 2.7
              map_id:
                type: string
                example: bec3cfa0f-15d2-4f66-85a3-6a2ec527a75a.jpg
              name:
                type: string
                example: level
              custom_fields:
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
    PoiUpdateForm:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - position
            properties:
              name:
                type: string
                description: The name of the point of interest.
                example: Random name
              info:
                type: string
                description: Additional info for the point of interest.
                example: Additional info for the point of interest.
              icon:
                type: string
                description: Id of image to use as poi icon.
                example: ab7979ae-dc43-4267-9ba5-bdd1bdccfa95.png
              selected_icon:
                type: string
                description: Id of image to use as selected icon.
                example: 7ef5589d-e1ab-4ad9-85a5-895589e81864.png
              category_id:
                type: number
                description: >-
                  The Main category identifier to which point of interest will
                  be associated. See /api/v1/poi_categories to retrieve all the
                  categories your organization has access to.
                example: 4
              category_ids:
                type: array
                description: >-
                  The categories identifiers to which point of interest will be
                  associated. If more than one category is assigned, a poi the
                  array must contain the selected main category :category_id
                items:
                  type: number
                example:
                  - 4
                  - 5
                  - 6
              position:
                type: object
                description: The position where POI it is going to be created.
                required:
                  - floor_id
                  - georeferences
                properties:
                  floor_id:
                    type: number
                    description: Identifier of the floor where POI is gonna be positioned.
                    example: 3241
                  georeferences:
                    properties:
                      lat:
                        type: number
                        format: float
                        description: >-
                          Geographic latitude represented in `WGS84` coordinate
                          system.
                        example: 42.3307132892641
                      lng:
                        type: number
                        format: float
                        description: >-
                          Geographic longitude represented in `WGS84` coordinate
                          system.
                        example: -7.87168136788409
              custom_fields:
                description: Custom fields to implement in the point of interest.
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
    PoiCreateForm:
      required: true
      content:
        application/json:
          schema:
            type: object
            required:
              - building_id
              - position
            properties:
              name:
                type: string
                description: The name of the point of interest.
                example: Random name
              info:
                type: string
                description: Additional info for the point of interest.
                example: Some additional information
              icon:
                type: string
                description: Id of image to use as poi icon.
                example: ab7979ae-dc43-4267-9ba5-bdd1bdccfa95.png
              selected_icon:
                type: string
                description: Id of image to use as poi icon.
                example: 7ef5589d-e1ab-4ad9-85a5-895589e81864.png
              building_id:
                type: number
                description: The building identifier.
                example: 13412
              category_id:
                type: number
                description: >-
                  The category identifier to which point of interest will be
                  associated. See /api/v1/poi_categories to retrieve all the
                  categories your organization has access to.
                example: 4
              category_ids:
                type: array
                description: >-
                  The categories identifiers to which point of interest will be
                  associated. If more than one category is assigned, a poi the
                  array must contain the selected main category :category_id
                items:
                  type: number
                example:
                  - 4
                  - 5
                  - 6
              position:
                type: object
                description: The position where POI it is going to be created.
                required:
                  - floor_id
                  - georeferences
                properties:
                  floor_id:
                    type: number
                    description: Identifier of the floor where POI is gonna be positioned.
                    example: 3241
                  georeferences:
                    properties:
                      lat:
                        type: number
                        format: float
                        description: >-
                          Geographic latitude represented in `WGS84` coordinate
                          system.
                        example: 42.3307132892641
                      lng:
                        type: number
                        format: float
                        description: >-
                          Geographic longitude represented in `WGS84` coordinate
                          system.
                        example: -7.87168136788409
              custom_fields:
                description: Custom fields to implement in the point of interest.
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
    PoiCreateFormList:
      content:
        application/json:
          schema:
            type: array
            items:
              type: object
              required:
                - building_id
                - position
              properties:
                name:
                  type: string
                  description: The name of the point of interest.
                  example: Random name
                info:
                  type: string
                  description: Additional info for the point of interest.
                  example: Some additional information
                icon:
                  type: string
                  description: Id of image to use as poi icon.
                  example: ab7979ae-dc43-4267-9ba5-bdd1bdccfa95.png
                selected_icon:
                  type: string
                  description: Id of image to use as poi icon.
                  example: 7ef5589d-e1ab-4ad9-85a5-895589e81864.png
                building_id:
                  type: number
                  description: The building identifier.
                  example: 13412
                category_id:
                  type: number
                  description: >-
                    The category identifier to which point of interest will be
                    associated. See /api/v1/poi_categories to retrieve all the
                    categories your organization has access to.
                  example: 4
                category_ids:
                  type: array
                  description: >-
                    The categories identifiers to which point of interest will
                    be associated. If more than one category is assigned, a poi
                    the array must contain the selected main category
                    :category_id
                  items:
                    type: number
                  example:
                    - 4
                    - 5
                    - 6
                position:
                  type: object
                  description: The position where POI it is going to be created.
                  required:
                    - floor_id
                    - georeferences
                  properties:
                    floor_id:
                      type: number
                      description: >-
                        Identifier of the floor where POI is gonna be
                        positioned.
                      example: 3241
                    georeferences:
                      properties:
                        lat:
                          type: number
                          format: float
                          description: >-
                            Geographic latitude represented in `WGS84`
                            coordinate system.
                          example: 42.3307132892641
                        lng:
                          type: number
                          format: float
                          description: >-
                            Geographic longitude represented in `WGS84`
                            coordinate system.
                          example: -7.87168136788409
                custom_fields:
                  description: Custom fields to implement in the point of interest.
                  type: array
                  items:
                    $ref: '#/components/schemas/CustomField'
    PatrolCreateForm:
      content:
        application/json:
          schema:
            type: object
            required:
              - name
            properties:
              name:
                description: The name of the patrol.
                type: string
              organization_id:
                type: string
                description: The identifier of the organization.
                format: uuid
                example: 71asdfa-187a-4144-945d-6d8da94fac9c
              code:
                type: string
                example: roundCode
              description:
                description: The description of the patrol.
                type: string
              executions_per_day:
                description: Number of executions per day.
                type: number
                format: int32
                example: 5
              offset:
                type: integer
                format: long
              dwell_time:
                type: integer
              dwell_out_time:
                type: integer
              custom_fields:
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
    PatrolUpdateForm:
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - name
              - description
              - offset
              - dwellTime
              - dwellOutTime
            properties:
              name:
                description: The name of the patrol.
                type: string
              code:
                type: string
                example: roundCode
              description:
                description: The description of the patrol.
                type: string
              offset:
                type: integer
                format: long
              organization_id:
                type: string
                description: The identifier of the organization.
                format: uuid
                example: 71asdfa-187a-4144-945d-6d8da94fac9c
              dwell_time:
                type: integer
              dwell_out_time:
                type: integer
              executions_per_day:
                description: Number of executions per day.
                type: number
                format: int32
                example: 5
              custom_fields:
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
    PatrolStepUpdateForm:
      content:
        application/json:
          schema:
            properties:
              building_ids:
                type: array
                items:
                  type: integer
                  format: long
                  example: 1234
              steps:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    fence_id:
                      type: number
                      format: long
                    poi_id:
                      type: number
                      format: long
                    round_id:
                      type: string
                      description: The identifier of the patrol.
                    description:
                      type: string
                      description: The description of the patrol step.
                    start:
                      type: string
                      format: date-time
                      description: The start date of the patrol step.
                    end:
                      type: string
                      format: date-time
                      description: The end date of the patrol step.
                    offset:
                      type: integer
                      format: long
                      description: >-
                        The offset time of the patrol step. Basically how many
                        minutes has the user above and below the assigned
                        start/end dates.
                    dwell_time:
                      type: integer
                      format: long
                    dwell_out_time:
                      type: integer
                      format: long
                    type:
                      type: string
                      enum:
                        - GO_THROUGH
                        - STAY_IN
                        - ANY_TIME
                        - ANY_ORDER
    BuildingCreateForm:
      description: Data to create a building.
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                type: string
                description: Building name.
              location:
                allOf:
                  - $ref: '#/components/schemas/Location'
                  - type: object
                    required:
                      - lat
                      - lng
              dimensions:
                description: Building dimensions in meters.
                type: object
                properties:
                  width:
                    description: >-
                      Distance between the topleft corner and the topright
                      corner.
                    type: number
                    format: float
                  length:
                    description: >-
                      Distance between the topright corner and the bottomright
                      corner.
                    type: number
                    format: float
                required:
                  - width
                  - length
              description:
                type: string
                description: Building address.
              rotation:
                description: >-
                  Building rotation in radians. In starting from the west in a
                  counter-clockwise order.
                type: number
                format: float
              custom_fields:
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
              picture_id:
                type: string
                nullable: true
              info:
                type: string
                description: Aditional information of the building in HTML.
            required:
              - name
              - dimensions
              - location
            example:
              name: My building
              description: Some description.
              location:
                lat: 42.3307132892641
                lng: -7.87168136788409
              dimensions:
                width: 36.6006156111518
                length: 20.5051547583146
              rotation: -0.664248151098747
              custom_fields: []
              picture_id: 9e3213d1-1a70-4cc4-a9d3-d74fd8b47172.png
              info: Free HTML information about the floor
    BuildingUpdateForm:
      required: true
      description: Data to update a building.
      content:
        application/json:
          schema:
            type: object
            properties:
              dimensions:
                description: Building dimensions in meters.
                type: object
              name:
                type: string
                description: Building name.
                properties:
                  width:
                    description: >-
                      Distance between the topleft corner and the topright
                      corner.
                    type: number
                    format: float
                  lenght:
                    description: >-
                      Distance between the topright corner and the bottomright
                      corner.
                    type: number
                    format: float
              description:
                type: string
                description: Building address.
              location:
                $ref: '#/components/schemas/Location'
              rotation:
                description: >-
                  Building rotation in radians. In starting from the west in a
                  counter-clockwise order.
                type: number
                format: float
              custom_fields:
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
              info:
                type: string
                description: Aditional information of the building in HTML.
            required:
              - name
              - location
              - dimensions
            example:
              user_uuid: ffe70d04-b20b-4aea-a0e8-39d25e062db1
              name: My building
              description: Some description.
              location:
                lat: 42.3307132892641
                lng: -7.87168136788409
              dimensions:
                width: 36.6006156111518
                length: 20.5051547583146
              rotation: -0.664248151098747
              custom_fields: []
              picture_url: 9e3213d1-1a70-4cc4-a9d3-d74fd8b47172.png
              info: Free HTML information about the floor
    GeofenceCreationForm:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/GeofenceForm'
              - type: object
                required:
                  - name
                  - type
                  - geometric
                  - building_id
                  - floor_id
          example:
            code: geofenceCode
            name: Geofence Human readable name
            organization_id: 7cc5dcbe-94e7-4270-b778-459bf88928f2
            info: <p>Information of the geofence</p>
            type: POLYGON
            geometric:
              - - 42.87222393230354
                - -8.563449931291075
              - - 42.8721964122444
                - -8.563451272395582
              - - 42.87219542938491
                - -8.563330572989912
              - - 42.87222294944449
                - -8.563330572989912
              - - 42.87222393230354
                - -8.563449931291075
            floor_id: 4263
            level_id: 4263
            building_id: '2872'
            custom_fields:
              - key: a
                value: z
              - key: b
                value: m
              - key: a
                value: j
    GeofenceUpdateForm:
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/GeofenceForm'
              - type: object
          example:
            code: geofenceCode
            name: Geofence Human readable name
            organization_id: 7cc5dcbe-94e7-4270-b778-459bf88928f2
            info: <p>Information of the geofence</p>
            type: POLYGON
            geometric:
              - - 42.87222393230354
                - -8.563449931291075
              - - 42.8721964122444
                - -8.563451272395582
              - - 42.87219542938491
                - -8.563330572989912
              - - 42.87222294944449
                - -8.563330572989912
              - - 42.87222393230354
                - -8.563449931291075
            floor_id: 4263
            level_id: 4263
            building_id: '2872'
            custom_fields:
              - key: a
                value: z
              - key: b
                value: m
              - key: a
                value: j
    GeofencesSearchForm:
      description: Data to search geofences.
      content:
        application/json:
          schema:
            type: object
            description: >-
              All params organization_id,name,building_ids can't be empty. One
              of them must be provided.
            properties:
              organization_id:
                type: string
              building_ids:
                type: array
                items:
                  type: number
                  format: long
              name:
                type: string
              deleted:
                type: boolean
            example:
              organization_id: 7cc5dcbe-94e7-4270-b778-459bf88928f2
              building_ids:
                - 2872
                - 2873
              name: geofenceOfiPasillo
              deleted: true
    EventForm:
      required: true
      description: Event form to post
      content:
        application/json:
          schema:
            type: object
            required:
              - building_id
              - name
              - position
            properties:
              building_id:
                type: integer
                description: >-
                  Building identifier (retrieve all you buildings to know their
                  identifiers).
              name:
                type: string
                description: Event name
              created_at:
                type: string
                format: date-time
                description: Time when the event was created
              updated_at:
                type: string
                format: date-time
                description: Last time when the event was updated
              info:
                type: string
                description: Event aditional information
              position:
                $ref: '#/components/schemas/CartographyPosition'
              conversion_area:
                $ref: '#/components/schemas/CartographyPosition'
              custom_fields:
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
    EventOcurrenceForm:
      required: true
      description: Event ocurrence form to post.
      content:
        application/json:
          schema:
            type: object
            required:
              - occurrence
            properties:
              occurrence:
                type: object
                required:
                  - encoded_macaddr
                properties:
                  clicked_at:
                    type: string
                    format: date-time
                    description: Time when the event ocurrence was triggered.
                  conversion_at:
                    type: string
                    format: date-time
                    description: Time when the event conversion action was triggered.
                  encoded_macaddr:
                    type: integer
                    description: a device id
    PoiCategoryForm:
      required: true
      description: Poi category form to post.
      content:
        application/json:
          schema:
            type: object
            required:
              - name_en
              - code
            properties:
              name_en:
                type: string
                description: The name of the category in English.
              name_es:
                type: string
                description: The name of the category in Spanish.
              code:
                type: string
                description: POI category code.
              icon:
                type: string
                description: POI image url.
              selected_icon:
                type: string
                description: POI selected image url.
              parent_poi_category_id:
                type: integer
                description: POI category parent id.
              custom_fields:
                type: array
                items:
                  $ref: '#/components/schemas/CustomField'
    PathForm:
      description: >-
        This graph represents all the routes by which the user can move within
        the building.
      content:
        application/json:
          schema:
            type: object
            properties:
              nodes:
                type: array
                description: >-
                  Each node represents a certain location within the building
                  (x, y, floor).
                items:
                  type: object
                  title: Node
                  properties:
                    id:
                      type: integer
                      description: Node identifier.
                    floor_id:
                      type: integer
                      description: Floor identifier in which the node is situated.
                    x:
                      type: number
                      format: float
                      description: >-
                        Cartesian coordinate in meters taking the bottomleft
                        corner as the origin.
                    'y':
                      type: number
                      format: float
                      description: >-
                        Cartesian coordinate in meters taking the bottomleft
                        corner as the origin.
              links:
                type: array
                items:
                  title: Link
                  type: object
                  properties:
                    source:
                      type: integer
                      description: Node identifier.
                    target:
                      type: integer
                      description: Node identifier.
                    origin:
                      type: string
                      enum:
                        - source
                        - target
                        - both
                      description: >
                        Indicates if the link is uni or bidirectional depending
                        on whether the origin is in one, another or both nodes.
                    accesible:
                      type: boolean
                      description: >-
                        Indicates if the path is situable for persons with
                        reduced mobility.
                    tags:
                      description: Indicates some properties of the links.
                      type: array
                      items:
                        type: string
    UserForm:
      description: User form to post.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserForm'
    UserCreateForm:
      required: true
      description: >-
        The password is always required, but you can pass email or code. Both
        are not required.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/UserForm'
            required:
              - email
              - password
              - code
              - is_manager
    UserUpdateForm:
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/UserForm'
              - type: object
                properties:
                  accept_terms:
                    type: boolean
                    nullable: true
                    default: null
    UserPatchForm:
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/UserPatch'
              - type: object
                properties:
                  accept_terms:
                    type: boolean
                    nullable: true
                    default: null
    UpdatePasswordRequest:
      description: Update pasword request.
      content:
        application/json:
          schema:
            type: object
            properties:
              n_password:
                type: string
                example: mail@mail.es
              old_password:
                type: string
                example: pass
    UpdateUserAdmin:
      description: UpdateUserAdmin request.
      content:
        application/json:
          schema:
            type: object
            properties:
              isAdmin:
                type: boolean
                example: true
    GroupUpdateForm:
      description: Group update form.
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/GroupBase'
    GroupCreateForm:
      description: Group create form.
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/GroupBase'
            required:
              - name
              - organization_id
    TaskPatchForm:
      required: true
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/TaskBase'
    TaskForm:
      required: true
      content:
        application/json:
          schema:
            required:
              - name
            allOf:
              - $ref: '#/components/schemas/TaskBase'
  securitySchemes:
    AuthorizationBearerJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Use the Authorization based on a Bearer JWT token. <a
        href="#auth_jwt_bearer">See JWT Bearer Auth for details</a>.
    AuthorizationAPIKEY:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Use the Authorization based on APIKEY headers. <a
        href="#auth_apikey">See APIKEY Auth for details</a>.
security:
  - AuthorizationBearerJWT: []
  - AuthorizationAPIKEY: []
