Browse documentation

Integrations

Activepieces

Read your AI-coding spend, savings, allowance and cost alerts from an Activepieces flow, on Activepieces Cloud or a self-hosted instance.

The Lineman piece is built but not yet published. Until it is, Activepieces' built-in HTTP piece calls the Lineman API directly, which is what the steps below use. Nothing on this page depends on the Lineman piece being available.

Two things that catch people out

  • Lineman will not be in the built-in piece list. When it ships it will be installed from Settings → My Pieces → Install Piece by package name, the same as any other community piece. Searching the standard list and finding nothing is not a sign that it is missing.
  • Paste the API key on its own. The word Bearer and a space go in front of it in the header, not inside the key. Typing it into the key produces a failure that reads like a rejected key rather than a mis-paste, so the usual next move is to create a second key that fails in exactly the same way.

Set it up

  1. 1In Lineman, go to Dashboard → Keys and create an API key, then copy it. It starts with fa_live_.
  2. 2In Activepieces, add the HTTP piece to a flow and choose Send HTTP Request. Set the method to GET and the URL to the report you want, for example https://api.lineman.io/v1/spend/summary?days=30.
  3. 3Add a header named Authorization with the value Bearer, a space, and your key. Store the key as a connection or a project variable rather than typing it into each step.
  4. 4Run the step once. The response becomes structured output the rest of the flow can read field by field.

What you can read

  • Fourteen reports, all read-only. Spend, savings, allowance, alerts, members and cost centres. Nothing reachable this way changes a budget, dismisses an alert or edits a cost centre, so a misconfigured flow costs you a wasted call rather than a changed setting.
  • The same reports either way. The Lineman piece, when it ships, calls exactly the endpoints the HTTP piece above calls. It saves you writing the URL and the header by hand and it checks the key when you connect it; it does not unlock anything extra.

What the key can see

A flow can do only what the person who created the key can do in Lineman. Their role, not the flow, decides what comes back:

  • Administrator - company-wide figures, across every member and repository.
  • Auditor - the same company-wide figures.
  • Everyone else - their own spend and savings only.

Four reports fail rather than narrow. Alerts, company, members and cost centres return an error to a key that is not an administrator's or an auditor's, instead of quietly shrinking to one person's figures. A narrowed number in a finance report is worse than a flow that stops. Every other report tells you which you got in its scope field.

Reading the numbers

  • Every amount comes back twice. One field ends in _usd and is meant for display; the other ends in _micro and is a whole number of millionths of a dollar, meant for arithmetic. Add up the _micro field and convert once at the end, because summing display values across a long list drifts as the rounding accumulates. Lineman never returns cents.
  • Two fields are text that contains JSON. An alert's detail and a cost centre's rules arrive as a string, because their contents differ from row to row. Parse those two before reading inside them.
  • Spend takes days, savings takes a month. Spend reports accept a days value from 1 to 92 and use 7 if you leave it out. Savings reports take a calendar month written as YYYY-MM instead. Anything longer than 92 days is refused rather than quietly truncated, so a bigger export has to be fetched in chunks.

Self-hosted instances

If your instance runs with AP_NETWORK_MODE=STRICT, outbound calls are routed through a proxy that has to allow api.lineman.io before any of this works. The symptom is a step that times out with nothing else to explain it, so it is worth ruling out first rather than last.