Turqoa Docs

API Reference

The Turqoa REST API provides programmatic access to all platform capabilities, including gate transactions, security events, maritime data, drone operations, and system configuration. All endpoints return JSON and follow consistent conventions.

Base URL

All API requests are made to:

https://api.turqoa.com/v1

For on-premise deployments, replace with your instance URL:

https://turqoa.yourcompany.com/api/v1

Authentication

Every request must include a valid API key or OAuth 2.0 bearer token in the Authorization header:

curl https://api.turqoa.com/v1/events \
  -H "Authorization: Bearer YOUR_API_KEY"

See Authentication for details on API keys, OAuth 2.0, and scoped permissions.

Rate Limits

Rate limits are applied per API key and vary by plan:

PlanRequests/minuteRequests/dayBurst
Standard6050,00010 req/s
Professional300250,00050 req/s
Enterprise1,000Unlimited200 req/s

Rate limit headers are included in every response:

X-RateLimit-Limit: 300
X-RateLimit-Remaining: 287
X-RateLimit-Reset: 1712398800

When rate limited, the API returns 429 Too Many Requests:

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Retry after 12 seconds.",
    "retry_after": 12
  }
}

Response Format

All successful responses follow this structure:

{
  "data": { },
  "meta": {
    "request_id": "req_abc123",
    "timestamp": "2026-04-06T10:00:00Z"
  }
}

Paginated responses include pagination metadata:

{
  "data": [ ],
  "meta": {
    "request_id": "req_abc123",
    "timestamp": "2026-04-06T10:00:00Z"
  },
  "pagination": {
    "page": 1,
    "per_page": 50,
    "total_items": 1234,
    "total_pages": 25,
    "has_next": true,
    "has_previous": false
  }
}

Pagination Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger50Items per page (max 200)
sortstringvariesSort field
orderstringdescSort direction (asc or desc)

Error Handling

Errors follow a consistent structure across all endpoints:

{
  "error": {
    "code": "validation_error",
    "message": "Invalid date format for 'start_date'. Expected ISO 8601.",
    "details": [
      {
        "field": "start_date",
        "message": "Expected format: YYYY-MM-DDTHH:MM:SSZ"
      }
    ],
    "request_id": "req_abc123"
  }
}

HTTP Status Codes

CodeMeaningWhen
200OKSuccessful GET, PUT, PATCH
201CreatedSuccessful POST that creates a resource
204No ContentSuccessful DELETE
400Bad RequestInvalid parameters or request body
401UnauthorizedMissing or invalid authentication
403ForbiddenInsufficient permissions
404Not FoundResource does not exist
409ConflictResource state conflict (e.g., duplicate)
422Unprocessable EntityValid JSON but semantic errors
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error
503Service UnavailableMaintenance or overload

Error Codes

CodeDescription
authentication_requiredNo credentials provided
invalid_tokenToken is malformed or expired
insufficient_scopeToken lacks required permission scope
rate_limit_exceededToo many requests
validation_errorRequest body or parameters are invalid
resource_not_foundRequested resource does not exist
resource_conflictResource already exists or state conflict
internal_errorUnexpected server-side error

Available Endpoints

Gate Transactions

MethodEndpointDescription
GET/transactionsList gate transactions
GET/transactions/:idGet transaction details
POST/transactions/:id/overrideOverride a transaction decision

See Gate Transactions.

Events

MethodEndpointDescription
GET/eventsList security events
WebSocket/events/streamReal-time event stream

See Events.

Webhooks

MethodEndpointDescription
GET/webhooksList configured webhooks
POST/webhooksCreate a webhook
PUT/webhooks/:idUpdate a webhook
DELETE/webhooks/:idDelete a webhook

See Webhooks.

Maritime

MethodEndpointDescription
GET/maritime/vesselsList tracked vessels
GET/maritime/vessels/:mmsiGet vessel details and risk score
GET/maritime/zonesList threat zones
POST/maritime/zonesCreate a threat zone
GET/maritime/zones/:id/dwellGet dwell time data for a zone

Drone Operations

MethodEndpointDescription
GET/dronesList fleet status
POST/drones/missionsCreate a mission
GET/drones/missions/:idGet mission status
POST/drones/missions/:id/abortAbort a mission

System

MethodEndpointDescription
GET/system/healthSystem health status
GET/system/configCurrent configuration
POST/decision-engine/stopEmergency stop
POST/decision-engine/startRestart engine

SDKs

Official SDKs are available for:

LanguagePackageInstall
Pythonturqoapip install turqoa
Node.js@turqoa/sdknpm install @turqoa/sdk
Gogithub.com/turqoa/go-sdkgo get github.com/turqoa/go-sdk
from turqoa import TurqoaClient

client = TurqoaClient(api_key="your_api_key")
events = client.events.list(severity="high", limit=10)
import { TurqoaClient } from "@turqoa/sdk";

const client = new TurqoaClient({ apiKey: "your_api_key" });
const events = await client.events.list({ severity: "high", limit: 10 });