Create a new revenue record
Create a new revenue record for the authenticated developer.
POST
/v1/revenuesAuthorizationBearer <token>
In: header
Header Parameters
x-idempotency-key?string
Unique idempotency key to prevent duplicate revenue records
amountstring
Revenue amount (decimal string, e.g., "99.99") in USD
agentKey?string
Agent key associated with this revenue
customerKey?string
Customer key associated with this revenue
description?string
Description of the revenue record
recordedAtstring
Timestamp when the revenue was recorded (ISO 8601)
Response Body
application/json
curl -X POST "https://api.getlens.ai/v1/revenues" \ -H "Content-Type: application/json" \ -d '{ "amount": "99.99", "recordedAt": "2024-01-15T10:30:00.000Z" }'{
"id": "RZJZTK6owKxeMELu3cGWWc",
"key": "revenue-2024-01-001",
"amount": "99.99",
"source": "Manual",
"agentKey": "support-agent",
"customerKey": "customer-abc",
"goalId": "MNOPQR123456789012345678",
"description": "Payment received for service",
"recordedAt": "2024-01-15T10:30:00.000Z",
"createdAt": "2024-01-15T10:30:00.000Z"
}