Voltair SiteVisits API
The SiteVisits API from Voltair — 2 operation(s) for sitevisits.
The SiteVisits API from Voltair — 2 operation(s) for sitevisits.
openapi: 3.0.3
info:
title: Voltair ApiKeys SiteVisits API
version: 0.1.0
description: 'Infrastructure inspection platform API. All endpoints are scoped to the authenticated organization via Bearer JWT or API key.
All timestamp fields on this API (createdAt, updatedAt, scheduledFor, capturedAt, expiresAt, deletedAt, etc.) are Unix timestamps in milliseconds since the epoch (UTC). Both request and response bodies use this representation.'
servers:
- url: /
security:
- BearerAuth: []
- ApiKeyAuth: []
tags:
- name: SiteVisits
paths:
/site-visits:
get:
tags:
- SiteVisits
operationId: listSiteVisits
summary: List site visits for a mission
description: 'Returns site visits for the given mission. When `compress=true`, returns
a mixed array of the highest-level ClusterVisit and unclustered SiteVisit
objects instead of the paginated list. Each item in the compressed
response includes a `type` discriminator field (`"clusterVisit"` or
`"siteVisit"`).
'
parameters:
- name: missionId
in: query
required: true
schema:
type: string
format: uuid
- name: compress
in: query
schema:
type: boolean
description: 'When true, returns a compressed representation: a mixed array of the highest-level ClusterVisit objects (whose parent cluster has no ClusterVisit in this mission) and unclustered SiteVisit objects. Pagination parameters are ignored when compress=true.
'
- name: unclustered
in: query
schema:
type: boolean
description: When true, returns only visits where clusterVisitId is null
- name: status
in: query
schema:
type: string
description: Comma-separated statuses
- $ref: '#/components/parameters/LimitParam'
- $ref: '#/components/parameters/CursorParam'
responses:
'200':
description: Success
headers:
X-Request-Id:
$ref: '#/components/headers/XRequestId'
content:
application/json:
schema:
oneOf:
- type: object
required:
- data
- meta
properties:
data:
type: array
items:
$ref: '#/components/schemas/SiteVisit'
meta:
$ref: '#/components/schemas/PaginationMeta'
- $ref: '#/components/schemas/CompressedVisitsResponse'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
/site-visits/{siteVisitId}:
parameters:
- name: siteVisitId
in: path
required: true
schema:
type: string
format: uuid
get:
tags:
- SiteVisits
operationId: getSiteVisit
summary: Get site visit
responses:
'200':
description: Success
headers:
X-Request-Id:
$ref: '#/components/headers/XRequestId'
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/SiteVisit'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/InternalError'
components:
responses:
Forbidden:
description: Insufficient permissions
headers:
X-Request-Id:
$ref: '#/components/headers/XRequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
NotFound:
description: Resource not found
headers:
X-Request-Id:
$ref: '#/components/headers/XRequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
BadRequest:
description: Bad request or validation error
headers:
X-Request-Id:
$ref: '#/components/headers/XRequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
Unauthorized:
description: Authentication required
headers:
X-Request-Id:
$ref: '#/components/headers/XRequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
InternalError:
description: Internal server error
headers:
X-Request-Id:
$ref: '#/components/headers/XRequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
TooManyRequests:
description: Rate limit exceeded
headers:
X-Request-Id:
$ref: '#/components/headers/XRequestId'
X-RateLimit-Limit:
schema:
type: integer
description: Maximum requests per window
X-RateLimit-Remaining:
schema:
type: integer
description: Requests remaining in current window
X-RateLimit-Reset:
schema:
type: number
description: Unix timestamp (ms) when the window resets
Retry-After:
schema:
type: integer
description: Seconds until the next rate limit window
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
schemas:
SiteVisitStatus:
type: string
enum:
- pending
- in-progress
- complete
- skipped
- failed
ErrorResponse:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
description: Machine-readable error code
message:
type: string
description: Human-readable description
details:
type: object
additionalProperties: true
description: Optional structured info (e.g. field-level validation errors, conflictingEventIds)
ClusterVisit:
type: object
required:
- id
- organizationId
- missionId
- clusterId
- siteCount
- completedCount
- status
- deletedAt
- createdAt
- updatedAt
properties:
id:
type: string
format: uuid
organizationId:
type: string
format: uuid
missionId:
type: string
format: uuid
clusterId:
type: string
format: uuid
siteCount:
type: integer
completedCount:
type: integer
status:
$ref: '#/components/schemas/ClusterVisitStatus'
deletedAt:
type: number
nullable: true
createdAt:
type: number
updatedAt:
type: number
ClusterVisitStatus:
type: string
enum:
- pending
- in-progress
- complete
PaginationMeta:
type: object
required:
- cursor
properties:
cursor:
type: string
nullable: true
description: Opaque cursor for the next page; null when no more results
total:
type: integer
description: Total matching results across all pages; included when cheaply computable
SiteVisit:
type: object
required:
- id
- organizationId
- missionId
- siteId
- clusterVisitId
- status
- completedAt
- recaptureReason
- recaptureRequestedBy
- recaptureRequestedAt
- deletedAt
- createdAt
properties:
id:
type: string
format: uuid
organizationId:
type: string
format: uuid
missionId:
type: string
format: uuid
siteId:
type: string
format: uuid
clusterVisitId:
type: string
format: uuid
nullable: true
description: FK to ClusterVisit; null for unclustered sites
status:
$ref: '#/components/schemas/SiteVisitStatus'
completedAt:
type: number
nullable: true
recaptureReason:
type: string
nullable: true
recaptureRequestedBy:
type: string
format: uuid
nullable: true
description: actorId of the requester
recaptureRequestedAt:
type: number
nullable: true
deletedAt:
type: number
nullable: true
createdAt:
type: number
CompressedVisitsResponse:
type: object
required:
- data
- meta
properties:
data:
type: array
description: 'Mixed array of ClusterVisit and SiteVisit objects. Each item includes a `type` field: `"clusterVisit"` or `"siteVisit"`. ClusterVisit items represent the highest-level clusters whose parent cluster does not have a ClusterVisit in the mission. SiteVisit items are unclustered site visits.
'
items:
oneOf:
- allOf:
- type: object
required:
- type
properties:
type:
type: string
enum:
- clusterVisit
- $ref: '#/components/schemas/ClusterVisit'
- allOf:
- type: object
required:
- type
properties:
type:
type: string
enum:
- siteVisit
- $ref: '#/components/schemas/SiteVisit'
discriminator:
propertyName: type
mapping:
clusterVisit: '#/components/schemas/ClusterVisit'
siteVisit: '#/components/schemas/SiteVisit'
meta:
type: object
required:
- totalSiteCount
properties:
totalSiteCount:
type: integer
description: Total number of sites represented across all items
parameters:
CursorParam:
name: cursor
in: query
schema:
type: string
description: Opaque pagination cursor from a previous response
LimitParam:
name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 200
description: Page size (default 50, max 200)
headers:
XRequestId:
description: Unique request identifier (UUID)
schema:
type: string
format: uuid
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: Cognito JWT access token
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key
description: Organization-scoped API key