Agent/API quickstart
Create a scoped token and make a safe read request against Agent/API v1.
The Agent/API lets an external client read bounded data from one workspace and prepare governed create/update proposals. It does not provide an embedded chat assistant, and an agent token can never approve its own proposal.
Before you begin
You need:
- a verified RecurLens account;
- access to the target workspace;
- its workspace ID; and
- an Agent/API token with the required scope.
The active workspace ID is present in authenticated workspace API requests. In
your browser's developer tools, open Network, reload RecurLens, and copy the
UUID after /api/v1/workspaces/ from a workspace request.
1. Create a read-only token
- In RecurLens, switch to the workspace the client should access.
- Open Settings → Agent tokens (beta).
- Enter a descriptive token name.
- Keep only Read subscriptions selected for this quickstart.
- Choose an expiry (maximum 90 days), then create the token.
- Copy the
rlat_v1.<lookup>.<secret>token immediately. RecurLens shows it only once.
Treat the token like a password: do not commit it, log it, place it in a URL, or paste it into a shared conversation. Revoke it from Settings when no longer needed.
Token boundary
A token is bound to the user and workspace that created it. A workspace UUID from another workspace does not broaden its access.
2. Configure your shell
export RECURLENS_API_URL="https://api.recurlens.com/api/v1"
export WORKSPACE_ID="00000000-0000-0000-0000-000000000001"
export AGENT_TOKEN="rlat_v1.REPLACE_LOOKUP.REPLACE_SECRET"These values are placeholders. Keep real credentials in your local secret store.
3. Make the first read call
Every read tool is a POST with a JSON body:
curl --fail-with-body --silent --show-error \
--request POST \
"$RECURLENS_API_URL/workspaces/$WORKSPACE_ID/agent-tools/list_subscriptions" \
--header "Authorization: Bearer $AGENT_TOKEN" \
--header "Content-Type: application/json" \
--data '{"limit": 20, "sortBy": "renewalDate", "sortDirection": "asc"}'A successful response uses the stable envelope:
{
"success": true,
"requestId": "...",
"data": [],
"meta": {
"apiVersion": "v1",
"timezone": "UTC",
"hasMore": false,
"nextCursor": null
},
"error": null
}Use meta.nextCursor verbatim when meta.hasMore is true. Cursors are opaque;
do not decode, construct, or reuse them across endpoints.
Save the requestId when reporting a failure. It correlates the response with
server-side diagnostics without exposing your token.
Available read tools
| Tool | Purpose |
|---|---|
list_subscriptions | Filtered, sorted active subscriptions |
upcoming_renewals | Active renewals in a bounded day window |
summarize_recurring_spend | Monthly/annual estimates, separated by currency |
find_duplicate_spend | Deterministic same-name/same-currency candidates |
budget_status | Workspace/category status or explicit not_configured |
Governed writes
Tokens may separately receive subscriptions:create and
subscriptions:update. Those tools require a 16–128 character
Idempotency-Key and return a pending proposal with an approval URL. They do
not write immediately.
The same signed-in user to whom the originating token is bound reviews the proposal in RecurLens and must still have workspace write access. On confirmation, the server rechecks user access, token quota, validation, and (for updates) the expected record version, then executes at most once. Delete, archive, status change, cancellation, and purchasing are not Agent/API tools.
Errors and safe retries
Only retry when error.retryable is true, honoring retryAfterSeconds.
Validation, access, proposal, idempotency, and version errors require a changed
request. GLOBAL_CAP_REACHED is a structural halt even though it uses HTTP 503;
stop and investigate rather than retrying.
| Symptom | Check first |
|---|---|
| HTTP 401 | Token is copied exactly, unexpired, and unrevoked |
| HTTP 403 | Token scope and workspace ID match the operation |
| HTTP 400 | JSON fields, date formats, and limits match v1 |
hasMore is true | Send the returned nextCursor unchanged |
| Proposal cannot be confirmed | Bound user, write access, expiry, and version |
For more diagnosis steps, see Troubleshooting.
See the complete API reference for request and response schemas.