API Documentation
Complete reference for the Terminal Control API
Authentication
Terminal Control uses API keys to authenticate requests. You can create and manage API keys from your dashboard settings.
API Key Format
tc_live_sk_1234567890abcdef1234567890abcdefKeys start with tc_live_sk_ for production or tc_test_sk_ for sandbox environments.
Making Requests
Include your API key in the Authorization header:
curl -X GET "http://localhost:3000/api/terminals" \ -H "Authorization: Bearer tc_live_sk_your_key_here" \ -H "Content-Type: application/json"
Rate Limits
API requests are rate limited based on your subscription plan. Rate limit information is included in response headers.
| Plan | Requests/Minute |
|---|---|
| Free | 100 |
| Starter | 500 |
| Professional | 2,000 |
| Enterprise | 10,000 |
Response Headers
X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 950 X-RateLimit-Reset: 1609459200
Error Handling
The API uses standard HTTP status codes and returns JSON error responses.
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
Terminals
Manage Starlink terminals in your organization.
/api/terminalsList all terminals for your organization
Required scope: read:terminals
/api/terminalsCreate a new terminal
Required scope: write:terminals
/api/terminals/:idGet a specific terminal by ID
Required scope: read:terminals
Customers
Manage customer records and their associated terminals.
/api/customersList all customers
Required scope: read:customers
/api/customersCreate a new customer
Required scope: write:customers
Webhooks
Receive real-time notifications when events occur in your organization.
Available Events
terminal.created- New terminal addedterminal.updated- Terminal details changedterminal.status_changed- Terminal status changedcustomer.created- New customer addedpayment.created- Payment recordedimport.completed- Bulk import finished
Verifying Signatures
Each webhook includes an HMAC-SHA256 signature in the X-Webhook-Signature header.
import { createHmac } from "crypto";
function verifySignature(
payload: string,
signature: string,
secret: string
): boolean {
const expected = createHmac("sha256", secret)
.update(payload)
.digest("hex");
const provided = signature.replace("sha256=", "");
return expected === provided;
}