API quickstart
List sessions in a factory and fetch one by ID with a read-only machine token.
You’ll need a shell with curl and a factory manager who can issue tokens on your Wallie instance.
Create a read-only machine token
Ask a factory manager to complete these steps in Governance:
- Select the factory. Under Service principals, choose New service principal, enter a name for your integration, then choose Create service principal.
- On the principal’s page, select the intended Writable repository, the Execution policy, a Budget payer, and a future expiry. Under Machine command scopes, select only Read sessions and choose Approve grant.
- Open the approved grant and go to Machine tokens. Enter a Token name, select only Read sessions, then choose Create machine token and Copy token. The credential is shown once.
Set Expires at (optional) before creating the token if it should expire before the grant. Access ends when the grant expires, changes version, or is revoked. Use Revoke token in the grant’s token list if the credential is exposed or no longer needed.
Set your shell environment
Ask your manager for the canonical workspace and factory UUIDs for the grant. Replace the examples below with those UUIDs. Slugs and GitHub repository IDs won’t work.
export WALLIE_WORKSPACE_ID=11111111-1111-4111-8111-111111111111
export WALLIE_FACTORY_ID=22222222-2222-4222-8222-222222222222Load the credential into WALLIE_API_TOKEN from your secret store or private environment. Keep it out of source, shell history, and logs, and run these commands with shell tracing off.
The commands default to https://www.wallie.dev. For a self-hosted instance that supports the Factory API, set WALLIE_API_ORIGIN to its trusted HTTPS origin, such as https://wallie.example.com, without a trailing slash.
List sessions
Request up to one session from the granted repository. The command sends the token in the Authorization: Bearer header.
BASE="${WALLIE_API_ORIGIN:-https://www.wallie.dev}/api/v1"
BASE="$BASE/workspaces/$WALLIE_WORKSPACE_ID/factories/$WALLIE_FACTORY_ID"
printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN" |
curl -q -fsS --proto '=https' --header @- "$BASE/sessions?limit=1"Example HTTP 200 response, with some fields omitted:
{
"items": [
{
"id": "33333333-3333-4333-8333-333333333333",
"number": 12,
"title": "Review release notes",
"status": "approved"
}
],
"nextCursor": null
}An empty page, {"items":[],"nextCursor":null}, is also a success. It means no sessions are visible to this grant. If you expected one, check which repository the grant covers.
Fetch that session
If the list returned a session, copy its items[0].id UUID and replace the example below. Don’t use the display number. Run this in the same shell; the response is the session object itself.
SESSION_ID=33333333-3333-4333-8333-333333333333
printf 'Authorization: Bearer %s\n' "$WALLIE_API_TOKEN" |
curl -q -fsS --proto '=https' --header @- "$BASE/sessions/$SESSION_ID"If access is denied
- 401 Unauthorized: Check that the shell has the current token and the URL uses the matching workspace and factory UUIDs. Ask the manager for a new token if it expired, was revoked, or its grant changed.
- 403 Forbidden: Ask the manager to check that both the grant and the token include Read sessions (
sessions:read).
If your integration already uses Wallie OAuth, it can send an API-audience access token with sessions:read in the same Bearer header. An MCP-audience token won’t work with this API.
See the API reference for error responses and other operations.