> ## Documentation Index
> Fetch the complete documentation index at: https://docs.beta.ontoto.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch GNSS sensor data

> Query detailed GNSS position data. Returns postprocessed positions, quality metrics and computed projections over a time range. Only applicable to GNSS-enabled devices.



## OpenAPI

````yaml post /sensor-data/gnss
openapi: 3.1.0
info:
  title: Ontoto API
  description: Ontoto backend API
  version: 1.0.0
servers:
  - url: https://api.beta.ontoto.com/v1
security:
  - ApiKeyAuth: []
paths:
  /sensor-data/gnss:
    post:
      summary: Fetch GNSS sensor data
      description: >-
        Query detailed GNSS position data. Returns postprocessed positions,
        quality metrics and computed projections over a time range. Only
        applicable to GNSS-enabled devices.
      operationId: postSensor-dataGnss
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GnssSensorDataPostRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GnssSensorDataPostResponse'
        '400':
          description: Invalid request format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBadRequest'
        '401':
          description: Client must be authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrUnauthorized'
        '403':
          description: Client does not have necessary permissions to access the resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrForbidden'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrNotFound'
        '409':
          description: Request could not be completed due to a uniqueness constraint
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrConflict'
        '500':
          description: Unexpected server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrInternalServerError'
components:
  schemas:
    GnssSensorDataPostRequest:
      description: Request body for querying GNSS sensor data, keyed by device
      type: object
      properties:
        deviceSerialNumbers:
          description: Array of device serial numbers
          type: array
          items:
            type: string
        legacyDeviceIds:
          description: Array of legacy device IDs
          type: array
          items:
            type: integer
            minimum: -9007199254740991
            maximum: 9007199254740991
        startDate:
          description: Start date in ISO 8601 format
          example: '2024-01-01T00:00:00.000Z'
          format: date-time
          type: string
        endDate:
          description: End date in ISO 8601 format
          example: '2024-01-31T23:59:59.000Z'
          format: date-time
          type: string
        orderBy:
          description: Ordering of data by timestamp
          example: asc
          default: asc
          type: string
          oneOf:
            - const: asc
              title: asc
              description: Oldest first
            - const: desc
              title: desc
              description: Newest first
        includeDeleted:
          description: Include soft-deleted sensor data in results
          type: boolean
      title: GnssSensorDataPostRequest
    GnssSensorDataPostResponse:
      description: Response body for querying GNSS sensor data
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/GnssSensorDataItem'
      required:
        - items
      title: GnssSensorDataPostResponse
    ErrBadRequest:
      example:
        message: Invalid request body
      type: object
      properties:
        message:
          description: Human readable message describing the issue
          type: string
      required:
        - message
      title: ErrBadRequest
    ErrUnauthorized:
      example:
        message: Authentication required
      type: object
      properties:
        message:
          description: Human readable message describing the issue
          type: string
      required:
        - message
      title: ErrUnauthorized
    ErrForbidden:
      example:
        message: You do not have permission to access this resource
      type: object
      properties:
        message:
          description: Human readable message describing the issue
          type: string
      required:
        - message
      title: ErrForbidden
    ErrNotFound:
      example:
        message: Resource not found
      type: object
      properties:
        message:
          description: Human readable message describing the issue
          type: string
      required:
        - message
      title: ErrNotFound
    ErrConflict:
      example:
        message: Duplicate entry
      type: object
      properties:
        message:
          description: Human readable message describing the issue
          type: string
      required:
        - message
      title: ErrConflict
    ErrInternalServerError:
      example:
        message: Internal server error
      type: object
      properties:
        message:
          description: Human readable message describing the issue
          type: string
      required:
        - message
      title: ErrInternalServerError
    GnssSensorDataItem:
      description: GNSS solution row per device from POST /sensor-data/gnss (and latest)
      type: object
      properties:
        deviceSerialNumber:
          description: Device serial number
          type: string
        deviceAlias:
          description: Device alias
          anyOf:
            - type: string
            - type: 'null'
        legacyDeviceId:
          description: Legacy device ID, if available
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        sensorUuid:
          description: Sensor UUID
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        sensorAlias:
          description: Sensor alias
          anyOf:
            - type: string
            - type: 'null'
        channelIndex:
          description: >-
            Zero-indexed sensor channel, the order the sensor is read on the
            device
          anyOf:
            - type: number
            - type: 'null'
        sensorStatus:
          $ref: '#/components/schemas/SensorStatus'
        srid:
          description: SRID of the RTKLib solution output coordinates (e.g. 4326 for WGS84)
          anyOf:
            - type: number
            - type: 'null'
        projectionMetadata:
          description: Available projections for this device's site
          type: array
          items:
            description: Site projection definition
            anyOf:
              - description: Standard EPSG-based site projection
                type: object
                properties:
                  id:
                    description: Database projection id
                    type: number
                  label:
                    description: Human-readable projection name
                    type: string
                  verticalDatum:
                    description: >-
                      Vertical datum label override; inherited from site config
                      when null
                    anyOf:
                      - type: string
                      - type: 'null'
                  heightType:
                    description: Height datum type (ellipsoidal or orthometric)
                    type: string
                    oneOf:
                      - const: ellipsoidal
                        title: ellipsoidal
                        description: Height above the reference ellipsoid (e.g. WGS84)
                      - const: orthometric
                        title: orthometric
                        description: Height above the geoid (mean sea level)
                  projectionType:
                    type: string
                    const: standard
                  srid:
                    description: EPSG code for the projection
                    type: number
                required:
                  - id
                  - label
                  - verticalDatum
                  - heightType
                  - projectionType
                  - srid
              - description: 2D Helmert transform with optional vertical correction
                type: object
                properties:
                  id:
                    description: Database projection id
                    type: number
                  label:
                    description: Human-readable projection name
                    type: string
                  verticalDatum:
                    description: >-
                      Vertical datum label override; inherited from site config
                      when null
                    anyOf:
                      - type: string
                      - type: 'null'
                  heightType:
                    description: Height datum type (ellipsoidal or orthometric)
                    type: string
                    oneOf:
                      - const: ellipsoidal
                        title: ellipsoidal
                        description: Height above the reference ellipsoid (e.g. WGS84)
                      - const: orthometric
                        title: orthometric
                        description: Height above the geoid (mean sea level)
                  projectionType:
                    type: string
                    const: helmert_2d
                  baseSrid:
                    description: Base SRID to project to before applying the transform
                    type: number
                  horizontal:
                    description: Horizontal 2D Helmert transform parameters
                    type: object
                    properties:
                      originEasting:
                        description: Origin easting used as reference point (m)
                        anyOf:
                          - type: number
                          - type: 'null'
                      originNorthing:
                        description: Origin northing used as reference point (m)
                        anyOf:
                          - type: number
                          - type: 'null'
                      rotation:
                        description: Rotation in degrees. Positive is anticlockwise.
                        anyOf:
                          - type: number
                          - type: 'null'
                      scaleFactor:
                        description: Scale factor (default 1.0)
                        anyOf:
                          - type: number
                          - type: 'null'
                      northOffset:
                        description: Northing translation after rotation and scaling (m)
                        anyOf:
                          - type: number
                          - type: 'null'
                      eastOffset:
                        description: Easting translation after rotation and scaling (m)
                        anyOf:
                          - type: number
                          - type: 'null'
                    required:
                      - originEasting
                      - originNorthing
                      - rotation
                      - scaleFactor
                      - northOffset
                      - eastOffset
                  vertical:
                    description: Vertical correction parameters
                    anyOf:
                      - description: First order vertical plane correction parameters
                        type: object
                        properties:
                          originEasting:
                            description: >-
                              Origin easting for the vertical adjustment plane
                              (m)
                            anyOf:
                              - type: number
                              - type: 'null'
                          originNorthing:
                            description: >-
                              Origin northing for the vertical adjustment plane
                              (m)
                            anyOf:
                              - type: number
                              - type: 'null'
                          heightOffset:
                            description: Height offset at the vertical origin (m)
                            anyOf:
                              - type: number
                              - type: 'null'
                          slopeNorth:
                            description: >-
                              Slope correction in the north direction (m/m),
                              relative to the vertical origin
                            anyOf:
                              - type: number
                              - type: 'null'
                          slopeEast:
                            description: >-
                              Slope correction in the east direction (m/m),
                              relative to the vertical origin
                            anyOf:
                              - type: number
                              - type: 'null'
                        required:
                          - originEasting
                          - originNorthing
                          - heightOffset
                          - slopeNorth
                          - slopeEast
                      - type: 'null'
                required:
                  - id
                  - label
                  - verticalDatum
                  - heightType
                  - projectionType
                  - baseSrid
                  - horizontal
                  - vertical
              - description: PROJ string-based site projection
                type: object
                properties:
                  id:
                    description: Database projection id
                    type: number
                  label:
                    description: Human-readable projection name
                    type: string
                  verticalDatum:
                    description: >-
                      Vertical datum label override; inherited from site config
                      when null
                    anyOf:
                      - type: string
                      - type: 'null'
                  heightType:
                    description: Height datum type (ellipsoidal or orthometric)
                    type: string
                    oneOf:
                      - const: ellipsoidal
                        title: ellipsoidal
                        description: Height above the reference ellipsoid (e.g. WGS84)
                      - const: orthometric
                        title: orthometric
                        description: Height above the geoid (mean sea level)
                  projectionType:
                    type: string
                    const: proj_string
                  projString:
                    description: PROJ definition string for the projection
                    type: string
                required:
                  - id
                  - label
                  - verticalDatum
                  - heightType
                  - projectionType
                  - projString
        baseStations:
          description: Base stations referenced by this series (resolve point `bs`)
          type: array
          items:
            type: object
            properties:
              id:
                description: Base station ID
                type: number
              type:
                description: Source of GNSS base station corrections
                type: string
                oneOf:
                  - const: cors
                    title: cors
                    description: Public Continuously Operating Reference Station network
                  - const: private
                    title: private
                    description: Privately operated reference station
                  - const: device
                    title: device
                    description: Another Ontoto GNSS device acting as a base station
              name:
                type: string
              status:
                description: Operational status of a GNSS base station
                type: string
                oneOf:
                  - const: active
                    title: active
                    description: Receiving data on schedule
                  - const: inactive
                    title: inactive
                    description: Configured but not currently expected to transmit
                  - const: no_data
                    title: no_data
                    description: No data has been received recently
                  - const: error
                    title: error
                    description: Base station is reporting errors
                  - const: unknown
                    title: unknown
                    description: Status cannot be determined
              isEnabled:
                type: boolean
            required:
              - id
              - type
              - name
              - status
              - isEnabled
        data:
          description: Array of GNSS processed positions
          type: array
          items:
            description: GNSS processed position data point (compact keys)
            type: object
            properties:
              id:
                description: Processed position row ID
                type: number
              timestamp:
                description: ISO 8601 formatted timestamp
                type: string
                format: date-time
              bs:
                description: ID of the base station that produced this position
                type: number
              lat:
                description: Latitude (WGS84)
                anyOf:
                  - type: number
                  - type: 'null'
              lon:
                description: Longitude (WGS84)
                anyOf:
                  - type: number
                  - type: 'null'
              eh:
                description: Ellipsoidal height (m)
                anyOf:
                  - type: number
                  - type: 'null'
              oh:
                description: Orthometric height (m), if a geoid model is configured
                anyOf:
                  - type: number
                  - type: 'null'
              quality:
                description: Solution quality metrics
                type: object
                properties:
                  sdn:
                    description: Standard deviation north (m)
                    anyOf:
                      - type: number
                      - type: 'null'
                  sde:
                    description: Standard deviation east (m)
                    anyOf:
                      - type: number
                      - type: 'null'
                  sdu:
                    description: Standard deviation up (m)
                    anyOf:
                      - type: number
                      - type: 'null'
                  q:
                    description: Solution status (1=fix, 2=float, 5=single)
                    anyOf:
                      - type: number
                      - type: 'null'
                  ns:
                    description: Number of satellites used in solution
                    anyOf:
                      - type: number
                      - type: 'null'
                  ar:
                    description: Ambiguity ratio
                    anyOf:
                      - type: number
                      - type: 'null'
                required:
                  - sdn
                  - sde
                  - sdu
                  - q
                  - ns
                  - ar
              roll:
                description: Roll angle from accelerometer (degrees)
                anyOf:
                  - type: number
                  - type: 'null'
              pitch:
                description: Pitch angle from accelerometer (degrees)
                anyOf:
                  - type: number
                  - type: 'null'
              dE:
                description: Delta east (m)
                anyOf:
                  - type: number
                  - type: 'null'
              dN:
                description: Delta north (m)
                anyOf:
                  - type: number
                  - type: 'null'
              dU:
                description: Delta up (m)
                anyOf:
                  - type: number
                  - type: 'null'
              d2d:
                description: Delta 2D magnitude (m)
                anyOf:
                  - type: number
                  - type: 'null'
              d3d:
                description: Delta 3D magnitude (m)
                anyOf:
                  - type: number
                  - type: 'null'
              vE:
                description: Displacement rate east (mm/d)
                anyOf:
                  - type: number
                  - type: 'null'
              vN:
                description: Displacement rate north (mm/d)
                anyOf:
                  - type: number
                  - type: 'null'
              vU:
                description: Displacement rate up (mm/d)
                anyOf:
                  - type: number
                  - type: 'null'
              proj:
                description: Projected coordinates keyed by projection ID
                type: object
                propertyNames:
                  type: string
                additionalProperties:
                  description: Projected coordinates for a single projection
                  type: object
                  properties:
                    e:
                      description: Easting
                      anyOf:
                        - type: number
                        - type: 'null'
                    'n':
                      description: Northing
                      anyOf:
                        - type: number
                        - type: 'null'
                    h:
                      description: >-
                        Height (orthometric or ellipsoidal, depending on
                        vertical datum in projection metadata)
                      anyOf:
                        - type: number
                        - type: 'null'
                  required:
                    - e
                    - 'n'
                    - h
              debug:
                description: Processing status and debug info
                anyOf:
                  - description: Processing status and debug info
                    type: object
                    properties:
                      ps:
                        description: Processing status
                        type: string
                        oneOf:
                          - const: completed
                            title: completed
                            description: >-
                              Processing ran and produced a result; check
                              solutionStatus for quality
                          - const: deferred
                            title: deferred
                            description: >-
                              Insufficient data to process; will retry when more
                              data arrives
                          - const: failed
                            title: failed
                            description: >-
                              Processing encountered a hard failure and will not
                              auto-retry
                      err:
                        description: Error message
                        anyOf:
                          - type: string
                          - type: 'null'
                      at:
                        description: Processed at timestamp
                        anyOf:
                          - type: string
                            format: date-time
                          - type: 'null'
                      gw:
                        description: GPS week of observations used in postprocessing
                        anyOf:
                          - type: number
                          - type: 'null'
                      gd:
                        description: GPS day of observations used in postprocessing
                        anyOf:
                          - type: number
                          - type: 'null'
                      gt:
                        description: >-
                          GPS timestamp (seconds) of observations used in
                          postprocessing
                        anyOf:
                          - type: number
                          - type: 'null'
                      log:
                        description: S3 key of the postprocessing solution log file
                        anyOf:
                          - type: string
                          - type: 'null'
                    required:
                      - ps
                      - gw
                      - gd
                      - gt
                  - type: 'null'
            required:
              - id
              - timestamp
              - bs
              - lat
              - lon
              - eh
              - oh
              - quality
              - roll
              - pitch
              - dE
              - dN
              - dU
              - d2d
              - d3d
              - vE
              - vN
              - vU
              - proj
      required:
        - deviceSerialNumber
        - deviceAlias
        - legacyDeviceId
        - sensorUuid
        - sensorAlias
        - channelIndex
        - sensorStatus
        - srid
        - projectionMetadata
        - baseStations
        - data
      title: GnssSensorDataItem
    SensorStatus:
      description: >-
        Overall status dynamically derived from parameter errors. View details
        in the errors array.
      type: string
      oneOf:
        - const: ok
          title: ok
          description: All parameters are healthy
        - const: error
          title: error
          description: One or more parameters are in an error state
        - const: warning
          title: warning
          description: Sensor is operational but at least one parameter is faulty
        - const: unknown
          title: unknown
          description: Health cannot be determined (e.g. no data received yet)
      title: SensorStatus
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````