Overview
Greene Comply sits ahead of your payment rails. Before your agent spends, it calls our API. We approve, deny, or hold the request against the policy you set. Your rail only executes what we approve.
Base URL: https://api.greenecomply.com/v1
All responses are JSON. All timestamps are ISO 8601. All amounts are in the smallest currency unit (cents for USD).
Authentication
All requests require a Bearer token in the Authorization header. Tokens are scoped per agent and generated from the dashboard or via API.
Authorization: Bearer gc_live_xxxxxxxxxxxx
Tokens are stored as SHA-256 hashes server-side. We never store the raw token. Sandbox tokens begin with gc_test_, live tokens begin with gc_live_.
Agents
Manage the agents that can authorize spend on your account.
/v1/agentsRegister a new agent/v1/agentsList all agents (paginated)/v1/agents/:idRetrieve a single agent/v1/agents/:idUpdate agent/v1/agents/:idDeactivate agentAgent object
idstringStable identifier. Begins with "agt_".namestringHuman-readable label shown in the dashboard.policy_idstringPolicy currently bound to this agent.status"active" | "frozen" | "deactivated"Authorization availability.kyc_statusstringIdentity verification state for the human owner.created_atISO 8601When the agent was registered.metadataobjectArbitrary key-value pairs you set on create or update.Register an agent
POST /v1/agents
Authorization: Bearer $GREENE_API_KEY
Content-Type: application/json
{
"name": "Research crawler",
"policy_id": "pol_default_compute",
"metadata": { "team": "growth" }
}
# 201 Created
{
"id": "agt_8f2k9d",
"name": "Research crawler",
"policy_id": "pol_default_compute",
"status": "active",
"kyc_status": "pending",
"created_at": "2026-05-05T14:18:02.044Z",
"metadata": { "team": "growth" }
}List agents
GET /v1/agents?limit=20
Authorization: Bearer $GREENE_API_KEY
# 200 OK
{
"data": [
{
"id": "agt_8f2k9d",
"name": "Research crawler",
"policy_id": "pol_default_compute",
"status": "active",
"kyc_status": "verified",
"created_at": "2026-05-05T14:18:02.044Z",
"metadata": { "team": "growth" }
}
],
"has_more": false,
"next_cursor": null
}Policies
Policies are the rules every authorization is checked against. Bind one policy to one or many agents.
/v1/policiesCreate policy/v1/policiesList policies/v1/policies/:idRetrieve policy/v1/policies/:idUpdate policy/v1/policies/:idDelete policyPolicy object
namestringDisplay name for the policy.budget_monthlynumberCents. Rolling monthly cap across all approved spend.budget_single_maxnumberCents. Hard ceiling on a single transaction.vendor_allowliststring[]Vendors permitted without further checks.vendor_denyliststring[]Vendors that always deny, regardless of amount.require_approval_abovenumberCents. Holds for human review above this amount.categories_allowedstring[]Spend categories permitted by this policy.activebooleanInactive policies are skipped at evaluation.Audit Logs
Returns paginated append-only records. Every authorization decision, freeze, override, and approval is captured.
Query parameters
agent_idstringFilter by agent.decision"approved" | "denied" | "held"Filter by outcome.fromISO 8601Lower-bound timestamp (inclusive).toISO 8601Upper-bound timestamp (exclusive).limitnumberMax 100. Default 50.cursorstringPagination cursor returned by the previous response.Export: pass Accept: text/csv for CSV export or Accept: application/json for JSON (default).
Webhooks
Greene Comply emits signed webhook events for key state changes. Configure delivery URLs in the dashboard or via API.
Events
authorize.approvedA POST /v1/authorize call returned approved.authorize.deniedA POST /v1/authorize call returned denied.authorize.heldA request requires human approval and is queued.agent.frozenAn agent has been frozen — no further spend possible.approval.completedA held request has been resolved (approved or denied).Payload shape
{
"event": "authorize.denied",
"data": { /* event-specific payload */ },
"timestamp": "2025-05-01T12:00:00Z",
"signature": "sha256=..."
}Verify signatures (Node.js)
Verify signatures using HMAC-SHA256 with your webhook secret. Always read the raw request body — JSON re-serialization will invalidate the signature.
import crypto from 'node:crypto'
export function verifyGreeneSignature(
rawBody: string,
signatureHeader: string, // value of "X-Greene-Signature"
secret: string,
): boolean {
// Header format: "sha256=<hex>"
const expected = signatureHeader.replace(/^sha256=/, '')
const computed = crypto
.createHmac('sha256', secret)
.update(rawBody, 'utf8')
.digest('hex')
// Timing-safe comparison guards against signature-extraction side channels.
return (
expected.length === computed.length &&
crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(computed))
)
}Errors
Error responses follow a consistent shape. The HTTP status reflects the class of error; the code field is the precise machine-readable cause.
{
"error": {
"code": "budget_exceeded",
"message": "Monthly budget limit reached for this agent.",
"param": "amount"
}
}Error codes
unauthorizedMissing or invalid bearer token.policy_deniedA policy rule rejected the request.agent_frozenThe agent is frozen and cannot transact.budget_exceededMonthly cap or single-transaction max reached.invalid_requestA required field is missing or malformed.rate_limitedToo many requests for this plan in the current window.not_foundThe referenced resource does not exist.Rate Limits
| Plan | Limit |
|---|---|
| Sandbox | 100 req/min |
| Starter | 500 req/min |
| Growth | 2,000 req/min |
| Enterprise | Custom |
Headers returned on every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
On 429, retry after the value in X-RateLimit-Reset.
API Pricing
Usage is tracked via Stripe Billing Meters. Every successful call to POST /v1/authorize counts as one authorization check. Stripe aggregates usage across the month and invoices on your billing cycle. Only HTTP 200 responses are counted — errors, 4xx, and sandbox calls are never billed.
| Plan | Included checks/mo | Overage rate |
|---|---|---|
| Sandbox | Unlimited | Free forever |
| Starter | 10,000 | $0.0015 per check |
| Growth | 100,000 | $0.0008 per check |
| Enterprise | Custom | Volume pricing |