Flexi Billing
Flexi Billing Service exposes internal, service-to-service-only operations for the flexi billing V3 pipeline: sanity reads of the ledger-reconstructed billable units, the flexi_billing_events_daily_runs rows, and the billable Ansible hosts for a day, plus replaying discovery, delivery, or Ansible host billing for a day.
Returns the hosts Ansible host billing sends as IACM_ACTIVE_HOSTS for the given date: one row per host active in ansible_usage over the 30 days ending on it, with the deterministic id its event carries. Optionally scoped to a single account. The date must be a completed UTC day (before today). total_count is the full host count for the day regardless of limit.
UTC calendar day to act on, in YYYY-MM-DD format; resolved to 00:00 UTC of that date. Must be a completed UTC day (before today).
2026-09-27Optional account identifier; empty means all accounts.
fbmOptional maximum number of rows to return; absent or <= 0 returns all rows for the day. total_count is always the full count, independent of limit.
8387776355325926000OK response.
Ansible hosts billed from ansible_usage for a day
Account the read targeted; empty means all accounts
Praesentium error sunt cupiditate molestiae tempora facere.Number of rows returned (after any limit)
876811326205003100Requested day
Provident provident quas vel quos eum est.Resolved 00:00 UTC Unix seconds for the date
5997227889072194000Full number of billable hosts for the day (and account), independent of limit
8650659163089397000BadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
GET /api/flexi-billing/ansible-host-ledger?date=2026-09-27 HTTP/1.1
Host: localhost:80
Accept: */*
{
"account": "Rerum enim repellendus quaerat aliquid doloribus quidem.",
"count": 196313460938978720,
"date": "Ipsa ex voluptatem et vel.",
"epoch_day": 749145043679963800,
"rows": [
{
"account": "Doloribus quisquam.",
"host_address": "Laborum repellendus officiis.",
"id": "Nulla magni quisquam voluptatum.",
"last_activity": 6471904228986153000,
"org": "Dicta sed autem rerum excepturi.",
"parent_unique_id": "Excepturi facilis labore nihil deleniti.",
"project": "Qui dolorem earum vel tenetur odit beatae."
},
{
"account": "Doloribus quisquam.",
"host_address": "Laborum repellendus officiis.",
"id": "Nulla magni quisquam voluptatum.",
"last_activity": 6471904228986153000,
"org": "Dicta sed autem rerum excepturi.",
"parent_unique_id": "Excepturi facilis labore nihil deleniti.",
"project": "Qui dolorem earum vel tenetur odit beatae."
}
],
"total_count": 8514714005029311000
}Enqueues IACM_ACTIVE_HOSTS billing for one account, or the Ansible host scheduler fan-out for all accounts, re-sending one Kafka event per host active in ansible_usage over the 30 days ending on the given date. The date must be a completed UTC day (before today). Idempotent: events carry deterministic idempotency keys, so UDP deduplicates hosts already delivered.
Optional account identifier; empty means all accounts.
r1jUTC calendar day to act on, in YYYY-MM-DD format; resolved to 00:00 UTC of that date. Must be a completed UTC day (before today).
2026-09-27When an identical job is already queued (e.g. waiting out a retry), make it run immediately instead of leaving it.
falseExample: falseAccepted response.
Result of a flexi billing trigger
Account the trigger targeted; empty means all accounts
Cum deleniti et itaque consectetur modi.Requested day
Voluptas eos omnis aut.Resolved 00:00 UTC Unix seconds for the date
4527392274086356000River job acted on
2298437543349237800State of the River job after the trigger
availableHuman-readable summary
Iste iste est eaque suscipit aut voluptate.What happened to the job
enqueuedPossible values: BadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
POST /api/flexi-billing/ansible-hosts HTTP/1.1
Host: localhost:80
Content-Type: application/json
Accept: */*
Content-Length: 51
{
"account": "tfd",
"date": "2026-09-27",
"force": false
}{
"account": "Sed repellendus accusamus ullam.",
"date": "Voluptatum dolor.",
"epoch_day": 7981891377293283000,
"job_id": 5714267073566024000,
"job_state": "available",
"message": "Quae quo aut iure.",
"outcome": "enqueued"
}Reconstructs the billable units from workspace_history as of the end of the given date (UTC) and returns them (the rows discovery would write). Optionally scoped to a single account. total_count is the full unit count for the day regardless of limit.
UTC calendar day to act on, in YYYY-MM-DD format; resolved to 00:00 UTC of that date. Must be a completed UTC day (before today).
2026-09-27Optional account identifier; empty means all accounts.
wl5Optional maximum number of rows to return; absent or <= 0 returns all rows for the day. total_count is always the full count, independent of limit.
5386115898750387000OK response.
Billable units reconstructed from the ledger for a day
Account the read targeted; empty means all accounts
Corporis alias natus nemo quae repudiandae et.Number of rows returned (after any limit)
3731472243908707300Requested day
Earum provident.Resolved 00:00 UTC Unix seconds for the date
4289444166704150000Full number of billable units for the day (and account), independent of limit
3163907324095765500BadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
GET /api/flexi-billing/billing-ledger?date=2026-09-27 HTTP/1.1
Host: localhost:80
Accept: */*
{
"account": "Quis tenetur necessitatibus vero a veritatis.",
"count": 2872496400759357400,
"date": "Qui modi.",
"epoch_day": 8720432632602405000,
"rows": [
{
"account": "Quia vel id.",
"id": "Aspernatur vero similique quod molestiae.",
"org": "Sed cumque modi voluptatibus perferendis accusantium unde.",
"project": "Occaecati dolor qui fuga sed.",
"provisioner": "Est a in commodi.",
"provisioner_version": "Enim vel aut esse alias.",
"terragrunt_provider": true,
"unique_key": "Ipsum voluptate nesciunt consequuntur.",
"workspace_id": "Quo quasi exercitationem nam esse quidem ipsam.",
"workspace_name": "Accusamus officia ipsa."
},
{
"account": "Quia vel id.",
"id": "Aspernatur vero similique quod molestiae.",
"org": "Sed cumque modi voluptatibus perferendis accusantium unde.",
"project": "Occaecati dolor qui fuga sed.",
"provisioner": "Est a in commodi.",
"provisioner_version": "Enim vel aut esse alias.",
"terragrunt_provider": true,
"unique_key": "Ipsum voluptate nesciunt consequuntur.",
"workspace_id": "Quo quasi exercitationem nam esse quidem ipsam.",
"workspace_name": "Accusamus officia ipsa."
},
{
"account": "Quia vel id.",
"id": "Aspernatur vero similique quod molestiae.",
"org": "Sed cumque modi voluptatibus perferendis accusantium unde.",
"project": "Occaecati dolor qui fuga sed.",
"provisioner": "Est a in commodi.",
"provisioner_version": "Enim vel aut esse alias.",
"terragrunt_provider": true,
"unique_key": "Ipsum voluptate nesciunt consequuntur.",
"workspace_id": "Quo quasi exercitationem nam esse quidem ipsam.",
"workspace_name": "Accusamus officia ipsa."
}
],
"total_count": 3950380147033872000
}Returns the flexi_billing_events_daily_runs rows for the given date (epoch_day), optionally scoped to a single account. A day with no rows returns total_count 0 and an empty list. total_count is the full row count for the day regardless of limit.
UTC calendar day to act on, in YYYY-MM-DD format; resolved to 00:00 UTC of that date. Must be a completed UTC day (before today).
2026-09-27Optional account identifier; empty means all accounts.
hk0Optional maximum number of rows to return; absent or <= 0 returns all rows for the day. total_count is always the full count, independent of limit.
2904822671541610500OK response.
flexi_billing_events_daily_runs rows for a day
Account the read targeted; empty means all accounts
Libero voluptatem inventore provident exercitationem ad.Number of rows returned (after any limit)
1555165120474850000Requested day
Blanditiis rem.Resolved 00:00 UTC Unix seconds for the date
6728136257324208000Full number of rows for the day (and account), independent of limit
276886844279661470BadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
GET /api/flexi-billing/daily-runs?date=2026-09-27 HTTP/1.1
Host: localhost:80
Accept: */*
{
"account": "Aliquid nisi eveniet suscipit deserunt exercitationem sit.",
"count": 426612369567945600,
"date": "Consequuntur dolores.",
"epoch_day": 687765621944930700,
"rows": [
{
"account": "Consectetur ipsum.",
"created": 6340797790707285000,
"epoch_day": 5218527181147283000,
"id": "Ut quae sit.",
"org": "Sequi sit earum.",
"parent_unique_id": "Eum omnis explicabo.",
"project": "Eos similique.",
"provisioner": "Id rem illum accusantium ut voluptate nisi.",
"provisioner_version": "Placeat quidem velit explicabo.",
"status": "success",
"terragrunt_provider": true,
"unique_key": "Numquam animi molestias vero praesentium sed.",
"updated": 7534090311425261000,
"workspace_id": "Dignissimos et beatae perferendis odio sint repudiandae.",
"workspace_name": "Odit hic porro enim nostrum nostrum molestiae."
},
{
"account": "Consectetur ipsum.",
"created": 6340797790707285000,
"epoch_day": 5218527181147283000,
"id": "Ut quae sit.",
"org": "Sequi sit earum.",
"parent_unique_id": "Eum omnis explicabo.",
"project": "Eos similique.",
"provisioner": "Id rem illum accusantium ut voluptate nisi.",
"provisioner_version": "Placeat quidem velit explicabo.",
"status": "success",
"terragrunt_provider": true,
"unique_key": "Numquam animi molestias vero praesentium sed.",
"updated": 7534090311425261000,
"workspace_id": "Dignissimos et beatae perferendis odio sint repudiandae.",
"workspace_name": "Odit hic porro enim nostrum nostrum molestiae."
},
{
"account": "Consectetur ipsum.",
"created": 6340797790707285000,
"epoch_day": 5218527181147283000,
"id": "Ut quae sit.",
"org": "Sequi sit earum.",
"parent_unique_id": "Eum omnis explicabo.",
"project": "Eos similique.",
"provisioner": "Id rem illum accusantium ut voluptate nisi.",
"provisioner_version": "Placeat quidem velit explicabo.",
"status": "success",
"terragrunt_provider": true,
"unique_key": "Numquam animi molestias vero praesentium sed.",
"updated": 7534090311425261000,
"workspace_id": "Dignissimos et beatae perferendis odio sint repudiandae.",
"workspace_name": "Odit hic porro enim nostrum nostrum molestiae."
}
],
"total_count": 3342918160465369000
}Enqueues Kafka delivery for one account, or the delivery sweep for all accounts. Delivery drains every open or failed row for an account regardless of day; date is validated but not used as a filter.
Optional account identifier; empty means all accounts.
7lsUTC calendar day to act on, in YYYY-MM-DD format; resolved to 00:00 UTC of that date. Must be a completed UTC day (before today).
2026-09-27When an identical job is already queued (e.g. waiting out a retry), make it run immediately instead of leaving it.
falseExample: trueAccepted response.
Result of a flexi billing trigger
Account the trigger targeted; empty means all accounts
Cum deleniti et itaque consectetur modi.Requested day
Voluptas eos omnis aut.Resolved 00:00 UTC Unix seconds for the date
4527392274086356000River job acted on
2298437543349237800State of the River job after the trigger
availableHuman-readable summary
Iste iste est eaque suscipit aut voluptate.What happened to the job
enqueuedPossible values: BadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
POST /api/flexi-billing/delivery HTTP/1.1
Host: localhost:80
Content-Type: application/json
Accept: */*
Content-Length: 50
{
"account": "7ap",
"date": "2026-09-27",
"force": true
}{
"account": "Nihil blanditiis dolor dolor numquam consequuntur.",
"date": "Eos blanditiis cum suscipit dolorem mollitia.",
"epoch_day": 8687879576004123000,
"job_id": 916622191622871700,
"job_state": "available",
"message": "Quidem molestiae ducimus amet.",
"outcome": "enqueued"
}Enqueues discovery for one account, or the scheduler fan-out for all accounts, rebuilding flexi_billing_events_daily_runs from workspace_history as of the end of the given date (UTC). The date must be a completed UTC day (before today). Idempotent: delivered rows are preserved and missing rows are filled in.
Optional account identifier; empty means all accounts.
vuyUTC calendar day to act on, in YYYY-MM-DD format; resolved to 00:00 UTC of that date. Must be a completed UTC day (before today).
2026-09-27When an identical job is already queued (e.g. waiting out a retry), make it run immediately instead of leaving it.
falseExample: trueAccepted response.
Result of a flexi billing trigger
Account the trigger targeted; empty means all accounts
Cum deleniti et itaque consectetur modi.Requested day
Voluptas eos omnis aut.Resolved 00:00 UTC Unix seconds for the date
4527392274086356000River job acted on
2298437543349237800State of the River job after the trigger
availableHuman-readable summary
Iste iste est eaque suscipit aut voluptate.What happened to the job
enqueuedPossible values: BadRequestError: Bad Request response.
UnauthorizedError: Unauthorized response.
ForbiddenError: Forbidden response.
NotFoundError: Not Found response.
TimeoutError: Request Timeout response.
ConflictError: Conflict response.
LockedError: Locked response.
ContextCancelledError: response.
InternalServerError: Internal Server Error response.
BadGatewayError: Bad Gateway response.
POST /api/flexi-billing/discovery HTTP/1.1
Host: localhost:80
Content-Type: application/json
Accept: */*
Content-Length: 50
{
"account": "d42",
"date": "2026-09-27",
"force": true
}{
"account": "Et et.",
"date": "Sit eaque id alias blanditiis impedit rerum.",
"epoch_day": 3146444344596864500,
"job_id": 5306704197148801000,
"job_state": "available",
"message": "Mollitia ab debitis veritatis commodi.",
"outcome": "enqueued"
}Last updated
Was this helpful?