billing
POST
https://lucidace.com /v1/auth/referally/webhook Referally delivery receiver. Deliveries for Lucida's own program are logged; nothing is changed.
Code samples
cURL
curl -X POST "https://lucidace.com/v1/auth/referally/webhook"TypeScript
Python
Go
PHP
Ruby
Java
Responses
204
401 bad or stale signature
503 not configured
POST
https://lucidace.com /v1/billing/stripe/webhook Stripe event receiver. Answers 200 for events that are valid but irrelevant (so Stripe stops retrying), 400 for a missing, wrong or stale signature, 503 when no signing secret is set.
Request body
application/json
the raw Stripe event
"string"
Code samples
cURL
curl -X POST "https://lucidace.com/v1/billing/stripe/webhook" \
-H "Content-Type: application/json" \
-d '"string"'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 event handled or ignored
400 bad signature or payload
503 LC_STRIPE_WEBHOOK_SECRET is not set
GET
https://lucidace.com /v1/orgs/{org_id}/billing/alerts Scope adminParameters
org_idstringpathrequiredlimitintegerquerycursorstringqueryCode samples
cURL
curl -X GET "https://lucidace.com/v1/orgs/{org_id}/billing/alerts"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Page of BillingAlert, newest first
Example
{
"data": [
{
"created_at": "2024-01-01T00:00:00Z",
"id": "string",
"kind": "string",
"metric": "string",
"period": "string",
"reference": 0,
"used": 0
}
],
"next_cursor": "string"
}Schema
dataBillingAlert[]requiredShow child parameters
created_atstringrequiredidstringrequiredkindstringrequiredthreshold_80 | threshold_100 | spike.metricstringrequiredperiodstringrequiredMonth start for thresholds, the day for spikes.
referenceintegerrequiredThe limit for thresholds, the trailing daily mean for spikes.
usedintegerrequirednext_cursorstring404
POST
https://lucidace.com /v1/orgs/{org_id}/billing/checkout Scope adminStart a subscription purchase for an org on the Free plan. Owners and admins only. Going back to Free (and changing between paid plans) happens in the billing portal.
Parameters
org_idstringpathrequiredRequest body
application/json
planstringrequiredteam | business{
"plan": "string"
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/orgs/{org_id}/billing/checkout" \
-H "Content-Type: application/json" \
-d '{"plan":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"url": "string"
}Schema
urlstringrequiredOne-time Stripe Checkout URL; send the browser there.
400
403
404
409 the org is not on the Free plan
502
503 Stripe or the plan's price is not configured
GET
https://lucidace.com /v1/orgs/{org_id}/billing/invoices Scope billing:readParameters
org_idstringpathrequiredlimitintegerquerycursorstringqueryCode samples
cURL
curl -X GET "https://lucidace.com/v1/orgs/{org_id}/billing/invoices"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 newest first; empty without a billing customer
Example
{
"data": [
{
"amount_due": 0,
"created": 0,
"currency": "string",
"hosted_url": "string",
"id": "string",
"number": "string",
"pdf_url": "string",
"status": "string"
}
],
"next_cursor": "string"
}Schema
dataobject[]requiredShow child parameters
amount_dueintegerrequiredMinor units (cents).
createdintegerrequiredUnix seconds.
currencystringrequiredhosted_urlstringidstringrequirednumberstringpdf_urlstringstatusstringrequireddraft | open | paid | void | uncollectiblenext_cursorstring403
404
502
POST
https://lucidace.com /v1/orgs/{org_id}/billing/portal-session Scope adminParameters
org_idstringpathrequiredCode samples
cURL
curl -X POST "https://lucidace.com/v1/orgs/{org_id}/billing/portal-session"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"url": "string"
}Schema
urlstringrequiredOne-time provider URL; send the browser there.
403
404 no billing customer, or this deployment has no portal
502
GET
https://lucidace.com /v1/orgs/{org_id}/billing/projection Scope adminParameters
org_idstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/orgs/{org_id}/billing/projection"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
[
{
"limit": 0,
"metric": "string",
"month_to_date": 0,
"projected": 0
}
]Schema
limitintegerEffective monthly limit (plan tightened by spend caps); absent when unlimited.
metricstringrequiredmonth_to_dateintegerrequiredprojectedintegerrequiredMonth-to-date pace extended to the end of the month.
404
GET
https://lucidace.com /v1/orgs/{org_id}/billing/spend-limits Scope adminParameters
org_idstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/orgs/{org_id}/billing/spend-limits"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"limits": [
{
"max_units": 0,
"metric": "string"
}
]
}Schema
limitsSpendLimit[]requiredAt most one cap per metric (
events | replays | flag_requests | ai_calls); monthly units. A cap can only tighten the plan's limits; an empty list removes all caps.Show child parameters
max_unitsintegerrequiredmetricstringrequired403
404
PUT
https://lucidace.com /v1/orgs/{org_id}/billing/spend-limits Scope adminParameters
org_idstringpathrequiredRequest body
application/json
limitsSpendLimit[]requiredAt most one cap per metric (
events | replays | flag_requests | ai_calls); monthly units. A cap can only tighten the plan's limits; an empty list removes all caps.Show child parameters
max_unitsintegerrequiredmetricstringrequired{
"limits": [
{
"max_units": 0,
"metric": "string"
}
]
}Code samples
cURL
curl -X PUT "https://lucidace.com/v1/orgs/{org_id}/billing/spend-limits" \
-H "Content-Type: application/json" \
-d '{"limits":[{"max_units":0,"metric":"string"}]}'TypeScript
Python
Go
PHP
Ruby
Java
PUT
https://lucidace.com /v1/orgs/{org_id}/plan Scope adminChange an org's plan. Instance admins may set any plan with no billing (a comp; refused while a Stripe subscription exists). Owners and admins move between purchasable plans through Stripe: the org needs a customer with a default payment method (see checkout); `free` cancels the subscription now; `enterprise` is sales only.
Parameters
org_idstringpathrequiredRequest body
application/json
planstringrequiredfree | team | business | enterprise{
"plan": "string"
}Code samples
cURL
curl -X PUT "https://lucidace.com/v1/orgs/{org_id}/plan" \
-H "Content-Type: application/json" \
-d '{"plan":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"plan": "string",
"previous": "string"
}Schema
planstringrequiredpreviousstringrequired400
402
no_payment_method: the org has no card on file403 enterprise is sales only
404
409
plan_not_purchasable (billing not configured), or a comp over a Stripe subscription502
Updated