API
Run any Pipeloom tool over HTTP, with an OpenAPI document to generate a client from.
The API has two routes, one to list tools and one to run a tool. Its base URL is
https://api.getpipeloom.com.
Signing in
For CI and scripts, an organization admin makes a service account in Organization settings → Service accounts. It belongs to the organization rather than to a person, so it keeps working when someone leaves. Keep its id and secret in your own secret store, and trade them for a token that lasts a few minutes:
curl -s https://api.getpipeloom.com/api/v1/service_accounts/token \
-H 'content-type: application/json' \
-d "{\"service_account_id\": \"$PIPELOOM_SERVICE_ACCOUNT_ID\", \"secret\": \"$PIPELOOM_SERVICE_ACCOUNT_SECRET\"}"A service account has one organization role, which reaches every workspace in the organization:
- reader sees everything and changes nothing;
- runner also runs syncs and pipelines;
- editor also builds and changes them.
It is never an admin, and it can't make or manage service accounts. Settings → Access and protected environments apply to it as they do to a person.
An Application works too. Make one in Settings → Applications and trade its secret the same way:
curl -s https://api.getpipeloom.com/api/v1/applications/token \
-H 'content-type: application/json' \
-d "{\"client_id\": \"$PIPELOOM_CLIENT_ID\", \"client_secret\": \"$PIPELOOM_CLIENT_SECRET\"}"An Application acts as the person who made it.
Send the token as Authorization: Bearer <token> on every call, and get a new one when it runs out.
Listing the tools
GET /v1/tools lists every tool: its name, what it does, its input as JSON Schema, whether it only
reads, and whether it needs confirming. It needs no sign-in.
GET /v1/openapi.json is the same list as an OpenAPI 3.1 document, with one operation per tool,
to generate a client from.
Running a tool
POST /v1/workspaces/{workspaceId}/tools/{name}
Content-Type: application/json
Authorization: Bearer <token>
{ "input": { "limit": 5 } }| Answer | Means |
|---|---|
200 { ok: true, tool, summary, result } | Done. result is the tool's answer, as JSON. |
409 { code: "confirmation-required", summary, confirmToken, expiresAt } | Nothing changed yet. Send the same call again with "confirmToken" beside "input" to do it. |
422 { ok: false, tool, summary, error } | The tool refused or failed, and error says why. |
401 | The token is missing or has run out. |
402 | The organization's plan doesn't include this. Tools that only read keep working. |
403 | Your role doesn't allow it in this environment. |
429 | Too many calls. Wait for the Retry-After seconds. |
For example, to delete a source:
# 1. Changes nothing; answers 409 with what it would do and a confirmToken.
curl -s -X POST "$API/v1/workspaces/$WS/tools/delete_connector" \
-H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
-d '{"input": {"kind": "source", "id": "…"}}'
# 2. The same call with the token deletes it.
curl -s -X POST "$API/v1/workspaces/$WS/tools/delete_connector" \
-H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
-d '{"input": {"kind": "source", "id": "…"}, "confirmToken": "…"}'Secrets
Never put a password in input. Give {"secretRef": "NAME"} for a secret stored in the workspace,
and Pipeloom fills the value in. To store one, use the CLI's pipeloom secrets set, or
request_secret to get a link someone can type it into.