Overview
Campaigns represent aerial data collection requests. Each campaign belongs to your account and is associated with one or more sites. Sites must have a valid boundary geometry before a campaign can be created with them.
GET
/api/v1/campaigns
Requires Auth
List all campaigns for your account.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page |
query | integer | No | Page number (default: 1) |
per_page |
query | integer | No | Items per page (default: 25, max: 100) |
Responses
200
Campaigns list
Response
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "campaign",
"attributes": {
"name": "Q1 Solar Farm Inspection",
"description": "Quarterly thermal and RGB inspection",
"dueAt": "2024-04-15",
"earliestFlightAt": "2024-03-20",
"state": "active",
"clientRequestedPrice": 1500,
"clientName": "Acme Energy",
"companyName": "Acme Corp",
"nearestDueDate": "2024-04-15",
"missionIndustryNames": ["Solar", "Energy"],
"createdAt": "2024-01-10T08:00:00.000Z",
"updatedAt": "2024-03-05T12:30:00.000Z"
}
}
]
}
POST
/api/v1/campaigns
Requires Auth
Create a new campaign. All referenced sites must have a valid boundary geometry.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Campaign name |
description |
string | No | Campaign description |
site_ids |
array<uuid> | Yes | One or more site UUIDs (sites must have geometry) |
due_at |
date | No | Requested due date |
earliest_flight_at |
date | No | Earliest acceptable flight date |
client_requested_price |
integer | No | Requested price in cents |
Request
POST /api/v1/campaigns
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN
{
"name": "Q2 Site Survey",
"description": "RGB mapping of solar installation",
"site_ids": ["b2c3d4e5-f6a7-8901-bcde-f23456789012"],
"due_at": "2024-06-30",
"client_requested_price": 2000
}
Responses
201
Campaign created
422
Validation failed (missing site geometry, invalid site_ids, etc.)
Error: Sites Missing Geometry
{
"error": "All sites must have a valid geometry before creating a campaign",
"sites_missing_geometry": ["b2c3d4e5-f6a7-8901-bcde-f23456789012"]
}
GET
/api/v1/campaigns/{id}
Requires Auth
Retrieve a single campaign with relationships.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | uuid | Yes | Campaign UUID |
Responses
200
Campaign found
Response
{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "campaign",
"attributes": { ... },
"relationships": {
"account": { "data": { "id": "...", "type": "account" } },
"site": { "data": { "id": "...", "type": "site" } },
"missions": { "data": [{ "id": "...", "type": "mission" }] }
}
}
}
404
Campaign not found
Campaign Object
The Campaign object contains the following attributes:
| Attribute | Type | Description |
|---|---|---|
id |
uuid | Unique identifier |
name |
string | Campaign name |
description |
string | Campaign description |
dueAt |
date | Due date for completion |
earliestFlightAt |
date | Earliest acceptable flight date |
state |
string | Current workflow state |
clientRequestedPrice |
integer | Requested price in cents |
clientName |
string | Name of the requesting client |
companyName |
string | Company name |
nearestDueDate |
date | Nearest due date across missions |
missionIndustryNames |
array | Industry tags for this campaign's missions |
createdAt |
datetime | ISO 8601 creation timestamp |
updatedAt |
datetime | ISO 8601 last updated timestamp |