Programmabledev

Docs

Your server calls the app API with its key. Your agents call the MCP endpoint with a token your server mints. People connect their accounts on our page, and never hand their keys to you or your agents.

How it fits together

Your server holds an app key; your agents hold short-lived tokens; people connect their accounts on our page.

Programmable Dev sits between your AI agents and the services they use. Three kinds of caller, three credentials:

  • Your server calls the app API (/v1/…) with your app key, Authorization: Bearer pd_live_…. It creates tenants (your customers) and actors (their agents), starts connect sessions, sets grants and reads usage.
  • Your agents call the MCP endpoint (/mcp/:tenant/:actor) with a token your server mints for them, pdt_…, valid for at most 15 minutes. They see only the tools their grants allow.
  • People connect their accounts on our hosted page. Their keys and OAuth tokens never pass through your app or your agents.

Every tool call goes through the same checks: the grant, a daily cap, an optional human approval, billing, and a log row with its cost. Results from outside services come back marked as untrusted data.

Which ids to use. You name tenants and actors with your own ids; we never invent them.

ThingWhat it isUse as its id
TenantWhoever owns the connected accounts: one of your customers, workspaces or users. Connections, usage and limits belong to it, and one tenant never sees another's.Your own id for that customer or user
ActorOne caller inside a tenant: an agent, a bot, a workflow. Grants, caps and the call log are per actor.Your own id for that agent
ConnectionOne signed-in account or key of a tenant (their Slack, their GitHub). Several actors can be granted the same connection.Ours (a UUID); keep it next to your record, or find it again by metadata

A person who uses several agents is one tenant with several actors, not several tenants. The server proxy and token read act for the tenant and name no actor. Ids are 1 to 128 characters of A-Z a-z 0-9 . _ : -.

The full machine-readable contract is at /openapi.json. A summary for language models is at /llms.txt.

Quickstart: your first proxied call

From an app key to a call to GitHub through a user's connection, in about five minutes.

You need an account on the dashboard and an account at a provider to connect. This guide uses GitHub; any id from GET /v1/providers works the same way. Each step shows curl; the same calls in the SDKs are at the end.

1. Make an app key. On the dashboard, open Developers and make a key. It is shown once; keep it in your server's secrets.

export PD_APP_KEY=pd_live_…

2. Let connect sessions return to your site. On Connections, add your site's origin (for example https://app.example.com) under Return origins. It must be https.

3. Create a tenant and an actor. A tenant is one of your customers; an actor is one of their agents. Both use your own ids and are created on first use.

curl -X POST https://programmable.dev/v1/tenants/acme \
  -H "Authorization: Bearer $PD_APP_KEY" -H "Content-Type: application/json" \
  -d '{"name":"Acme Inc"}'

curl -X POST https://programmable.dev/v1/tenants/acme/actors/support-bot \
  -H "Authorization: Bearer $PD_APP_KEY"

4. Connect GitHub. Start a connect session and open the url it returns. Sign in, approve GitHub, and your browser comes back to return_url with result=connected&connection=<id>.

curl -X POST https://programmable.dev/v1/tenants/acme/connect-sessions \
  -H "Authorization: Bearer $PD_APP_KEY" -H "Content-Type: application/json" \
  -d '{"source":"record","provider":"github","return_url":"https://app.example.com/connected"}'
# → { "url": "https://programmable.dev/connect/pcs_…", "expires_at": "…" }   (open it within 10 minutes)

5. Turn the proxy on for your app (it is off until you do).

curl -X PUT https://programmable.dev/v1/app/proxy \
  -H "Authorization: Bearer $PD_APP_KEY" -H "Content-Type: application/json" \
  -d '{"enabled":true}'

6. Call GitHub through the connection. We add the user's token; you never see it.

curl -X POST https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/proxy \
  -H "Authorization: Bearer $PD_APP_KEY" -H "Content-Type: application/json" \
  -d '{"method":"GET","path":"/user"}'
# → { "call_id": "…", "status": 200, "headers": { … }, "body": "{\"login\":\"…\"}", "encoding": "utf8", "truncated": false, "dropped_headers": [] }

That is a proxied call. To let an agent use GitHub as tools instead, grant the connection to the actor and give the agent an MCP token:

curl -X PUT https://programmable.dev/v1/tenants/acme/actors/support-bot/grants \
  -H "Authorization: Bearer $PD_APP_KEY" -H "Content-Type: application/json" \
  -d '{"grants":[{"connection_id":"'$CONNECTION_ID'","requires_approval":true,"daily_call_cap":50}]}'

curl -X POST https://programmable.dev/v1/tenants/acme/actors/support-bot/tokens \
  -H "Authorization: Bearer $PD_APP_KEY"
# → { "token": "pdt_…", "expires_at": "…", "mcp_url": "https://programmable.dev/mcp/acme/support-bot" }

The same steps with the SDKs. The SDKs (@programmable/dev on npm, programmable-dev on PyPI) are not published yet. Every call below is a plain JSON request, so the curl lines work today.

TypeScript
import { ProgrammableDev } from "@programmable/dev";

const pd = new ProgrammableDev(); // reads PD_APP_KEY
await pd.upsertTenant("acme", { name: "Acme Inc" });
await pd.upsertActor("acme", "support-bot");
const { url } = await pd.createConnectSession("acme", { source: "record", provider: "github", return_url: "https://app.example.com/connected" });
// …send the person to url; they come back with ?connection=<id>
await pd.setProxySettings({ enabled: true });
const res = await pd.proxyRequest("acme", connectionId, { method: "GET", path: "/user" });
console.log(res.status, JSON.parse(res.body).login);
Python
from programmable_dev import Client

pd = Client()  # reads PD_APP_KEY
pd.upsert_tenant("acme", {"name": "Acme Inc"})
pd.upsert_actor("acme", "support-bot")
url = pd.create_connect_session("acme", {"source": "record", "provider": "github", "return_url": "https://app.example.com/connected"})["url"]
# …send the person to url; they come back with ?connection=<id>
pd.set_proxy_settings({"enabled": True})
res = pd.proxy_request("acme", connection_id, {"method": "GET", "path": "/user"})
print(res["status"], res["body"])

App keys and authentication

One Bearer key per server, two live at a time so you can rotate without downtime.

Send your app key on every app API call: Authorization: Bearer pd_live_…. Cookies are ignored on these routes, so there is no CSRF surface. Make and rotate keys on the dashboard under Developers; each key is shown once.

  • At most 2 live keys per app. Rotating a key makes a new one at once and keeps the old one working for a grace period (24 hours by default), so you can roll the new key out first.
  • A revoked key stops at once, and so does every MCP token it minted.
  • 30 failed keys or tokens a minute from one address, then 429 for the rest of that minute.
  • Never put an app key in a browser, a mobile app or an agent's prompt. Agents get MCP tokens instead.

MCP tokens (pdt_…) come from POST /v1/tenants/:t/actors/:a/tokens: 60-900 seconds, bound to one tenant and actor, returned once. They carry no grants: grants are read live on every call, so a change applies at once.

Ids are yours: a tenant or actor id is 1-128 of A-Z a-z 0-9 . _ : -. Ids starting with dashboard- are kept for the dashboard's test account.

Connect sessions

Send a person to our page to connect an account; they come back to your site.

POST /v1/tenants/:t/connect-sessions returns a url that works for 10 minutes and once. Send the person there (a redirect or a link). They sign in with Programmable, then paste a key or approve at the provider on our page. Keys never pass through your app.

For a link sent by email, or opened on a phone, ask for longer with ttl_seconds (5 to 60 minutes) and pin it with expected_email.

The person needs a Programmable account. The hosted page always signs them in with Programmable (they can make the account there, on the way); your app's own login is not accepted there, and there is no mode in which your app vouches for who they are. That is deliberate: the page takes credentials, so we check who is typing them. Tell people before you send them, and use expected_email when you know their address: it must match an address their sign-in verified.

sourceWhat it connectsBody
recordA provider from GET /v1/providers: GitHub, Google, Slack and othersprovider: "<id>", optional config.inputs
mcpA remote MCP serverconfig: { url, auth_mode? }
builtinweb_search, web_reader or apifyprovider, config
composioSlack, Notion, GitHub, HubSpot, Airtable or Linear through Composioprovider
(catalogue)An MCP server from the cataloguecatalog_entry_id instead of source

When the person is done, their browser goes to return_url with:

  • result=connected&connection=<id> on success.
  • result=failed&error=<reason> otherwise: cancelled, expired, access_denied, provider_failed, bad_config, save_failed, connection_limit, record_changed (start a new session) or account_mismatch (a re-authorisation signed in as a different provider account; nothing changed). A failed re-authorisation also carries connection=<id>.

return_url's origin must be one of your app's return origins (dashboard, Connections). Set expected_email so only that person can use the link: a leaked link is then useless to anyone else.

To sign a connection in again, pass its connection_id. To ask for more scopes on a signed-in provider connection, add add_scopes; each must be in the provider's scopes.allowed. A tenant holds at most 100 connections.

Treat the redirect as a hint. Anyone can open your return_url with any result and connection in it. Before you record a connection as made, confirm it from our side: the connection.connected webhook, or GET /v1/tenants/:t/connect-sessions/:id and the connection itself with your app key.

You also get a connection.connected webhook when a session finishes, and connect_session.failed, connect_session.cancelled or connect_session.expired when it ends without connecting, so you don't depend on the redirect. The create answers with the session's id: GET /v1/tenants/:t/connect-sessions/:id says how it stands (open, claimed, completed, failed, cancelled or expired, with the same error_code), and DELETE cancels it (the link stops working at once).

The proxy

Your server calls a provider's API with a user's connection; the credential stays with us.

For your own server code, not agents. POST /v1/tenants/:t/connections/:id/proxy with { method, path, query?, headers?, body?, body_encoding? } sends the request to the provider's api_base_url + path, with the connection's credential added. You get the provider's status, allowlisted headers and body back. Any trace of the credential in the answer is replaced with [redacted].

  • Off until you turn it on: PUT /v1/app/proxy { "enabled": true } (dashboard: Developers > Server access).
  • Provider connections (source: "record") in status connected only.
  • The host must be on the provider's allowed_hosts, the path must stay under the base path, and it may not contain //, . or .. segments, encoded slashes, ? or #. Put query parameters in query.
  • Forwarded headers: Accept, Content-Type, If-Match, If-None-Match. Others are dropped and listed in dropped_headers.
  • Request body up to 1 MB; the answer is read to 2 MB (truncated: true past that); 25 seconds; redirects are returned, never followed.
  • After a 401, an OAuth token is refreshed once and the request retried once. A second 401 marks the connection needs_reauth (409 NEEDS_REAUTH).
  • 120 calls per connection per minute, and a daily cap per connection (default 1000).

Safe retries. Send the header Idempotency-Key: <your key> with a request that changes something (anything but a GET). If your call to us times out, repeat it with the same key and body: you get the first answer back (replayed: true) and the provider is not called twice. Keys are per connection, last 24 hours, and take letters, digits and _ - : . (up to 255). The key belongs to one request: another method, path, query or body under it is refused with 409 IDEMPOTENCY_KEY_REUSED. While the first request is still running a repeat gets 409 IDEMPOTENCY_IN_FLIGHT and a Retry-After. Two cases cannot be replayed and say so instead of calling the provider again: an answer over 256 KB (409 IDEMPOTENCY_RESULT_TOO_LARGE) and a request that was sent but never answered (409 IDEMPOTENCY_OUTCOME_UNKNOWN: it may have run, so check at the provider and use a new key). A provider's own error answer is stored and replayed like any other answer; to try again, use a new key.

curl -X POST https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/proxy \
  -H "Authorization: Bearer $PD_APP_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1042-refund" \
  -d '{"method":"POST","path":"/v1/refunds","headers":{"Content-Type":"application/x-www-form-urlencoded"},"body":"charge=ch_123"}'

Narrow a connection with rules: PUT /v1/tenants/:t/connections/:id/proxy/rules { "allow": ["GET /repos/", "POST /repos/acme/web/issues"] }. A rule is METHOD /prefix with METHOD one of GET, POST, PUT, PATCH, DELETE or *.

Token read

When your server must hold a user's OAuth access token itself.

Some systems need the token in hand: an execution sandbox, a workflow engine. POST /v1/tenants/:t/connections/:id/token returns the current access token of a provider connection that signs in with OAuth, refreshed first when under 5 minutes are left.

{ "access_token": "gho_…", "token_type": "bearer", "expires_at": "2026-10-14T15:02:11.000Z",
  "scopes": ["read:user"], "provider": "github", "connection_id": "7d3c…", "refreshed": false }
  • Off until you turn it on: PUT /v1/app/token-read { "enabled": true }.
  • Never the refresh token, never a pasted key, and never a token minted with our own platform client (that one is the same identity for every tenant; use the proxy).
  • Read again before expires_at rather than caching past it. Keep the token out of logs, URLs and anything your users can see.
  • 60 reads per connection per minute. Every read is audited.
  • A read is not a call: it is never counted or billed. It does follow your app's billing: after the trial, or once a plan has ended, it answers 402 BILLING_REQUIRED like a tool call, and no token is handed out.
  • If the provider rejects a token that still had time left (revoked or rotated on their side), read again with { "force_refresh": true }: it is refreshed now. One refreshed in the last 30 seconds is returned as it is, and a connection is refreshed this way at most 12 times an hour.

Prefer the proxy where it fits: a token handed out is a token you must keep safe.

The MCP endpoint

Agents connect to one URL per tenant and actor and see only their granted tools.

https://programmable.dev/mcp/:tenant/:actor, Streamable HTTP, protocol versions 2025-11-25, 2025-06-18, 2025-03-26. Send Authorization: Bearer pdt_… on every request. A token for another tenant or actor is a 404.

Most MCP clients take the URL and a header. For example:

{
  "mcpServers": {
    "programmable": {
      "url": "https://programmable.dev/mcp/acme/support-bot",
      "headers": { "Authorization": "Bearer pdt_…" }
    }
  }
}
  • Methods: initialize, ping, tools/list and tools/call. Tool names are <connection>__<tool>.
  • Tokens last at most 15 minutes: mint a new one before it expires. The MCP session (Mcp-Session-Id) survives a token change.
  • Every tools/call result carries _meta: you.programmable.dev/cost_usd, you.programmable.dev/call_id and you.programmable.dev/status (ok, tool_error, blocked, needs_approval, error, timed_out, cancelled). Map the status rather than parsing text; keep _meta out of the model's context.
  • A gated call answers needs_approval and did NOT run. timed_out may have completed: check before retrying a write.
  • Cancel: inside a session (Mcp-Session-Id), notifications/cancelled with the requestId of a running tools/call stops it. Cancelled before it was sent: blocked (reason cancelled), not counted or billed. After: cancelled, which may have run (check before retrying a write): it counts toward the daily cap and is billed like a normal call. A task is cancelled with tasks/cancel.
  • Progress: a tools/call with params._meta.progressToken, from a client that accepts text/event-stream, is answered as an SSE stream: notifications/progress at once and every 5 seconds (fixed wording, progress in seconds, no total), then the result.
  • Dry run: send params._meta: { "you.programmable.dev/dry_run": true } with tools/call. Every check runs and nothing is sent.
  • Tasks (protocol 2025-11-25 only): initialize advertises capabilities.tasks, and a gated tool lists execution.taskSupport: "optional". Send params.task: {} with tools/call and a gated call answers a task instead of text; poll tasks/get (working while a person decides, then completed, failed or cancelled), read the approved run's result with tasks/result (marked untrusted, like any result), list with tasks/list, withdraw a waiting one with tasks/cancel. Tasks last 24 hours; 120 task requests a minute per actor. Older versions and calls without task answer as before.
  • Tool discovery (off by default, per actor): for an agent with hundreds of tools, tools/list gives search_tools, describe_tool and call_tool in place of every definition. See Grants, tool calls and approvals.
  • request_access (off by default, needs a webhook): an agent asks your server for a tool it lacks, as an access.requested event. 10 an hour per actor. Over REST it is the last entry of GET …/tools and runs through POST …/tools/call like any other name.
JSON-RPC errorMeaning
-32700Not JSON (HTTP 400).
-32600Not a valid JSON-RPC message.
-32601Unknown method.
-32602Unknown tool, or arguments is not an object (re-list tools).
-32002Billing required: error.data.code is BILLING_REQUIRED with billing_url.
-32003tasks/result for a task still waiting for a person: error.data.task is its status. Poll tasks/get and ask again.

At this URL tokens come from your server, so /.well-known/oauth-protected-resource/mcp/:t/:a lists no authorization server (RFC 9728): give a stock MCP client the token as a configured header, or use MCP sign-in (next section).

MCP sign-in (OAuth for stock MCP clients)

Claude, n8n and other MCP clients connect to one agent by sending a person to sign in, with no token to paste.

Available while MCP sign-in is switched on for this service (its metadata below answers 404 otherwise). The MCP server URL then names your app too, because tenant and actor ids are your own and only unique within your app:

https://programmable.dev/mcp/<your app slug>/<tenant>/<actor>

Give that URL to the MCP client with no headers. Its first request gets a 401 whose WWW-Authenticate names the Protected Resource Metadata; that lists our authorization server, whose metadata is at /.well-known/oauth-authorization-server. The client registers itself (a Client ID Metadata Document URL as its client_id, or POST /oauth/register), opens /oauth/authorize in a browser with PKCE (S256) and resource set to the URL above, and exchanges the code at /oauth/token. Access tokens last 15 minutes and refresh tokens rotate; the person can revoke on Settings > Profile.

  • Who can say yes: for your dashboard's test agent (dashboard-test / dashboard-agent), a developer or owner of your app's workspace. For your own tenants, only the person whose verified Programmable sign-in address you bound with PUT /v1/tenants/:t/mcp-oauth-email { email, actors }, for the actors you listed (1 to 20), and only once your app's MCP sign-in switch is on (Developers > Server access). Nobody else, and never by a link alone.
  • The token reaches that one actor at that one URL (any other path is 404) and carries no grants: tools, daily caps and approvals are the actor's, as with a minted token.
  • It stops when the switch goes off, the address is unbound or changed, the actor is dropped from the list, the key that bound the address is revoked (a rotation moves the binding to the new key unless you choose to end it: do that if the key may have leaked), the developer leaves or is demoted, or the tenant or actor is deleted; while the app is turned off it is refused.
  • Errors before the person decides stay on our page; your client is only ever sent the person's answer (code or access_denied).
  • Live tenants only. Test-mode tenants keep using minted actor tokens.

Grants, tool calls and approvals

Which tools each agent may use, how many times a day, and which calls wait for a person.

PUT /v1/tenants/:t/actors/:a/grants replaces an actor's grants. Each names a connection, optionally a list of tools, a daily_call_cap (default 20) and requires_approval (default true). Agents without MCP can call POST …/tools/call: same checks, same answers.

  • Input up to 16 KB. Results are clipped to 32 KB and wrapped as <untrusted-data>…</untrusted-data>.
  • A gated call creates an approval (24 hours to decide; at most 20 waiting per actor and connection) and sends approval.needed.
  • Approve with POST /v1/approvals/:id/decide { "decision": "approve", "digest": "…" }. The digest proves the person saw exactly this tool, connection and input. An approved call runs once, then; the outcome comes as approval.decided.
  • Approve with edits: send input too (the tool's whole input as it should run) to fix an argument instead of rejecting. It is checked like a fresh call. The approval you asked about becomes superseded; a new approval (edited: true, its own id and digest, edited_args with the names of the changed arguments) runs once. Pass its edit_notice to the agent so it knows its own input did not run. A request cannot be edited.
  • Approval keys (pd_appr_…, Developers > API keys): for a chat bot or a small tool that only decides. Such a key can call GET /v1/approvals (pending only), GET /v1/approvals/:id and POST /v1/approvals/:id/decide; every other route answers 403 APPROVAL_KEY.
  • Dry runs ("dry_run": true): every check, nothing sent, 60 a minute per actor.

Changed tool definitions. An outside server (an MCP server, or Composio) can change a tool's description or input schema after you granted it. We keep a fingerprint of each tool's definition as it was when the grant was set, and compare on every listing and call. A grant's on_tool_change says what happens to a tool that no longer matches, or that the server added later: hold (the default for a new grant) stops offering it until someone accepts the change, ask keeps offering it but makes every call wait for approval, allow offers it as it is. You get connection.tools_changed; GET …/grants lists the affected tools under tool_changes and GET …/tools under held. To accept: GET /v1/tenants/:t/connections/:id/tool-changes shows what changed, with a fingerprint per tool; show it to a person, then POST the same path with { "tools": [{ "tool", "fingerprint" }] }. If the server changed the tool again in between, nothing is accepted (409 TOOL_CHANGED_AGAIN). Provider connections and built-ins are not affected: their tools are ours.

Tool discovery, for agents with very large tool lists. An agent granted several connections can be offered hundreds of tools, and it has to read every definition before it can do anything. PUT /v1/tenants/:t/actors/:a/tool-discovery { "mode": "on" } lists that actor three built-in tools instead: search_tools (a few words in; matching tool names out, each with a one-line summary, its kind and whether a call waits for a person; 10 a page, at most 25), describe_tool (one tool's full definition, exactly as the list would have given it) and call_tool ({ name, input }). "mode": "auto" does the same only while the actor is offered more than threshold tools (40 unless you name one). It is off until you set it, and it changes what an agent is listed, never what it may call.

  • call_tool is the call of the tool it names: the same grant, argument and resource limits, caps, spending limits, approval (the approver sees the real tool and its input), dry run, cost label and task. Your call history and usage name the real tool, never call_tool. A tool's own name can still be called directly.
  • Search and describe show only what the actor's grants offer. A tool the grant blocks or hides is never found; a tool on hold after a changed definition is named as on hold, without its definition.
  • Search and describe call no service, so they are not calls: nothing in your call history, usage or bill, no cap and no approval. 60 a minute per actor. Summaries and descriptions are the services' own words, wrapped as untrusted.
  • Search is by words (name, then title, then connection, then description), not by meaning: short queries like "send email" or "create issue" work best.
  • Without MCP: GET …/tools returns the three built-ins while discovery is active (discovery.active; ?view=all for every definition) and POST …/tools/call runs them, so you can forward your model's calls as they come. Or search yourself with GET …/tools/search?q= and GET …/tools/describe?name=.

Setup links: one link that connects a service in your dashboard's test account and grants the tools it lists, for trying a provider before you write code: /dashboard/setup?provider=github&tools=a,b&cap=50 (or server=<slug> for an MCP server from the catalogue). Opening it never acts: the page shows what it would do, and you press the buttons. Open the setup page.

Webhooks

Signed events to your server: approvals, connections, provider events and access requests.

Set your URL with PUT /v1/app/webhook { "url": "https://app.example.com/hooks/programmable" } (or on the dashboard, Developers > Webhooks). The answer carries the signing secret whsec_… the first time, and after rotate_secret: true; keep it.

EventWhendata
approval.neededA call is waiting for a person{ approval }
approval.decidedApproved (with run), rejected, expired, or replaced by an edited one (superseded){ approval }; edited: true on the approval that ran with a person's edited input
connection.connectedA connect session or import finished{ connection, kind, scopes? }: kind is new, reauth (an existing connection signed in again) or add_scopes; scopes = what the provider granted, when it said
connection.needs_reauthA connection must be signed in again{ connection }
connection.revokedA connection was deleted{ connection }
connection.expiringNo refresh token and under 3 days left{ connection, expires_at }
connection.tools_changedAn outside server's tool definitions are no longer the ones that were accepted{ connection, tools }: each { tool, change, parts? } with change = changed (and which parts: description, input_schema, annotations, title), new or removed. Names and kinds only, never the text
connect_session.failedA connect session ended without connecting{ connect_session, error_code }: connect_session = { id, tenant, source, provider, label, reauth, connection_id }; error_code as in the return URL
connect_session.cancelledYour DELETE, or the person pressed Cancel on our page{ connect_session, error_code: "cancelled" }
connect_session.expiredThe link expired unused or unfinished (sent once, a minute or so after; up to 10 minutes after when a sign-in was still out at the provider){ connect_session, error_code: "expired" }
provider.eventA provider's own webhook (Slack, GitHub…) for a subscribed connectionthe provider's payload, untrusted
access.requestedAn agent called request_access{ actor, provider, tools, reason }; reason is untrusted
mcp_oauth.email_boundAn address was bound for MCP sign-in on a tenant (PUT /v1/tenants/:t/mcp-oauth-email){ actors, key: { id, prefix } }; never the address
spend.warningBooked spend first reached a spending limit's warn_percent in a period{ scope, period, period_start, cap_usd, spent_usd, warn_percent, actor? }
spend.cap_reachedA spending limit refused a call for the first time in a periodthe same
mcp_oauth.email_unboundIt was unbound: by you, or because the key that bound it was revoked{ reason: "app" | "key_revoked", key }

Choose what you receive with events on the same call: exact types and families, e.g. PUT /v1/app/webhook { "url": "…", "events": ["approval.needed", "connection.*"] }. null (the default) means every type; leaving events out keeps your filter. An event your filter leaves out is never queued: it is not retried and cannot be redelivered. A type that is not in the table above is refused (BAD_EVENT_TYPES), so a typo cannot silently drop events. Nothing depends on an event reaching you: a gated call waits for a person whether or not you take approval.needed (you can read approvals with GET /v1/approvals/:id), but request_access is only offered to your agents while your filter takes access.requested.

A developer can send one past delivery again from Developers > Webhooks (once it was delivered or its retries ran out). It carries the same body, so the same id and X-Programmable-Delivery, plus X-Programmable-Redelivery: true and a signature made when it is sent: de-duplicate on the id (X-Programmable-Id) unless you want the repeat.

Body: { id, type, tenant, created_at, occurred_at, data } (created_at and occurred_at are the same moment; created_at is the name every Programmable app uses). Headers: X-Programmable-Event, X-Programmable-Id and X-Programmable-Delivery (both = id, the same on every retry and redelivery; de-duplicate on it), X-Programmable-Timestamp and the signature t=<unix seconds>,v1=<hex HMAC-SHA256(secret, "<t>.<raw body>")>.

Where the signature is: always in X-Programmable-Signature-V2. In X-Programmable-Signature too when your app's signature_format is suite, the format every Programmable app is moving to and the one a newly registered app starts with. An app registered before this setting existed is legacy (GET /v1/app/webhook says which yours is): its X-Programmable-Signature still carries sha256=<hex HMAC-SHA256(secret, raw body)>, exactly as before, so nothing you built stopped working. Switch when your receiver is ready: PUT /v1/app/webhook { "url": "…", "signature_format": "suite" } or Developers > Webhooks (and back with legacy). A receiver that reads -V2, as the examples and both SDKs do, works in either format; the SDKs accept the value from either header.

Answer 2xx within 10 seconds. Anything else is retried after 1 min, 5 min, 30 min, 2 h, 12 h, then dropped. Redirects are not followed.

While your app is turned off, its events are held rather than tried, and sent once it is turned on again. Events more than 3 days old, and an approval.needed whose approval was decided or expired meanwhile, are dropped instead; a deleted app's events are never sent. After a hold, order by occurred_at.

Verify every delivery over the raw body, before parsing it, and refuse a timestamp more than 5 minutes off.

Node (Express)
import crypto from "node:crypto";
import express from "express";

const app = express();
app.post("/hooks/programmable", express.raw({ type: "application/json" }), (req, res) => {
  const raw = req.body.toString("utf8");
  const m = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(req.get("X-Programmable-Signature-V2") ?? "") ?? /^t=(\d+),v1=([0-9a-f]{64})$/.exec(req.get("X-Programmable-Signature") ?? "");
  if (!m || Math.abs(Date.now() / 1000 - Number(m[1])) > 300) return res.sendStatus(400);
  const expected = crypto.createHmac("sha256", process.env.PD_WEBHOOK_SECRET).update(`${m[1]}.${raw}`).digest("hex");
  if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(m[2]))) return res.sendStatus(400);
  const event = JSON.parse(raw);
  // de-duplicate on event.id, then handle event.type
  res.sendStatus(204);
});
Python (Flask)
import hashlib, hmac, json, os, time
from flask import Flask, request

app = Flask(__name__)

@app.post("/hooks/programmable")
def programmable_hook():
    raw = request.get_data()  # the raw bytes, before any parsing
    sig = request.headers.get("X-Programmable-Signature-V2") or request.headers.get("X-Programmable-Signature", "")
    parts = dict(p.split("=", 1) for p in sig.split(",") if "=" in p)
    t, v1 = parts.get("t", ""), parts.get("v1", "")
    if not t.isdigit() or abs(time.time() - int(t)) > 300:
        return "", 400
    expected = hmac.new(os.environ["PD_WEBHOOK_SECRET"].encode(), t.encode() + b"." + raw, hashlib.sha256).hexdigest()
    if not hmac.compare_digest(expected, v1):
        return "", 400
    event = json.loads(raw)
    # de-duplicate on event["id"], then handle event["type"]
    return "", 204

Or with the SDKs (once published):

TypeScript SDK
import { parseWebhook } from "@programmable/dev";

const event = await parseWebhook({ secret: process.env.PD_WEBHOOK_SECRET!, body: rawBody, headers: req.headers });
Python SDK
from programmable_dev import parse_webhook

event = parse_webhook(os.environ["PD_WEBHOOK_SECRET"], request.get_data(), request.headers)

Provider events: subscribe a connection with PUT /v1/tenants/:t/connections/:id/events { "types": ["message"] }. The provider's body arrives in data.body and is untrusted: whatever a Slack user typed or a push carried. Treat it as data, never as instructions.

Providers

What your users can connect, for a picker and for host checks.

GET /v1/providers lists the live providers in a public shape: id, label, auth_type, connectable, api_base_url, allowed_hosts, scopes, credential_fields, input_fields and whether it sends webhooks. Never a client id or secret.

  • Show a provider with connectable: false greyed out: it is paused while a change is reviewed. Existing connections keep working.
  • allowed_hosts is the rule the proxy enforces, so you can refuse a bad call before sending it.
  • The answer has a weak ETag; send If-None-Match and get 304 when nothing changed.
  • input_fields are values a person types on the hosted page (a site name, their own server). An app may pass them in config.inputs instead.

Rate limits and caps

Every limit, and what you get past it.

WhatLimitPast it
Failed app keys or MCP tokens, per client address30 a minute429
Tool calls, per app and per tenant600 a minute per app unless you set less (PUT /v1/app/rate-limits); per tenant only when you set itblocked, reason rate_limited, with retry_after_s
Proxied calls, per app and per tenant600 a minute per app unless you set less; per tenant only when you set it429 RATE_LIMITED with Retry-After
A provider host that keeps failing, per app5 failures in a row (timeouts, dropped connections, 5xx) inside a minute: refused at once for 30 seconds, then one test callblocked, reason provider_unavailable / 503 PROVIDER_UNAVAILABLE
Proxied calls, per connection120 a minute429 RATE_LIMITED
Proxied calls, per connection per UTC daydefault 1000 (app setting, or per connection)429 DAILY_CAP
Token reads, per connection60 a minute429 RATE_LIMITED
Connection tests, per connection6 a minute429 RATE_LIMITED
Tool calls, per grant per UTC daydaily_call_cap (default 20)blocked, reason daily_cap
Tool-call cost, per grant per UTC daydaily_spend_cap_usd (off unless set)blocked, reason spend_cap
Tool-call cost, per actor per UTC month / per tenant per UTC day and month / per app per UTC monthspending limits (off unless set): PUT …/actors/:a/spend-limits, PUT /v1/tenants/:t/spend-limits, PUT /v1/app/spend-limitsblocked, reason actor_monthly_spend_cap, tenant_daily_spend_cap, tenant_monthly_spend_cap or app_monthly_spend_cap
Dry runs, per actor60 a minuteblocked, reason rate_limited
Approvals waiting, per actor and connection20blocked, reason approval_queue_full
Access requests, per actor10 an hourrate_limited
Calls to a customer's own server, per host60 a minute, 500 a day per connection429 / blocked
Connections, per tenant100409 CONNECTION_LIMIT

A 429 may carry Retry-After. Daily caps reset at 00:00 UTC, monthly spending limits on the first of the UTC month. A refused call is never billed and never counts against a cap.

Spending limits count what your agents' tool calls cost at the services they call (cost_usd), not your plan here. Each can warn before it is reached: spend.warning when booked spend first reaches warn_percent (default 80) of the limit, and spend.cap_reached the first time it refuses a call, once per limit per period. To attribute cost to your own cost centres, pass cost_label with a call: usage groups by it.

Security model

What each credential can do, what a leak costs you, and what we do not protect against.

Four things can leak. What each one opens:

If this leaksWhat it can doWhat it cannot doWhat to do
App key (pd_live_…)Everything your app can: every tenant's connections, grants and calls, the server proxy, and token read if you turned it onRead a stored key, password or refresh token: those are never returned to anyoneRotate it (the old key keeps working for a grace period) or revoke it at once. Give a key to one tenant only (tenant when you make it) wherever one customer's integration holds it
Actor token (pdt_…)Call that one actor's granted tools, within its caps and approvals, for at most 15 minutesReach another actor or tenant, change grants, connect anythingNothing: it expires. Revoking the key that minted it kills it at once
Connect linkLet the first signed-in person who opens it connect their own account to that tenant, until it expires or is usedRead anything. With expected_email, be used by anyone elseCancel the session (DELETE …/connect-sessions/:id). Always set expected_email when you know the person
Connection id, tenant id, actor id, call idNothing by itselfAnything: every one of them is only a name, and needs your app key or an actor tokenNothing

What we do for you. Credentials are encrypted at rest and decrypted only to make a call; they are never in a response, a log or an error. A tenant's data is reachable only through a credential scoped to it. Every call is checked against the actor's grant when it is made, so a grant you tighten applies to the next call. Calls you mark as needing approval wait for a person who sees exactly what will be sent.

Text from outside is data, not instructions. Tool results, and tool names and descriptions from outside servers, come back wrapped as <untrusted-data>. A page, an email or a ticket an agent reads can contain text written to steer it (prompt injection). The wrapper tells your model where outside text starts and ends; it does not make a model obey you over the text. What limits the damage is the grant: reads that run, writes that ask a person, destructive calls blocked, argument limits and caps. Set those as if the agent will one day be tricked.

What we do not protect against. An app key used by whoever holds it: we cannot tell your server from someone who stole its key. A person who approves a call without reading it. A provider that is itself compromised. What your own code does with a token once you turn token read on.

To report a security problem, write to the address on the legal page.

Errors

One shape for every refusal, and a catalogue of every code.

Every refusal is JSON { "error": "…", "code": "…" } with a 4xx or 5xx status. error is a sentence for a person; branch on code, which is stable. A few generic refusals (401 for a bad key, 400 for a body that does not fit) carry no code. Some carry more: tools/call refusals carry call_id and status; BILLING_REQUIRED carries billing_url.

Retry only 429 and 5xx, after a wait. A tool call that answered timed_out, or a proxied write that hit UPSTREAM_TIMEOUT, may have reached the provider: check before you send it again.

The catalogue below is built from the code. The connect-page codes are what a person sees on our hosted page, or what comes back to your return_url in the session's error.

App API codes

In the body of a refusal from /v1.

CodeStatusMeaning
ABOVE_APP_DEFAULT400Above app default.
ALREADY_USED409That approval was already used.
APP_DISABLED403, 409The app is turned off (by its owners or by Programmable). 403: every key and token of it is refused until it is turned back on; the message says who turned it off and where it is turned back on. 409: it can't ask for, act on or approve approvals meanwhile.
APP_MOVED409This app moved to another workspace; its owners start its plan there.
APP_NOT_BILLED_HERE409This app's billing can only be cancelled now.
APPROVAL_KEY403An approval key lists pending approvals only; use an app key for the others.
BAD_ACTORS400Actors: 1-… of your actor ids (A-Z a-z 0-9 . _ : -).
BAD_BODY400The proxy body or an OAuth client's fields don't fit together (for example base64 that does not decode, or a secret sent with its clear flag).
BAD_CONFIG400The connection's source, provider or config is missing or not valid.
BAD_EDIT400Edited input goes with an approval; a rejection takes none.
BAD_EMAIL400Email: not an email address.
BAD_EVENT_TYPES400Events: a list of at most … event types, or null for every type.
BAD_FILTER400A query filter is not valid: a tool search's filter (kind, limit, cursor, a describe without a name, a view that is not agent or all), a call-history or usage filter (outcome, tool, date range, cursor), or a metadata filter that is not metadata[key]=value with a valid key and value, names a key twice, or is one of more than 5.
BAD_GRANT400Mcp_ui can be on for one connection of an actor at most.
BAD_HEADER400A proxied request header is not allowed or contains control characters.
BAD_ID400A tenant, actor or connection id is not in the allowed form (1-128 of A-Z a-z 0-9 . _ : -, or a uuid).
BAD_IDEMPOTENCY_KEY400….
BAD_LIMIT400The limit must be a whole number of dollars from 0 to 100,000.
BAD_MODE400Mode: live or test.
BAD_PATH400The proxied path is refused: it must start with /, stay under the provider's base path and carry no //, . or .. segments, encoded slashes, ? or #.
BAD_PRIVATE_KEY400The private key is not an unencrypted PEM key of a supported kind (RSA 2048 or more, or EC P-256).
BAD_REQUEST400The proxy body is not valid JSON of the expected shape.
BAD_RETURN400X-Dev-Return-To must be a known name and X-Dev-Return-Id a uuid.
BAD_RETURN_URL400Return_url's origin is not one of your app's return origins.
BAD_RULE400A proxy rule is not "METHOD /prefix", or there are more than 50.
BAD_SCOPES400Add_scopes asks for a scope the provider record does not allow, or is used without a signed-in provider connection.
BAD_TOOL_CALL400Call_tool's input is not `{ name, input }`: the tool to call and that tool's own input. Nothing was called.
BAD_URL400The webhook URL is not a public http(s) address (https in production).
BILLING_REQUIRED402Your app's trial is used up or its plan has ended; nothing was sent. The answer carries billing_url.
BODY_TOO_LARGE413The request is too large.
CHANGED409What this approval would run no longer matches what was shown, so it was not run.
CLIENT_IN_USE409… connection(s) were signed in with this client and refresh with it. Reconnect them first, or delete with force=true (they will need re-authorisation).
COMMUNITY_NOT_ACCEPTED409This is a community listing (…), not the vendor's own server: an admin must accept it explicitly (accept_community: true).
COMPOSIO_OFF503App connections through Composio are not switched on for this server.
CONNECTION_LIMIT409A tenant can have at most … connections; delete one first.
CREDENTIAL_STORE_UNAVAILABLE503The app's workspace keeps its credentials in its own secret store, and that store is not answering or is refusing us, so the credential was not stored anywhere. Try again when the store is back; a workspace owner sees its state on Settings > Workspace.
CUSTOMER_HOST_TYPED400Config.inputs.… is typed by the person on the hosted connect page (their own server's address), not sent by the app.
DAILY_CAP429This connection has reached its daily proxy cap (…).
DECIDED409That approval was already decided.
DEFAULTS_OFF409Default grants are off for this app; turn them on with PUT /v1/app/default-grants first.
DELIVERY_PENDING409This delivery is still waiting to be sent (or a redelivery of it is); nothing was queued.
DETAILS_TOO_LONG400Details: at most … characters as pretty JSON, so a person can read all of it.
DIGEST_MISMATCH409This is not the request the person approved; ask again.
DUPLICATE400Each connection may appear once.
EXPIRED409That approval expired before it was decided.
HOST_NOT_ALLOWED400The request would go to a host that is not on the provider's allowed_hosts, so nothing was sent.
IDEMPOTENCY_IN_FLIGHT409The first request with this Idempotency-Key is still running; nothing was sent. Try again in … s.
IDEMPOTENCY_KEY_REUSED409This Idempotency-Key was already used on this connection with a different request (method, path, query or body). Use a new key for a new request.
IDEMPOTENCY_OUTCOME_UNKNOWN409The first request with this Idempotency-Key was sent, but its outcome was never recorded: it may have run. Nothing was sent now. Check at the provider, then use a new key if it must run again.
IDEMPOTENCY_RESULT_TOO_LARGE409The first request with this Idempotency-Key ran, and its answer was too large to keep for a replay; nothing was sent now. Read the result from the provider, or use a new key to run it again.
IMPORT_DISABLED403Importing connections is off on this service.
IMPORT_NOT_ALLOWED403Only the platform's own apps may import connections.
IMPORT_REFRESH_REFUSED422Import refresh refused.
IMPORT_TRANSIENT502The provider could not be reached to check the token; try again.
IMPORT_UNSUPPORTED409Only sign-in (authorization code) connections can be imported.
KEY_SCOPED403This key reaches one tenant (…) only; use an app key for this.
MCP_OAUTH_LIVE_ONLY409MCP sign-in reaches live tenants only; bind the address with a live key.
MCP_OAUTH_TEST_ACCOUNT409The dashboard's test tenant can't have a bound address; its developers sign in to it as members.
METADATA_LIMIT400After the change (a PATCH, or a connect session's metadata merged over the connection's) the metadata would hold more than 20 keys or 4096 bytes of JSON.
METHOD_OVERRIDE400A proxied request carries a method-override argument (_method, X-HTTP-Method-Override and the like) as a query key or a top-level body key. Send the method you mean instead.
MODEL_PROVIDER409… is an AI model provider. Model keys are kept in the platform's vault, not connected here, so this record can't go live.
NEEDS_APPROVAL409A person has to approve this request first. Send it again with X-Dev-Approval once they have.
NEEDS_REAUTH409This connection needs to be signed in again: ….
NEEDS_SESSION400An OAuth MCP server needs a person to sign in: use POST /v1/tenants/:t/connect-sessions.
NEVER_A_READ422Never a read.
NEVER_APPROVED409This record was never approved; there is nothing to restore.
NO_ACTOR404No such actor.
NO_API_BASE409This provider record has no api_base_url.
NO_APPROVAL404No such approval.
NO_APPROVER409This person has no programmable.dev profile to approve with.
NO_CALL404No such call.
NO_CATALOG_ENTRY404No such catalogue entry.
NO_CLIENT404, 409No OAuth client is available for that provider (yours, or ours for this provider).
NO_CLIENT_KEY409This provider authenticates the OAuth client with a private key (private_key_jwt), and none is stored with the client.
NO_CONNECT_SESSION404No such connect session.
NO_CONNECTION404No such connection.
NO_DELIVERY404No such delivery.
NO_DIGEST400Send the digest of the request as it was shown.
NO_PROVIDER404No such provider is live.
NO_SERVER404No such server in the catalogue.
NO_SNAPSHOT409The approved version is not in the history any more. Review the record by hand.
NO_TENANT404No such tenant. Create it with POST /v1/tenants/:t first.
NO_WEBHOOK409Set the app's webhook first: access requests are sent there as access.requested events.
NOT_A_REQUEST409That approval is a tool call; approving it already ran it.
NOT_APPROVED409The approval is not approved: it is still pending, or it was rejected or expired. Do not act.
NOT_CANONICAL_HOST400A pasted cloud address is not under the provider's own domain; send the canonical site name.
NOT_CHANGED409The record already matches what was approved.
NOT_CONNECTABLE422That catalogue server can't be connected (no usable remote endpoint).
NOT_CONNECTED409The connection is not signed in (status is not connected).
NOT_EDITABLE409A request is your app's own action; it can be approved or rejected, not edited.
NOT_OAUTH409This connection uses pasted credentials, which are never handed out; call the provider through the proxy instead.
NOT_PINNED400This connection's tools are not from an outside server, so there is nothing to accept.
NOT_RECORD_CONNECTION409The proxy works only with provider-record connections.
NOT_REMOTE422That catalogue server runs only on a local machine (no remote URL).
NOT_SUPPORTED400, 422The connection or server does not support this (for example provider events on a non-provider connection, or an SSE-only MCP server).
OWN_CLIENT_REQUIRED409This app requires its own OAuth client for this provider and has none registered (PUT /v1/app/providers/:provider/client).
PATH_NOT_ALLOWED403… … is not allowed by this connection's proxy rules.
PLATFORM_CLIENT409This connection's token is issued to Programmable's own client, the same identity for every tenant, so it is never handed out; call the provider through the proxy instead.
PLATFORM_KEYS_LOCKED402Composio connections need your app on the paid plan (or a platform admin's allowance); nothing was sent.
POLICY_BLOCKED403This person's settings block … calls by their agents.
PROVIDER_UNAVAILABLE503Provider unavailable.
PROXY_DISABLED403The proxy is off for this app. Turn it on with PUT /v1/app/proxy { enabled: true }.
PROXY_LOCKED403A platform admin turned the proxy off for this app; ask them to turn it on.
RATE_LIMITED429Too many requests right now (per connection: proxy 120 a minute, token read 60, connection tests 6; per tenant: 6 usage CSV exports a minute); wait and try again.
RECORD_NOT_LIVE409That provider is not available to connect yet.
REDIRECT_MISMATCH400, 409The registered redirect URI (…) is not this service's callback (…); update the registration.
REFRESH_FAILED503The provider could not be reached to refresh the token; try again shortly.
REQUEST_QUEUE_FULL429This tenant already has … requests waiting. Wait for a decision or an expiry.
RESERVED_ID400Ids starting with dashboard- are kept for the dashboard's test account; pick another id.
SECRET_REQUIRED400Secret is required for this provider.
SESSION_COMPLETED409This connect session has already ended (…).
SESSION_FINISHING409This connect session is finishing right now (the person's key is being saved). Ask again in a moment.
SNAPSHOT_INVALID409The approved version no longer passes today's checks (…). Review the record by hand.
SOURCE_MISMATCH400Connection_id names a connection of a different source than the session asks for.
TEST_KEY403Test keys can read app-wide settings but not change them; use a live key.
TOKEN_READ_DISABLED403Token read is off for this app. Turn it on with PUT /v1/app/token-read { enabled: true }.
TOKEN_READ_LOCKED403A platform admin turned token read off for this app; ask them to turn it on.
TOO_MANY400Too many items in one request (for example over 200 grants per actor).
TOO_MANY_CLIENTS409Too many earlier clients are still in use for this provider (…); reconnect or delete their connections first.
TOOL_CHANGED_AGAIN409… changed again since you looked (or … no longer listed). Nothing was accepted. Look at the changes again.
UNAVAILABLE409The provider record behind the connection is not available right now (not live, or changed since approval).
UNKNOWN_TOOL404The actor is not offered a tool by that name (re-list its tools). The answer to a call carries call_id and status: blocked.
UNSAFE_DEFAULT400Unsafe default.
UNSAFE_URL422… does not resolve to a public address.
UNSUPPORTED400, 409, 502The provider does not support this (for example an app's own OAuth client for a provider without a browser sign-in).
UPSTREAM_FAILED502The provider could not be reached; nothing more is known.
UPSTREAM_TIMEOUT504The provider did not answer within 25 seconds. The request may have reached it.
USE_EXPIRED409That approval was not used within 24 hours of the decision; ask again.

Connect page codes

Shown to the person on the hosted connect page, or returned to your return_url as the session's error.

CodeStatusMeaning
BAD_CREDENTIALS400The pasted credentials don't fit the provider's fields.
BAD_INPUT400, 502A typed value (for example a site name) doesn't look right.
BAD_INSTALL_SLUG409The app's OAuth client has no matching install page.
CAPTURE_NOT_VERIFIED403The provider did not confirm the account the sign-in came back with.
CLIENT_ID_REQUIRED409The MCP server needs a client id pasted on the page.
COMPOSIO_FAILED502Composio could not start or finish the sign-in.
CREDENTIALS_REFUSED400The provider refused the pasted credentials.
CUSTOM_DOMAIN_LOOKUP_FAILED400A custom domain could not be mapped to the provider's own site.
CUSTOMER_HOST_INVALID400The typed server address is not a public https name.
CUSTOMER_HOST_UNREACHABLE502The typed server address does not resolve to a public address.
DISCOVERY_FAILED502The MCP server's OAuth settings could not be read.
ENGINE500The sign-in lost a step it needed; start a new session.
FINGERPRINT_MISMATCH400The typed server is not the product the provider record is for.
INSECURE_URL502The MCP server's OAuth settings point at a non-https address.
INVALID400A pasted client id or secret is too long.
ISSUER_MISMATCH502The MCP server's OAuth issuer is not the one it named.
LOOKUP_FAILED502The provider's site lookup failed.
LOOKUP_NO_MATCH403The provider's site lookup did not list exactly one site this sign-in can reach.
MISSING_INPUT400, 409The page needs a value the person has not entered.
NO_OAUTH502The MCP server offers no OAuth sign-in.
NO_PKCE502The MCP server does not support PKCE.
RECORD_CHANGED409The provider record changed while the person was on the page; start a new session.
REGISTRATION_FAILED502The MCP server refused our client registration.
RESOURCE_MISMATCH502The MCP server's OAuth metadata names another resource.
TOKEN_REFUSED502The provider refused the token request.
TOKEN_TRANSPORT502The provider's token endpoint could not be reached.
VERIFY_FAILED502The provider could not be reached to check the credentials.

API reference

Every endpoint of the app API. Send Authorization: Bearer pd_live_… on each. Unknown body fields are refused (400). Times are ISO 8601 UTC. The same, machine-readable: /openapi.json.

Tenants and actors

A tenant is one of your customers; an actor is one of their agents. Both use your own ids, created on first use.

POST/v1/tenants/{tenant}

Create or rename a tenant

Creates your tenant on first use (201) or returns it (200); a given name renames it. A tenant is one of your customers. Another app's tenant with the same id is a different tenant. Ids starting with dashboard- are kept for the dashboard's test account (400 RESERVED_ID for a new one).

Path: {tenant}

Body (optional)
namestring 1-200 chars
Answer 201
tenant*Tenant
created*boolean

Errors: BAD_ID, RESERVED_ID

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Acme Inc"}'
TypeScript
await pd.upsertTenant("acme", {"name":"Acme Inc"});
Python
pd.upsert_tenant("acme", {"name":"Acme Inc"})

DELETE/v1/tenants/{tenant}

Delete a tenant

Revokes every connection at its provider (best effort) and deletes it, expires pending approvals, and deletes actors, grants, tokens and sessions. Call logs are kept anonymised. Safe to retry: 204 when the tenant is already gone.

Path: {tenant}

Answer 200
ok*boolean
deleted*object
deleted.connections*integer
deleted.revoked_remote*integer
deleted.actors*integer
deleted.approvals_expired*integer

204: No such tenant for this app (already deleted, or never was).

Examples
curl
curl -X DELETE "https://programmable.dev/v1/tenants/acme" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.deleteTenant("acme");
Python
pd.delete_tenant("acme")

POST/v1/tenants/{tenant}/actors/{actor}

Create or relabel an actor

An actor is one agent inside a tenant. 201 when new, 200 when it existed.

Path: {tenant}{actor}

Body (optional)
labelstring 1-200 chars
Answer 201
actor*Actor
created*boolean

Errors: NO_TENANT, BAD_ID, RESERVED_ID

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/actors/support-bot" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"Support bot"}'
TypeScript
await pd.upsertActor("acme", "support-bot", {"label":"Support bot"});
Python
pd.upsert_actor("acme", "support-bot", {"label":"Support bot"})

DELETE/v1/tenants/{tenant}/actors/{actor}

Delete an actor

Deletes the actor's grants, tokens and MCP sessions at once (its live tokens stop working); its pending approvals expire. The same id can be created again and starts empty.

Path: {tenant}{actor}

Answer 200
ok*boolean
deleted*object
deleted.grants*integer
deleted.tokens*integer
deleted.sessions*integer
deleted.approvals_expired*integer

204: No such tenant or actor (already deleted, or never was).

Examples
curl
curl -X DELETE "https://programmable.dev/v1/tenants/acme/actors/support-bot" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.deleteActor("acme", "support-bot");
Python
pd.delete_actor("acme", "support-bot")

POST/v1/tenants/{tenant}/actors/{actor}/tokens

Mint an MCP token for an actor

A short-lived bearer token (pdt_…) that opens the MCP endpoint for this actor only. 60-900 seconds, default 900. Returned once (Cache-Control: no-store). It carries no grants (they are read live) and dies when the key that minted it is revoked.

Path: {tenant}{actor}

Body (optional)
ttl_secondsinteger 60-900
Answer 201
token*stringpdt_…
expires_at*string (date-time)
mcp_url*stringThe MCP endpoint for this actor.

Errors: NO_TENANT, NO_ACTOR

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/actors/support-bot/tokens" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ttl_seconds":900}'
TypeScript
await pd.createActorToken("acme", "support-bot", {"ttl_seconds":900});
Python
pd.create_actor_token("acme", "support-bot", {"ttl_seconds":900})

Connections

A tenant's accounts at other services. People connect through a hosted page; keys never pass through your app.

POST/v1/tenants/{tenant}/connect-sessions

Start a hosted connect session

A link (url, a bearer for 10 minutes, or for ttl_seconds: 5 to 60 minutes) to send your user to. The redirect to return_url is a convenience for the person's browser: anyone can open that address with any parameters, so act on the connection.connected webhook or on getConnectSession / getConnection, never on the query string alone. They sign in with Programmable, then enter a key or consent on our page; keys never pass through your app. Then their browser returns to return_url with result=connected|failed, connection=<id> and, on failure, error=<code> (cancelled, expired, access_denied, provider_failed, bad_config, save_failed, connection_limit, record_changed, account_mismatch). return_url's origin must be one of your app's return origins. Set expected_email so only that person can use the link. source: record connects a provider from GET /v1/providers; catalog_entry_id connects an MCP server from the catalogue.

Path: {tenant}

Body
source"mcp" | "builtin" | "composio" | "record"
providerstring 1-120 chars
labelstring 1-120 chars
configobject (map)
return_url*string ≤ 2048 chars
connection_idstring (uuid)pattern ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
catalog_entry_idstring (uuid)pattern ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
accept_communityboolean
expected_emailstring (email) ≤ 254 charspattern ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
ttl_secondsinteger 300-3600How long the link works, in seconds. Left out: 600 (ten minutes). A longer link suits one sent by email or opened on a phone; pin it with expected_email.
add_scopes(string 1-300 chars)[] (≤ 50)
metadataobject (map)Your own key/value pairs, copied onto the connection when the session connects. With connection_id they are merged over its metadata (keys added or overwritten, none removed; without metadata it is left as it is); 400 METADATA_LIMIT when the merge would not fit. Never shown to the person, sent to the service or put in events. Not for secrets.
Answer 201
id*string (uuid)The session's id, for GET / DELETE and the connect_session.* webhooks.
url*string
expires_at*string (date-time)

Errors: NO_TENANT, NO_CONNECTION, BAD_CONFIG, BAD_RETURN_URL, BAD_SCOPES, SOURCE_MISMATCH, CONNECTION_LIMIT, NOT_CONNECTED, RECORD_NOT_LIVE, NO_CLIENT, OWN_CLIENT_REQUIRED, REDIRECT_MISMATCH, NO_CLIENT_KEY, CUSTOMER_HOST_TYPED, NOT_CANONICAL_HOST, COMPOSIO_OFF, PLATFORM_KEYS_LOCKED, NO_CATALOG_ENTRY, NOT_REMOTE, NOT_CONNECTABLE, UNSAFE_URL, NOT_SUPPORTED, COMMUNITY_NOT_ACCEPTED, METADATA_LIMIT

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/connect-sessions" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"source":"record","provider":"github","return_url":"https://app.example.com/connected"}'
TypeScript
await pd.createConnectSession("acme", {"source":"record","provider":"github","return_url":"https://app.example.com/connected"});
Python
pd.create_connect_session("acme", {"source":"record","provider":"github","return_url":"https://app.example.com/connected"})

GET/v1/tenants/{tenant}/connect-sessions/{session}

Get a connect session's status

How a session stands, so you need not rely on the browser coming back: open, claimed, completed, failed, cancelled or expired, with a fixed error_code when it ended without connecting and the connection_id once connected (or from the start, for a re-authorisation). You also get connect_session.failed / .cancelled / .expired webhooks. Another tenant's or app's id is a 404, like an unknown one.

Path: {tenant}{session}

Answer 200
connect_session*ConnectSession

Errors: NO_TENANT, NO_CONNECT_SESSION

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/connect-sessions/session" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getConnectSession("acme", "session");
Python
pd.get_connect_session("acme", "session")

DELETE/v1/tenants/{tenant}/connect-sessions/{session}

Cancel a connect session

The link stops working at once and no sign-in already out at the provider can finish it; a connection it had started is removed (an existing one it re-authorised is left as it was). Sends connect_session.cancelled. Safe to retry: a cancelled session comes back as it is with cancelled: false. 409 SESSION_COMPLETED once it connected, failed or expired; 409 SESSION_FINISHING while the person's key is being saved (ask again in a moment). A sign-in that comes back after the cancel stores nothing, or, if it was a moment ahead, the connection it made is deleted again (revoked); a re-authorisation that was a moment ahead keeps its new tokens.

Path: {tenant}{session}

Answer 200
connect_session*ConnectSession
cancelled*booleanThis call cancelled it (false: it already was).

Errors: NO_TENANT, NO_CONNECT_SESSION, SESSION_COMPLETED, SESSION_FINISHING

Examples
curl
curl -X DELETE "https://programmable.dev/v1/tenants/acme/connect-sessions/session" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.cancelConnectSession("acme", "session");
Python
pd.cancel_connect_session("acme", "session")

GET/v1/tenants/{tenant}/connections

List a tenant's connections

Status, scopes, last error and your metadata of every connection. Never a secret. Filter by metadata with metadata[key]=value (exact match; up to 5, all must match): ?metadata[user_id]=u_42. A malformed or repeated filter is 400 BAD_FILTER, never ignored.

Path: {tenant}

Query
metadataobject (map)Only connections whose metadata has every one of these pairs (sent as metadata[key]=value; up to 5).
Answer 200
items*Connection[]

Errors: NO_TENANT, BAD_FILTER

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/connections" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.listConnections("acme");
Python
pd.list_connections("acme")

GET/v1/connections

Search your app's connections

Your app's connections across all its tenants, newest first, each with its tenant. For questions like "which customers must sign in to Slack again": ?provider=slack&status=needs_reauth. Every filter is an exact match and all of them must hold; a filter that is not listed here, or a value it cannot take, is 400 BAD_FILTER, never ignored. next is the cursor for the following page (null at the end). Never a secret. A key reads only its own mode's tenants (test or live); a tenant-scoped key only its own tenant's.

Query
tenantstringOnly this tenant's connections (your tenant id).
providerstring 1-120 charsOnly this provider, as a connection shows it (`slack`, `github`, …).
source"mcp" | "builtin" | "composio" | "record"Only connections of this kind.
status"pending" | "connected" | "needs_reauth" | "failed" | "disabled"Only connections in this status.
account_fingerprintstringOnly connections signed in as this provider account (a connection's `account_fingerprint`): the same account connected more than once.
metadataobject (map)Only connections whose metadata has every one of these pairs (sent as metadata[key]=value; up to 5).
limitinteger 1-200Default 50.
beforestringThe `next` cursor from the previous page.
Answer 200
items*Connection[]
next*string or nullThe cursor for the following page; null at the end.

Errors: NO_TENANT, BAD_FILTER

Examples
curl
curl "https://programmable.dev/v1/connections" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.searchConnections();
Python
pd.search_connections()

POST/v1/tenants/{tenant}/connections

Create a connection without a person

Only the non-interactive kinds: a builtin with its key (web_search, web_reader, apify) or a static-token MCP server. The secret is write-only. Anything that needs someone to sign in goes through a connect session (400 NEEDS_SESSION). A tenant holds at most 100 connections. Sends connection.connected with kind new.

Path: {tenant}

Body
source*"mcp" | "builtin"
providerstring 1-120 chars
labelstring 1-120 chars
configobject (map)
secretstring ≤ 4096 chars
metadataobject (map)Your own key/value pairs for the connection (strings). Returned on every read and filterable with metadata[key]=value; never shown to the person, sent to the service or put in events. Not for secrets.
Answer 201
connection*Connection

Errors: NO_TENANT, BAD_CONFIG, SECRET_REQUIRED, NEEDS_SESSION, CONNECTION_LIMIT, CREDENTIAL_STORE_UNAVAILABLE

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/connections" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"source":"builtin","provider":"web_search","config":{"engine":"brave"},"secret":"BRAVE_KEY"}'
TypeScript
await pd.createConnection("acme", {"source":"builtin","provider":"web_search","config":{"engine":"brave"},"secret":"BRAVE_KEY"});
Python
pd.create_connection("acme", {"source":"builtin","provider":"web_search","config":{"engine":"brave"},"secret":"BRAVE_KEY"})

POST/v1/tenants/{tenant}/connections/import

Import an existing OAuth grant

Moves a grant the person already gave elsewhere into a record connection, without a new sign-in. For the platform's own apps only, and off unless switched on for this service. The refresh token is used at the provider before anything is stored, and is write-only: never logged or returned. Answers 201 with imported: true, or 200 with imported: false and the existing connection when the tenant already has a connected one for that provider. At most 60 imports a minute per app.

Path: {tenant}

Body
provider*stringpattern ^[a-z0-9_]{1,64}$
refresh_token*string 1-4096 charspattern ^\S+$
scopestring ≤ 2000 chars
labelstring 1-120 chars
imported_fromstring 1-40 chars
Answer 201
connection*Connection
imported*boolean

Errors: NO_TENANT, IMPORT_DISABLED, IMPORT_NOT_ALLOWED, RECORD_NOT_LIVE, NO_CLIENT, OWN_CLIENT_REQUIRED, IMPORT_UNSUPPORTED, CONNECTION_LIMIT, IMPORT_REFRESH_REFUSED, IMPORT_TRANSIENT

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/connections/import" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.importConnection("acme", {});
Python
pd.import_connection("acme", {})

GET/v1/tenants/{tenant}/connections/{connection}

Get a connection

One connection. Another tenant's or app's id is a 404, like an unknown one.

Path: {tenant}{connection}

Answer 200
connection*Connection

Errors: NO_TENANT, NO_CONNECTION

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getConnection("acme", connectionId);
Python
pd.get_connection("acme", connection_id)

PATCH/v1/tenants/{tenant}/connections/{connection}

Rename a connection or change its metadata

Send label, metadata or both. label (1-120 characters) changes only what people see: the connection's tool names stay as they are (a tool prefix is fixed when it is first claimed). metadata is your own key/value pairs: metadata_mode: "merge" (the default) sets the keys you send and deletes those sent as null; "replace" makes the metadata exactly what you send. The result must stay within 20 keys (1-64 of A-Z a-z 0-9 _ . -, not __proto__), values of at most 512 characters and 4096 bytes of JSON (400 METADATA_LIMIT). Never put a secret in metadata: it is returned on every read.

Path: {tenant}{connection}

Body
labelstring 1-120 charsA new label (what people see). The connection's tool names stay as they are.
metadataobject (map)Keys to set (strings) or, in merge mode, delete (null).
metadata_mode"merge" | "replace"merge (default) or replace.
Answer 200
connection*Connection

Errors: NO_TENANT, NO_CONNECTION, BAD_CONFIG, METADATA_LIMIT

Examples
curl
curl -X PATCH "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.updateConnection("acme", connectionId, {});
Python
pd.update_connection("acme", connection_id, {})

DELETE/v1/tenants/{tenant}/connections/{connection}

Delete a connection

Revokes it at the provider (best effort), then deletes it with its tokens. Sends connection.revoked.

Path: {tenant}{connection}

Answer 200
ok*boolean
revoked_remote*booleanThe provider confirmed the revoke.

Errors: NO_TENANT, NO_CONNECTION

Examples
curl
curl -X DELETE "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.deleteConnection("acme", connectionId);
Python
pd.delete_connection("acme", connection_id)

GET/v1/tenants/{tenant}/connections/{connection}/health

How a connection is doing

Computed status (ok, expiring, needs_reauth, error), last refresh and use, last error, scopes, expiry and the background refresh's attempts. Never a token.

Path: {tenant}{connection}

Answer 200
health*ConnectionHealth

Errors: NO_TENANT, NO_CONNECTION

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/health" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getConnectionHealth("acme", connectionId);
Python
pd.get_connection_health("acme", connection_id)

POST/v1/tenants/{tenant}/connections/{connection}/test

Check a connection now

A light check: a provider connection refreshes if needed and makes its read call; other sources list their tools. Nothing is sent for a connection that is not connected (ok: false).

Path: {tenant}{connection}

Answer 200
ok*boolean
steps*string[]
health*ConnectionHealth

Errors: NO_TENANT, NO_CONNECTION, RATE_LIMITED

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/test" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.testConnection("acme", connectionId);
Python
pd.test_connection("acme", connection_id)

GET/v1/tenants/{tenant}/connections/{connection}/tool-changes

What changed in a connection's tool definitions

For a connection to an outside server (MCP or Composio). Lists the server's tools afresh and returns every tool whose definition is no longer the one that was accepted, or that is new since the grant was set: the description and title before and after, changed hints, a summary of the schema's top-level arguments, and the fingerprint of the definition shown. Show this to a person before accepting. For a provider or built-in connection pinned is false and the lists are empty.

Path: {tenant}{connection}

Answer 200: ToolChangeReview
connection*object
connection.id*string
connection.label*string
connection.provider*string
connection.source*"mcp" | "builtin" | "composio" | "record"
pinned*booleanFalse for a provider or built-in connection: its tools are ours, nothing is pinned.
changes*ToolChange[]
removed*object[]Accepted tools the server no longer lists. Nothing to accept.
removed[].tool*string
removed[].since*string (date-time) or null
checked_at*string (date-time)

Errors: NO_TENANT, NO_CONNECTION, NOT_CONNECTED, UNAVAILABLE, RATE_LIMITED

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/tool-changes" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.reviewToolChanges("acme", connectionId);
Python
pd.review_tool_changes("acme", connection_id)

POST/v1/tenants/{tenant}/connections/{connection}/tool-changes

Accept changed tool definitions

Accepts exactly the definitions you were shown: send each tool with the fingerprint from the review. The server's tools are listed afresh and compared; if any of them changed again (or is gone), nothing is accepted and the answer is 409 TOOL_CHANGED_AGAIN. Accepted tools are offered again at once, for every grant on the connection.

Path: {tenant}{connection}

Body
tools*object[] (≤ 400)
tools[].tool*string 1-200 chars
tools[].fingerprint*stringpattern ^[0-9a-f]{64}$

Errors: NO_TENANT, NO_CONNECTION, NOT_PINNED, BAD_REQUEST, NOT_CONNECTED, UNAVAILABLE, TOOL_CHANGED_AGAIN, RATE_LIMITED

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/tool-changes" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.acceptToolChanges("acme", connectionId, {});
Python
pd.accept_tool_changes("acme", connection_id, {})

GET/v1/tenants/{tenant}/connections/{connection}/events

Which provider events a connection forwards

The provider event types this connection sends you as provider.event webhooks. Off by default.

Path: {tenant}{connection}

Answer 200
events*EventSubscription

Errors: NO_TENANT, NO_CONNECTION

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/events" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getConnectionEvents("acme", connectionId);
Python
pd.get_connection_events("acme", connection_id)

PUT/v1/tenants/{tenant}/connections/{connection}/events

Choose the provider events a connection forwards

Replaces the list ([] = off, "*" = every type). Provider connections only (400 NOT_SUPPORTED otherwise). sync_reply lets this connection answer the record's synchronous event types.

Path: {tenant}{connection}

Body
types*string[] (≤ 50)
sync_replyboolean
Answer 200
events*EventSubscription

Errors: NO_TENANT, NO_CONNECTION, NOT_SUPPORTED

Examples
curl
curl -X PUT "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/events" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"types":["message"]}'
TypeScript
await pd.setConnectionEvents("acme", connectionId, {"types":["message"]});
Python
pd.set_connection_events("acme", connection_id, {"types":["message"]})

Providers

The services your users can connect, and the hosts the proxy may call.

GET/v1/providers

List the providers your users can connect

The live provider records in a public shape: what a "Connect X" picker needs. A weak ETag covers the set; send If-None-Match to get 304. Cached privately for 60 seconds. Grey out a provider with connectable: false.

Answer 200
items*Provider[]

304: Not modified since the ETag you sent.

Examples
curl
curl "https://programmable.dev/v1/providers" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.listProviders();
Python
pd.list_providers()

GET/v1/providers/{provider}

Get one provider

One live provider record. 404 for an unknown id or a record that is not live.

Path: {provider}

Answer 200
provider*Provider

Errors: NO_PROVIDER

Examples
curl
curl "https://programmable.dev/v1/providers/github" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getProvider("github");
Python
pd.get_provider("github")

Proxy

Your own server calls a provider's API through a connection. We add the credential; you never see it.

GET/v1/app/proxy

Is the proxy on for your app

The proxy is off until you turn it on. admin_locked: a platform admin turned it off and only they can turn it on.

Answer 200
proxy*ProxySettings
Examples
curl
curl "https://programmable.dev/v1/app/proxy" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getProxySettings();
Python
pd.get_proxy_settings()

PUT/v1/app/proxy

Turn the proxy on or off

Also sets the default daily cap per connection (default 1000).

Body
enabledboolean
daily_call_capinteger 0-100000
Answer 200
proxy*ProxySettings

Errors: PROXY_LOCKED

Examples
curl
curl -X PUT "https://programmable.dev/v1/app/proxy" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'
TypeScript
await pd.setProxySettings({"enabled":true});
Python
pd.set_proxy_settings({"enabled":True})

GET/v1/tenants/{tenant}/connections/{connection}/proxy/rules

A connection's proxy rules

The paths the proxy may call on this connection, and its own daily cap.

Path: {tenant}{connection}

Answer 200
rules*ProxyRules

Errors: NO_TENANT, NO_CONNECTION, NOT_RECORD_CONNECTION

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/proxy/rules" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getProxyRules("acme", connectionId);
Python
pd.get_proxy_rules("acme", connection_id)

PUT/v1/tenants/{tenant}/connections/{connection}/proxy/rules

Narrow the proxy on a connection

allow entries are "METHOD /prefix" (METHOD is GET, POST, PUT, PATCH, DELETE or *; at most 50). The prefix is a plain string prefix, so write GET /repos/ to mean under /repos/. null = no path restriction, [] = nothing. daily_call_cap: null = the app's default.

Path: {tenant}{connection}

Body
allow*(string ≤ 2010 chars)[] (≤ 50) or any or null
daily_call_capinteger 0-100000 or any or null
Answer 200
rules*ProxyRules

Errors: NO_TENANT, NO_CONNECTION, NOT_RECORD_CONNECTION, BAD_RULE, PROXY_LOCKED

Examples
curl
curl -X PUT "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/proxy/rules" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"allow":["GET /repos/"]}'
TypeScript
await pd.setProxyRules("acme", connectionId, {"allow":["GET /repos/"]});
Python
pd.set_proxy_rules("acme", connection_id, {"allow":["GET /repos/"]})

POST/v1/tenants/{tenant}/connections/{connection}/proxy

Call a provider's API through a connection

For your own server code. We add the connection's credential and send the request to the provider; you never see the token or key. path is relative to the provider's api_base_url and its host must be on the provider's allowed_hosts. Forwarded caller headers: Accept, Content-Type, If-Match, If-None-Match. Request body up to 1 MB, answer read to 2 MB, 25 seconds, redirects never followed. After a 401 an OAuth token is refreshed once and the request retried once. 120 calls per connection per minute, plus a daily cap, plus your app's and tenant's calls-a-minute ceilings (429 RATE_LIMITED with Retry-After). When the provider's host keeps failing (timeouts, dropped connections, 5xx), calls to it are refused at once for a short while with 503 PROVIDER_UNAVAILABLE and Retry-After: nothing is sent, nothing is capped or charged. Safe retries: send the request header Idempotency-Key (1 to 255 of letters, digits, _ - : .) with any request that is not a GET. A repeat of the same request under the same key within 24 hours returns the first answer (replayed: true, response header Idempotent-Replayed: true) without calling the provider, and is not capped or charged. A different request under the key is 409 IDEMPOTENCY_KEY_REUSED; a repeat while the first is running is 409 IDEMPOTENCY_IN_FLIGHT with Retry-After; an answer over 256 KB is returned once and repeats are 409 IDEMPOTENCY_RESULT_TOO_LARGE; when the request was sent but no answer came back, repeats are 409 IDEMPOTENCY_OUTCOME_UNKNOWN (it may have run: check at the provider, then use a new key). The key is ignored on a GET. For providers whose API has its own idempotency key (Stripe), a POST also carries one derived from yours.

Path: {tenant}{connection}

Body
method*"GET" | "POST" | "PUT" | "PATCH" | "DELETE"
path*string ≤ 2000 chars
queryobject (map)
headersobject (map)
bodystring
body_encoding"utf8" | "base64"
Answer 200: ProxyResult
call_id*string
status*integerThe provider's own status, including 3xx and 4xx.
headers*object (map)Allowlisted response headers only.
body*string
encoding*"utf8" | "base64"
truncated*booleanThe answer was over 2 MB and was cut.
dropped_headers*string[]Your headers that were not forwarded.
replayedbooleanTrue when this is the stored answer of an earlier request with the same Idempotency-Key: nothing was sent now.
original_call_idstringWith `replayed`: the call that actually ran.

Errors: BAD_IDEMPOTENCY_KEY, IDEMPOTENCY_KEY_REUSED, IDEMPOTENCY_IN_FLIGHT, IDEMPOTENCY_RESULT_TOO_LARGE, IDEMPOTENCY_OUTCOME_UNKNOWN, PROVIDER_UNAVAILABLE, NO_TENANT, BILLING_REQUIRED, PROXY_DISABLED, PATH_NOT_ALLOWED, NO_CONNECTION, NOT_RECORD_CONNECTION, NOT_CONNECTED, NEEDS_REAUTH, UNAVAILABLE, NO_API_BASE, BAD_REQUEST, BAD_PATH, BAD_HEADER, BAD_BODY, METHOD_OVERRIDE, HOST_NOT_ALLOWED, BODY_TOO_LARGE, RATE_LIMITED, DAILY_CAP, UPSTREAM_FAILED, REFRESH_FAILED, UPSTREAM_TIMEOUT

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/proxy" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method":"GET","path":"/user"}'
TypeScript
await pd.proxyRequest("acme", connectionId, {"method":"GET","path":"/user"});
Python
pd.proxy_request("acme", connection_id, {"method":"GET","path":"/user"})

Rate limits

Optional calls-a-minute ceilings for your app and its tenants. A call over a ceiling is refused at once and is not charged.

GET/v1/app/rate-limits

Your app's calls-a-minute ceilings

Your own numbers, what is in force, and the platform's ceiling.

Answer 200
rate_limits*AppRateLimits
Examples
curl
curl "https://programmable.dev/v1/app/rate-limits" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getRateLimits();
Python
pd.get_rate_limits()

PUT/v1/app/rate-limits

Set calls-a-minute ceilings

Optional ceilings on tool calls (MCP and REST) and proxy calls a minute, for the whole app and for each tenant. Each field: 1 to 100000, null to clear, left out to keep. You can lower your app's ceiling but not lift it past the platform's (platform in the answer). A call over a ceiling is refused before anything is sent: a tool call answers blocked with reason rate_limited and retry_after_s, a proxy call 429 RATE_LIMITED with Retry-After. Refused calls are not charged and do not count against daily caps. Minutes are counted one by one (fixed windows), so a burst across the turn of a minute can briefly reach twice a ceiling. A live key only.

Body
tool_calls_per_minuteinteger 1-100000 or any or nullTool calls a minute for the whole app (MCP and REST). null = the platform's ceiling.
proxy_calls_per_minuteinteger 1-100000 or any or nullProxy calls a minute for the whole app. null = the platform's ceiling.
tenant_tool_calls_per_minuteinteger 1-100000 or any or nullTool calls a minute for each tenant. null = no per-tenant ceiling.
tenant_proxy_calls_per_minuteinteger 1-100000 or any or nullProxy calls a minute for each tenant. null = no per-tenant ceiling.
Answer 200
rate_limits*AppRateLimits

Errors: TEST_KEY

Examples
curl
curl -X PUT "https://programmable.dev/v1/app/rate-limits" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.setRateLimits({});
Python
pd.set_rate_limits({})

GET/v1/tenants/{tenant}/rate-limits

One tenant's ceilings

The tenant's own numbers and what is in force for it.

Path: {tenant}

Answer 200
rate_limits*TenantRateLimits

Errors: NO_TENANT

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/rate-limits" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getTenantRateLimits("acme");
Python
pd.get_tenant_rate_limits("acme")

PUT/v1/tenants/{tenant}/rate-limits

Give one tenant its own ceilings

Instead of your per-tenant numbers. null goes back to them. Never above your app's ceiling.

Path: {tenant}

Body
tool_calls_per_minuteinteger 1-100000 or any or nullnull = the app's per-tenant ceiling.
proxy_calls_per_minuteinteger 1-100000 or any or nullnull = the app's per-tenant ceiling.
Answer 200
rate_limits*TenantRateLimits

Errors: NO_TENANT

Examples
curl
curl -X PUT "https://programmable.dev/v1/tenants/acme/rate-limits" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.setTenantRateLimits("acme", {});
Python
pd.set_tenant_rate_limits("acme", {})

Token read

Your server holds a connection's OAuth access token itself. Off until you turn it on.

GET/v1/app/token-read

Is token read on for your app

Token read is off until you turn it on.

Answer 200
token_read*TokenReadSettings
Examples
curl
curl "https://programmable.dev/v1/app/token-read" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getTokenReadSettings();
Python
pd.get_token_read_settings()

PUT/v1/app/token-read

Turn token read on or off

403 TOKEN_READ_LOCKED while a platform admin's "off" stands.

Body
enabled*boolean
Answer 200
token_read*TokenReadSettings

Errors: TOKEN_READ_LOCKED

Examples
curl
curl -X PUT "https://programmable.dev/v1/app/token-read" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'
TypeScript
await pd.setTokenReadSettings({"enabled":true});
Python
pd.set_token_read_settings({"enabled":True})

POST/v1/tenants/{tenant}/connections/{connection}/token

Read a connection's OAuth access token

For server code that must hold the token itself. The current access token of a provider connection that signs in with OAuth, refreshed first when under 5 minutes are left. Never the refresh token, never a pasted key, and never a token minted with our platform client (use the proxy for those). Prefer the proxy where it fits. 60 reads per connection per minute; every read is audited. The body is optional. force_refresh: true is for when the provider no longer takes the token you hold (revoked or rotated on their side while it still had time left): it is refreshed now. A token refreshed or issued in the last 30 seconds is returned as it is (refreshed: false), so several callers that saw the same rejection cause one refresh; at most 12 forced refreshes per connection an hour (429 RATE_LIMITED). A connection with no refresh token answers 409 UNAVAILABLE and stays connected; a refresh the provider refuses is 409 NEEDS_REAUTH, as for any read. A read follows your app's billing like a tool call: once the trial is over or the plan has ended it answers 402 BILLING_REQUIRED and hands out no token. A read is never counted or billed as a call.

Path: {tenant}{connection}

Body (optional)
force_refreshboolean
Answer 200: AccessToken
access_token*string
token_type*string
expires_at*string (date-time) or nullRead again before then rather than caching past it.
scopes*string[] or null
provider*string
connection_id*string
refreshed*booleanThis read refreshed the token.
api_base_url*string or nullThe provider's API base for THIS connection, with the connection's own values filled in (QuickBooks: `https://quickbooks.api.intuit.com/v3/company/<the company's id>`). Call the provider under it.
inputs*object (map)The values this connection runs with, by the record's input names: what the person typed on the connect page and the ids the provider gave at sign-in (Xero `tenant_id`: send it as `Xero-Tenant-Id`; QuickBooks `realm_id`; Atlassian `cloudid`). Ids and hosts, never a credential. `{}` when the record has none.

Errors: NO_TENANT, TOKEN_READ_DISABLED, NO_CONNECTION, NOT_RECORD_CONNECTION, NOT_CONNECTED, NEEDS_REAUTH, NOT_OAUTH, PLATFORM_CLIENT, UNAVAILABLE, RATE_LIMITED, REFRESH_FAILED, BILLING_REQUIRED

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/connections/$CONNECTION_ID/token" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.readAccessToken("acme", connectionId);
Python
pd.read_access_token("acme", connection_id)

Grants and tools

Which tools each agent may use, with daily caps and approvals; call them over REST or MCP.

GET/v1/app/default-grants

Your app's default grant policy

Off until you turn it on.

Answer 200
default_grants*DefaultGrants
Examples
curl
curl "https://programmable.dev/v1/app/default-grants" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getDefaultGrants();
Python
pd.get_default_grants()

PUT/v1/app/default-grants

Give every actor a default grant on every connection of its tenant

For apps whose actors are a person's agents: on, every actor gets a grant on every connected connection of its tenant, made by Dev when the actor is created and when a connection is first connected, so you never re-send grants when someone connects something. A default never changes a grant that exists: what your app or a person set wins, and a grant that was removed is not brought back when its connection is signed in again. Default grants show source: "default" until someone sets them. A default must ask (or block) before write and destructive calls (400 UNSAFE_DEFAULT otherwise); it always has approval on. Changing it brings grants still source: "default" to the new policy at once (within each tenant's own, PUT /v1/tenants/:t/default-grants). Send { "policy": null } to turn it off: new defaults stop, the grants already made stay. A live key only.

Body
policy*object or any or null
policy.kind_policy*object
policy.daily_call_capinteger 0-100000
policy.daily_spend_cap_usdnumber 0-100000 or any or null
policy.payload"full" | "result_only" | "none"
Answer 200
default_grants*DefaultGrants

Errors: UNSAFE_DEFAULT

Examples
curl
curl -X PUT "https://programmable.dev/v1/app/default-grants" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.setDefaultGrants({});
Python
pd.set_default_grants({})

GET/v1/tenants/{tenant}/default-grants

A tenant's default grant policy, and what is in force

policy: the tenant's own (null = your app's applies). effective: what new and default grants in this tenant get now (the stricter of the two, field by field; null while your app's policy is off). app: your app's, the ceiling.

Path: {tenant}

Answer 200
default_grants*TenantDefaultGrants

Errors: NO_TENANT

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/default-grants" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getTenantDefaultGrants("acme");
Python
pd.get_tenant_default_grants("acme")

PUT/v1/tenants/{tenant}/default-grants

Set a tenant's own default grant policy, under your app's

For one person's "what my agents may do without asking". Same shape as your app's. It may be stricter than your app's, or as loose, never looser: per kind block < ask < allow, the daily call cap no higher, the spend cap no higher when your app sets one (400 ABOVE_APP_DEFAULT). Write and destructive still ask or block (400 UNSAFE_DEFAULT). Needs your app's policy on (409 DEFAULTS_OFF). The tenant's grants still source: "default" follow it at once; grants someone set are never touched. { "policy": null } goes back to your app's. A tenant-scoped key can read but not change it (403 KEY_SCOPED).

Path: {tenant}

Body
policy*object or any or null
policy.kind_policy*object
policy.daily_call_capinteger 0-100000
policy.daily_spend_cap_usdnumber 0-100000 or any or null
policy.payload"full" | "result_only" | "none"
Answer 200
default_grants*TenantDefaultGrants

Errors: NO_TENANT, KEY_SCOPED, UNSAFE_DEFAULT, ABOVE_APP_DEFAULT, DEFAULTS_OFF

Examples
curl
curl -X PUT "https://programmable.dev/v1/tenants/acme/default-grants" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.setTenantDefaultGrants("acme", {});
Python
pd.set_tenant_default_grants("acme", {})

GET/v1/tenants/{tenant}/actors/{actor}/grants

An actor's grants

Which connections (and which of their tools) this agent may use, with caps and approval settings.

Path: {tenant}{actor}

Answer 200
grants*Grant[]

Errors: NO_TENANT, NO_ACTOR

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/actors/support-bot/grants" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.listGrants("acme", "support-bot");
Python
pd.list_grants("acme", "support-bot")

PUT/v1/tenants/{tenant}/actors/{actor}/grants

Replace an actor's grants

Replaces the whole set ([] removes every grant). Defaults: daily_call_cap 20, requires_approval true. approve_by_link also sends each approval to an email address or mobile number as a page anyone holding the link can decide; left out, a grant keeps its current target (GET shows it masked), null turns it off, and requires_approval: false drops it. Finer rules, all optional and all replaced with the set: kind_policy (reads / writes / destructive calls each allow, ask or block), tool_rules (per tool: its kind, action, own daily cap, argument limits, payload, result masking and filtering), resources (argument limits by name for every tool), resources_strict (offer only the tools every one of those limits is required on),daily_spend_cap_usd, payload, expires_at (a future time; the grant then gives nothing), trust_read_hints, mcp_resources, mcp_prompts and mcp_ui (open an MCP server's resources / prompt templates / app UI to the actor; default false).

Path: {tenant}{actor}

Body
grants*object[] (≤ 200)
grants[].connection_id*string (uuid)pattern ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
grants[].tools(string 1-200 chars)[] (≤ 100) or any or null
grants[].daily_call_capinteger 0-100000
grants[].requires_approvalboolean
grants[].approve_by_linkobject or any or null
grants[].kind_policyobject or any or null
grants[].trust_read_hintsboolean
grants[].tool_rulesobject (map) or any or null
grants[].resourcesobject (map) or any or null
grants[].resources_strictboolean
grants[].daily_spend_cap_usdnumber 0-100000 or any or null
grants[].payload"full" | "result_only" | "none"
grants[].mcp_resourcesboolean
grants[].mcp_promptsboolean
grants[].mcp_uiboolean
grants[].expires_atstring (date-time) or any or null
grants[].on_tool_change"hold" | "ask" | "allow" or any or null
Answer 200
grants*Grant[]

Errors: NO_TENANT, NO_ACTOR, NO_CONNECTION, DUPLICATE, TOO_MANY, BAD_ID, BAD_GRANT, LINK_OFF, BAD_LINK, LINK_NOT_ALLOWED

Examples
curl
curl -X PUT "https://programmable.dev/v1/tenants/acme/actors/support-bot/grants" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"grants":[{"connection_id":"$CONNECTION_ID","daily_call_cap":50,"requires_approval":true}]}'
TypeScript
await pd.setGrants("acme", "support-bot", {"grants":[{"connection_id":"$CONNECTION_ID","daily_call_cap":50,"requires_approval":true}]});
Python
pd.set_grants("acme", "support-bot", {"grants":[{"connection_id":"$CONNECTION_ID","daily_call_cap":50,"requires_approval":True}]})

GET/v1/tenants/{tenant}/actors/{actor}/tools

An actor's tools

Exactly what the MCP endpoint lists for this actor, for apps that don't speak MCP. Only connected connections; descriptions are the service's own words, wrapped as untrusted. discovery says how the list is offered: while active (tool discovery on, or auto over its threshold), tools is the three built-in tools the agent is listed (builtin: true), and callTool runs them; view=all gives every definition whatever the mode. With access requests on (setAccessRequests), request_access is listed last in either view, also builtin: true.

Path: {tenant}{actor}

Query
view"agent" | "all"`agent` (the default): what the agent is listed. `all`: every definition, also in discovery mode.
Answer 200
tools*Tool[]
held*HeldTool[]Granted tools that are not offered until their changed definition is accepted.
discovery*object
discovery.mode*"off" | "on" | "auto"
discovery.threshold*integer or null
discovery.active*booleanThe list is the built-in tools right now.
discovery.tool_count*integerHow many tools the actor is offered.

Errors: NO_TENANT, NO_ACTOR, BAD_FILTER

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/actors/support-bot/tools" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.listTools("acme", "support-bot");
Python
pd.list_tools("acme", "support-bot")

GET/v1/tenants/{tenant}/actors/{actor}/tool-discovery

How an actor's tools are offered

The actor's tool discovery setting. off until you set it.

Path: {tenant}{actor}

Answer 200
tool_discovery*ToolDiscovery

Errors: NO_TENANT, NO_ACTOR

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/actors/support-bot/tool-discovery" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getToolDiscovery("acme", "support-bot");
Python
pd.get_tool_discovery("acme", "support-bot")

PUT/v1/tenants/{tenant}/actors/{actor}/tool-discovery

Turn tool discovery on or off for an actor

For an agent with a very large tool list. on: the agent is listed three built-in tools instead of every definition: search_tools (words in, matching tool names with a one-line summary, kind and approval setting out), describe_tool (one tool's full definition) and call_tool ({ name, input }: the call itself, under exactly the named tool's grant, caps, limits and approval; your call history names the real tool). auto: the same, but only while the actor is offered more than threshold tools (40 when left out). off: every definition, as before. A tool's own name can always be called directly. Search and describe only ever show what the actor's grants offer; they call no service, are not logged as calls and are limited to 60 a minute per actor.

Path: {tenant}{actor}

Body
mode*"off" | "on" | "auto"
thresholdinteger 1-10000
Answer 200
tool_discovery*ToolDiscovery

Errors: NO_TENANT, NO_ACTOR

Examples
curl
curl -X PUT "https://programmable.dev/v1/tenants/acme/actors/support-bot/tool-discovery" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.setToolDiscovery("acme", "support-bot", {});
Python
pd.set_tool_discovery("acme", "support-bot", {})

GET/v1/tenants/{tenant}/actors/{actor}/tools/search

Search an actor's tools

The search an agent runs with search_tools, for your own agent loop: words over each tool's name, title, description and connection, best match first. Works whatever the actor's discovery mode. A tool the actor's grants block, hide or hold is never found. Nothing is called.

Path: {tenant}{actor}

Query
qstring ≤ 200 charsWords about what the tool should do, or part of its name. Left out: every tool, in list order.
kind"read" | "write" | "destructive"Only tools of this kind.
connectionstringOnly one connection's tools: its id, its tool-name prefix or its provider.
limitinteger 1-25Default 10.
cursorstring`next_cursor` from the page before, with the same filters.
Answer 200
results*ToolSearchResult[]
total*integerEvery tool the search matched, over all pages.
next_cursor*string or nullThe cursor for the following page; null at the end.
unavailable*object[]Granted connections that can't be listed right now, so were not searched.
unavailable[].id*string
unavailable[].label*string
unavailable[].provider*string
unavailable[].source*"mcp" | "builtin" | "composio" | "record"

Errors: NO_TENANT, NO_ACTOR, BAD_FILTER

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/actors/support-bot/tools/search" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.searchTools("acme", "support-bot");
Python
pd.search_tools("acme", "support-bot")

GET/v1/tenants/{tenant}/actors/{actor}/tools/describe

One tool's definition

One tool by name, exactly as listTools gives it: what describe_tool answers an agent. status is ok (with tool), held (with held: the grant holds the tool until its changed definition is accepted, so no definition is given) or unavailable (its connection can't be listed right now). A name the actor is not offered is 404, whatever the reason.

Path: {tenant}{actor}

Query
namestring 1-200 charsThe tool's name. Required.
Answer 200
status*"ok" | "held" | "unavailable"
toolTool
heldHeldTool
connectionobject
connection.id*string
connection.label*string
connection.provider*string
connection.source*"mcp" | "builtin" | "composio" | "record"

Errors: NO_TENANT, NO_ACTOR, BAD_FILTER, UNKNOWN_TOOL

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/actors/support-bot/tools/describe" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.describeTool("acme", "support-bot");
Python
pd.describe_tool("acme", "support-bot")

POST/v1/tenants/{tenant}/actors/{actor}/tools/call

Call a tool

One call over REST, through exactly the checks MCP uses: the tool, billing, the input (16 KB), the daily cap and approval. Answers 200 for every outcome; read status. needs_approval did not run. timed_out may have completed, so check before retrying a write. dry_run: true runs every check and then sends nothing. cost_label (1 to 64 of A-Z a-z 0-9 . _ : -) is your own cost-centre label: it is kept on the call and usage groups by it (by_label, the calls list, the CSV); it never changes what is allowed. Over MCP, send it as _meta["you.programmable.dev/cost_label"]. For an actor with tool discovery set, name may also be a built-in: call_tool with input: { name, input } is the call of the tool it names (same checks, same answer); search_tools and describe_tool answer ok or blocked with structured_content and no call_id. With access requests on, name may be request_access (input: { provider, tools?, reason? }): it calls no service and logs no call, sends your webhook an access.requested event, and answers ok with structured_content.status (requested, granted, choose with ids to pick from, or not_delivered), or blocked with reason bad_input or rate_limited.

Path: {tenant}{actor}

Body
name*string 1-200 chars
inputobject (map)
dry_runboolean
cost_labelstringpattern ^[A-Za-z0-9._:-]{1,64}$
Answer 200: CallResult
status*"ok" | "tool_error" | "needs_approval" | "blocked" | "error" | "timed_out" | "dry_run"
call_idstring (uuid)The call's id in your call history. Absent only on an answer of search_tools, describe_tool or request_access, which call no service and are not logged as calls.
content*stringThe service's answer as text, wrapped as <untrusted-data>…</untrusted-data> and clipped to 32 KB; or why it did not run. With `blocks`, the same result as one text (a short line of ours for each part that is not text).
blocksResultBlock[]ok / tool_error from a service that answers in content blocks (a vendor MCP server): the result part by part, in the service's order. At most 50 parts are looked at. Absent under a grant with `payload: none`; under a `result` rule, a part the rule cannot be applied to (an image, a link, a text that is not JSON) is replaced by a note.
structured_contentobject (map)From search_tools: `{ status, results, total, next_cursor, unavailable }`; from describe_tool: `{ status, tool }`; from request_access: `{ status, provider?, request_id?, candidates? }`. Otherwise the service's structured result (MCP `structuredContent`): a JSON object of at most 64 KB and 32 levels, values as the service sent them (outside data: wrap it before a model reads it), after the grant's `result` rule (a masked field is masked here too). It fits the tool's `output_schema` when one is listed.
is_error*boolean
cost_usd*numberWhat this call booked, clamped to $1; 0 when nothing ran.
reasonstringWhy a blocked call was refused: bad_input, input_too_large, argument_not_allowed, daily_cap, spend_cap (the grant's daily dollar cap), actor_monthly_spend_cap, tenant_daily_spend_cap, tenant_monthly_spend_cap, app_monthly_spend_cap (the spending limits, see Usage), source_unavailable, approval_input_too_large, approval_queue_full, app_disabled, rate_limited (over a calls-a-minute ceiling, or too many dry runs), provider_unavailable (the provider's host keeps failing; nothing was sent), tool_changed (the tool's definition changed since it was accepted and the grant holds it: accept the change first).
retry_after_sintegerWith reason rate_limited or provider_unavailable: seconds to wait before trying again.
approvalobject
approval.id*string
approval.digest*string
approval.expires_at*string (date-time)
dry_runboolean
would"run" | "needs_approval"
checksobject
checks.requires_approval*boolean
checks.kind*"read" | "write" | "destructive"
checks.daily_call_cap*integer
checks.calls_today*integer
checks.tool_daily_call_capinteger
checks.tool_calls_todayinteger
checks.daily_spend_cap_usdnumber
checks.spent_today_usdnumber
checks.host_daily_capinteger
checks.host_calls_todayinteger
checks.spend_limitsobject[]The spending limits this call meets, narrow to wide; absent when none is set.
checks.tool_changedbooleanThe tool's definition is not the accepted one and the grant offers it anyway.

Errors: NO_TENANT, NO_ACTOR, UNKNOWN_TOOL, BILLING_REQUIRED, BAD_TOOL_CALL

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/actors/support-bot/tools/call" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"github__list_issues","input":{"repo":"acme/web"}}'
TypeScript
await pd.callTool("acme", "support-bot", {"name":"github__list_issues","input":{"repo":"acme/web"}});
Python
pd.call_tool("acme", "support-bot", {"name":"github__list_issues","input":{"repo":"acme/web"}})

Approvals

Calls waiting for a person to say yes.

GET/v1/tenants/{tenant}/approvals

A tenant's approvals

Pending ones oldest first, otherwise newest first. Pending approvals expire after 24 hours.

Path: {tenant}

Query
status"pending" | "approved" | "rejected" | "expired" | "all"Default pending.
limitinteger 1-200Default 100.
Answer 200
items*Approval[]

Errors: NO_TENANT

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/approvals" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.listApprovals("acme");
Python
pd.list_approvals("acme")

POST/v1/approvals/{approval}/decide

Approve or reject a call

Approving needs the digest you showed the person, so they approve exactly what they saw. An approved call runs once, now, with every cap still applied; its outcome is in approval.run. To approve with edits, also send input: the tool's whole input as it should run. It must pass what a fresh call would (the tool's schema, the grant's limits); the approval you asked about becomes superseded, and the one that comes back is a new approval with its own id and digest, edited: true and the names of the changed arguments. Pass its edit_notice to the agent. A request cannot be edited. Works with an app key or an approval key.

Path: {approval}

Body
decision*"approve" | "reject"
digeststringpattern ^[0-9a-f]{64}$
inputobject (map)
tenantstring 1-128 chars
decided_bystring 1-128 chars
notestring ≤ 500 chars
Answer 200
approval*Approval

Errors: NO_APPROVAL, NO_DIGEST, DIGEST_MISMATCH, DECIDED, EXPIRED, APP_DISABLED, BAD_EDIT, NOT_EDITABLE, APPROVAL_KEY

Examples
curl
curl -X POST "https://programmable.dev/v1/approvals/$APPROVAL_ID/decide" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"decision":"approve","digest":"$DIGEST"}'
TypeScript
await pd.decideApproval(approvalId, {"decision":"approve","digest":"$DIGEST"});
Python
pd.decide_approval(approval_id, {"decision":"approve","digest":"$DIGEST"})

GET/v1/approvals

Your app's approvals, across tenants

For one place that decides everything: the approvals of all your tenants (of the key's mode), or of one with tenant. Pending ones oldest first, otherwise newest first. An approval key can list pending ones only.

Query
status"pending" | "approved" | "rejected" | "expired" | "all"Default pending.
tenantstringYour tenant id, to list one tenant only.
limitinteger 1-200Default 100.
Answer 200
items*Approval[]

Errors: NO_TENANT, APPROVAL_KEY

Examples
curl
curl "https://programmable.dev/v1/approvals" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.listAppApprovals();
Python
pd.list_app_approvals()

POST/v1/tenants/{tenant}/approvals

Ask a person before an action

Before an action your app runs itself (send, spend, delete, change or other), ask a person. title is the line they read first; details is shown in full as pretty JSON (at most 4,000 characters). Answers 201 with the approval, its approve_url and digest, and sends approval.needed. Approving runs nothing: once status is approved, spend the yes with useApproval, then act. At most 50 requests wait per tenant.

Path: {tenant}

Body
actor*string 1-128 chars
action*"send" | "spend" | "delete" | "change" | "other"
title*string 1-200 chars
detailsobject (map)
Answer 201
approval*Approval

Errors: NO_TENANT, NO_ACTOR, DETAILS_TOO_LONG, APP_DISABLED, REQUEST_QUEUE_FULL

Examples
curl
curl -X POST "https://programmable.dev/v1/tenants/acme/approvals" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.createApprovalRequest("acme", {});
Python
pd.create_approval_request("acme", {})

GET/v1/approvals/{approval}

One approval

One of your app's approvals (a gated call or a request), for polling a decision without listing a whole tenant. tenant, when sent, must be the approval's.

Path: {approval}

Query
tenantstringYour tenant id; when sent, the approval must be in it.
Answer 200
approval*Approval

Errors: NO_APPROVAL

Examples
curl
curl "https://programmable.dev/v1/approvals/$APPROVAL_ID" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getApproval(approvalId);
Python
pd.get_approval(approval_id)

POST/v1/approvals/{approval}/use

Spend an approved request

Right before your app does the action, spend the yes once with the request's digest. Answers 200 with the approval (used_at set). Anything but 200 means: do not act. A yes can be used once, within 24 hours of the decision; a gated tool call already ran when approved and can't be used.

Path: {approval}

Body
digest*stringpattern ^[0-9a-f]{64}$
tenantstring 1-128 chars
Answer 200
approval*Approval

Errors: NO_APPROVAL, NOT_APPROVED, ALREADY_USED, USE_EXPIRED, DIGEST_MISMATCH, NOT_A_REQUEST, APP_DISABLED

Examples
curl
curl -X POST "https://programmable.dev/v1/approvals/$APPROVAL_ID/use" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.useApproval(approvalId, {});
Python
pd.use_approval(approval_id, {})

Usage

Calls, outcomes and cost; spending limits per app, tenant and actor.

GET/v1/tenants/{tenant}/usage

Calls and cost

Calls, outcomes and cost by UTC day, connection, actor and your own cost label (by_label).

Path: {tenant}

Query
daysinteger 1-400Default 30.
Answer 200: Usage
from*string
to*string
totals*UsageTotals
by_day*object[]
by_connection*object[]
by_actor*object[]
by_label*object[]

Errors: NO_TENANT

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/usage" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getUsage("acme");
Python
pd.get_usage("acme")

GET/v1/tenants/{tenant}/usage.csv

The tenant's calls as a CSV file

Every gateway and proxy call of the tenant in a time range, newest first, one row each, as a CSV file (RFC 4180, UTF-8, no byte-order mark, a header line first). Columns: time, call_id, tenant, actor, tool, connection_id, connection_label, connection_provider, channel, outcome, reason, mode, cost_usd, duration_ms, approval_id, cost_label. Never an input or a result. from is inclusive and to exclusive; a bare date for to means the end of that UTC day. Default: the last 30 days; at most 90 days and 50,000 rows a file. A cut file keeps the newest rows, ends its name in -partial.csv and answers X-Export-Truncated: true with X-Export-Next-Before: send that as before with the same range for the next, older file. A cell a spreadsheet would read as a formula (starting with = + - @, tab or CR) starts with a single quote. A key reads only its own mode's calls; a tenant-scoped key only its own tenant. 6 exports a minute per tenant.

Path: {tenant}

Query
fromstring ≤ 40 charsStart, inclusive: YYYY-MM-DD (UTC) or a date-time with a zone. Default 30 days before `to`.
tostring ≤ 40 charsEnd, exclusive: YYYY-MM-DD (the end of that UTC day) or a date-time with a zone. Default now.
beforestringThe X-Export-Next-Before cursor of the previous, cut file.

Answer 200: a text/csv file. The SDKs return { csv, truncated, next_before }.

Errors: NO_TENANT, BAD_FILTER, RATE_LIMITED

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/usage.csv" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.exportUsageCsv("acme");
Python
pd.export_usage_csv("acme")

GET/v1/app/spend-limits

Your app's monthly spending limit

The most everything your app's agents may spend on tool calls in a UTC calendar month, with what is booked so far. monthly is null until you set one.

Answer 200
spend_limits*object
spend_limits.monthly*SpendLimit or any or null
Examples
curl
curl "https://programmable.dev/v1/app/spend-limits" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getAppSpendLimits();
Python
pd.get_app_spend_limits()

PUT/v1/app/spend-limits

Set your app's monthly spending limit

monthly: { cap_usd, warn_percent? } sets it, monthly: null removes it. Checked before every call, with calls still running counted at their expected price: a service with a fixed price per call can never pass it; where the cost is only reported afterwards, only a tool's first call that ever costs can, once. Past it a call is blocked, reason app_monthly_spend_cap. warn_percent (default 80, null for none): spend.warning is sent once per month when booked spend first reaches that share, and the app's owners get one email; spend.cap_reached once when the limit first refuses a call. This is what tool calls cost at the services, not your plan here. Needs a live key.

Body
monthly*object or any or null
monthly.cap_usd*number 0-100000
monthly.warn_percentinteger 1-99 or any or null
Answer 200
spend_limits*object
spend_limits.monthly*SpendLimit or any or null

Errors: TEST_KEY

Examples
curl
curl -X PUT "https://programmable.dev/v1/app/spend-limits" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.setAppSpendLimits({});
Python
pd.set_app_spend_limits({})

GET/v1/tenants/{tenant}/spend-limits

A tenant's spending limits

The most this tenant's actors together may spend on tool calls per UTC day and per UTC calendar month, with what is booked so far. Each is null until set.

Path: {tenant}

Answer 200
spend_limits*object
spend_limits.daily*SpendLimit or any or null
spend_limits.monthly*SpendLimit or any or null

Errors: NO_TENANT

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/spend-limits" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getTenantSpendLimits("acme");
Python
pd.get_tenant_spend_limits("acme")

PUT/v1/tenants/{tenant}/spend-limits

Set a tenant's spending limits

"This customer of mine may spend $X." daily and monthly each take { cap_usd, warn_percent? } or null to remove; one left out keeps its value. Enforced like the app's limit; past one a call is blocked, reason tenant_daily_spend_cap or tenant_monthly_spend_cap. When several limits would refuse a call, the reason names the one with the least left. Warnings and events as for the app's limit, with the tenant on the event. A tenant-scoped key can read these but not change them.

Path: {tenant}

Body
dailyobject or any or null
daily.cap_usd*number 0-100000
daily.warn_percentinteger 1-99 or any or null
monthlyobject or any or null
monthly.cap_usd*number 0-100000
monthly.warn_percentinteger 1-99 or any or null
Answer 200
spend_limits*object
spend_limits.daily*SpendLimit or any or null
spend_limits.monthly*SpendLimit or any or null

Errors: NO_TENANT, KEY_SCOPED

Examples
curl
curl -X PUT "https://programmable.dev/v1/tenants/acme/spend-limits" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.setTenantSpendLimits("acme", {});
Python
pd.set_tenant_spend_limits("acme", {})

GET/v1/tenants/{tenant}/actors/{actor}/spend-limits

An actor's monthly spending limit

The most this one actor may spend on tool calls in a UTC calendar month, over every connection. Null until set.

Path: {tenant}{actor}

Answer 200
spend_limits*object
spend_limits.monthly*SpendLimit or any or null

Errors: NO_TENANT, NO_ACTOR

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/actors/support-bot/spend-limits" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getActorSpendLimits("acme", "support-bot");
Python
pd.get_actor_spend_limits("acme", "support-bot")

PUT/v1/tenants/{tenant}/actors/{actor}/spend-limits

Set an actor's monthly spending limit

monthly: { cap_usd, warn_percent? } sets it, monthly: null removes it. A grant's own daily_spend_cap_usd (one connection, one day) still applies beside it. Past it a call is blocked, reason actor_monthly_spend_cap. A tenant-scoped key can read it but not change it.

Path: {tenant}{actor}

Body
monthly*object or any or null
monthly.cap_usd*number 0-100000
monthly.warn_percentinteger 1-99 or any or null
Answer 200
spend_limits*object
spend_limits.monthly*SpendLimit or any or null

Errors: NO_TENANT, NO_ACTOR, KEY_SCOPED

Examples
curl
curl -X PUT "https://programmable.dev/v1/tenants/acme/actors/support-bot/spend-limits" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.setActorSpendLimits("acme", "support-bot", {});
Python
pd.set_actor_spend_limits("acme", "support-bot", {})

Call history

Each call a tenant's agents and your proxy made, one at a time.

GET/v1/app/history

How much of each call your app keeps, and for how long

The default is summary for 90 days.

Answer 200
history*HistorySettings
Examples
curl
curl "https://programmable.dev/v1/app/history" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getHistorySettings();
Python
pd.get_history_settings()

PUT/v1/app/history

Choose how much of each call to keep, and for how long

keep: summary or full. days: 30 to 400 (a call's row itself is deleted after 400 days). Send either or both; what you leave out stays. A live key only. full applies to calls made from now on and never overrides a grant: a grant with payload result_only keeps no input, and none keeps nothing. Going back to summary stops new full content at once; what was kept stays until its days run out, or you delete the tenant or actor. A shorter days clears older content at the next daily clean-up.

Body
keep"summary" | "full"
daysinteger 30-400
Answer 200
history*HistorySettings
Examples
curl
curl -X PUT "https://programmable.dev/v1/app/history" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.setHistorySettings({});
Python
pd.set_history_settings({})

GET/v1/tenants/{tenant}/calls

A tenant's calls

Every gateway and proxy call of the tenant, newest first. next is the cursor for the following page (null at the end). No inputs or results here; getCall has them for one call. An actor the tenant doesn't have gives an empty list. A key reads only its own mode's calls (test or live).

Path: {tenant}

Query
actorstringOnly this actor's calls (your actor id).
outcome"running" | "ok" | "tool_error" | "error" | "timed_out" | "cancelled" | "blocked" | "needs_approval" | "dry_run"Only calls with this outcome.
channel"mcp" | "rest" | "approval" | "proxy"Only calls made this way.
toolstring 1-200 charsOnly calls to this tool.
cost_labelstringOnly calls with this cost label.
limitinteger 1-200Default 50.
beforestringThe `next` cursor from the previous page.
Answer 200
items*CallEntry[]
next*string or nullThe cursor for the following page; null at the end.

Errors: NO_TENANT, BAD_FILTER

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/calls" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.listCalls("acme");
Python
pd.list_calls("acme")

GET/v1/calls/{call}

One call

One of your app's calls by the call_id every outcome returns, with what it was given (input_summary) and what came back (result_preview, the service's text: untrusted). Both are clipped, and become null once your history window has passed (90 days unless you set another with PUT /v1/app/history). An app that keeps full history also gets the whole of each in input and result. A grant whose payload keeps nothing still keeps nothing. tenant, when sent, must be the call's. Another app's call is a 404, like an unknown one. A key reads only its own mode's calls; a tenant-scoped key only its own tenant's.

Path: {call}

Query
tenantstringYour tenant id; when sent, the call must be in it.
Answer 200
call*CallDetail

Errors: NO_CALL

Examples
curl
curl "https://programmable.dev/v1/calls/call" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getCall("call");
Python
pd.get_call("call")

Webhooks

Events sent to your server, signed with your secret.

GET/v1/app/webhook

Where your events go

Your webhook URL, event filter and signature format. Never the secret.

Answer 200
webhook*WebhookSettings
Examples
curl
curl "https://programmable.dev/v1/app/webhook" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getWebhook();
Python
pd.get_webhook()

PUT/v1/app/webhook

Set your webhook URL

A public https address (null clears it). The signing secret (whsec_…) is created the first time, or with rotate_secret, and returned only then. events chooses which event types you receive: exact types (approval.needed) and families (connection.*); null means every type, which is the default; leave it out to keep the filter. An event your filter leaves out is never queued, so it is not retried and not listed. A type we do not send is refused, so a typo cannot silently drop events. signature_format chooses what X-Programmable-Signature carries (suite: t=,v1=; legacy: sha256=); leave it out to keep it. X-Programmable-Signature-V2 carries the t=,v1= value in both.

Body
url*string (uri) ≤ 2000 chars or any or null
rotate_secretboolean
events(string ≤ 100 chars)[] (≤ 40) or any or nullWhich event types to receive: exact types (approval.needed) and families (connection.*). null = every type (the default). Leave it out to keep the filter as it is.
signature_format"legacy" | "suite"What the X-Programmable-Signature header carries: suite = t=<unix seconds>,v1=<hex HMAC-SHA256(secret, "<t>.<raw body>")> (the Programmable suite's format, and what a newly registered app starts with), legacy = sha256=<hex HMAC-SHA256(secret, raw body)> (what an app registered before this setting existed keeps until it switches). GET /v1/app/webhook says which yours is. X-Programmable-Signature-V2 carries the t=,v1= value in both. Leave it out to keep it as it is.
Answer 200
webhook*WebhookSettings
secretstringwhsec_…, only when created or rotated.

Errors: BAD_URL, BAD_EVENT_TYPES

Examples
curl
curl -X PUT "https://programmable.dev/v1/app/webhook" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://app.example.com/hooks/programmable"}'
TypeScript
await pd.setWebhook({"url":"https://app.example.com/hooks/programmable"});
Python
pd.set_webhook({"url":"https://app.example.com/hooks/programmable"})

GET/v1/app/webhooks/stats

Provider webhook counts

Provider webhooks routed to your own connections: matched, not subscribed, and forwarded as provider.event. Counts only.

Query
daysinteger 1-400Default 30.
Answer 200: WebhookStats
days*integer
providers*object[]
providers[].provider*string
providers[].connections*integer
providers[].matched*integer
providers[].unsubscribed*integer
providers[].forwarded*integer
providers[].last_received_at*string (date-time) or null
connections*object[]
connections[].connection_id*string
connections[].tenant*string
connections[].provider*string
connections[].label*string
connections[].matched*integer
connections[].unsubscribed*integer
connections[].forwarded*integer
connections[].last_received_at*string (date-time) or null
Examples
curl
curl "https://programmable.dev/v1/app/webhooks/stats" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getWebhookStats();
Python
pd.get_webhook_stats()

Your OAuth clients

Register your own OAuth client so the consent screen names your app.

GET/v1/app/providers

Your own OAuth clients

OAuth clients you registered so the provider's consent screen names your app. Never a secret.

Answer 200: AppClients
require_own_client*boolean
clients*AppClient[]
Examples
curl
curl "https://programmable.dev/v1/app/providers" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.listAppClients();
Python
pd.list_app_clients()

PATCH/v1/app/providers

Require your own OAuth clients

With require_own_client, a connect for a provider where you have no client is refused (409 OWN_CLIENT_REQUIRED) instead of using ours.

Body
require_own_client*boolean
Answer 200: AppClients
require_own_client*boolean
clients*AppClient[]
Examples
curl
curl -X PATCH "https://programmable.dev/v1/app/providers" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"require_own_client":true}'
TypeScript
await pd.setRequireOwnClient({"require_own_client":true});
Python
pd.set_require_own_client({"require_own_client":True})

GET/v1/app/providers/{provider}/client

Your OAuth client for a provider

Includes the redirect URI to register at the provider.

Path: {provider}

Answer 200
client*AppClient

Errors: NO_CLIENT

Examples
curl
curl "https://programmable.dev/v1/app/providers/github/client" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getAppClient("github");
Python
pd.get_app_client("github")

PUT/v1/app/providers/{provider}/client

Register your OAuth client for a provider

Secrets are write-only (omitted = kept for the same client_id). A new client_id becomes the active one; the old one keeps serving connections signed in with it.

Path: {provider}

Body
client_id*string 1-512 chars
client_secretstring 1-4096 chars
webhook_secretstring 8-4096 chars
clear_webhook_secretboolean
private_keystring 1-8192 chars
private_key_idstringpattern ^[A-Za-z0-9._:+/=-]{1,200}$
clear_private_keyboolean
app_tokenstring 8-4096 chars
clear_app_tokenboolean
install_slugstring or any or null
Answer 200
client*AppClient

Errors: NO_PROVIDER, UNSUPPORTED, TOO_MANY_CLIENTS, BAD_PRIVATE_KEY, REDIRECT_MISMATCH

Examples
curl
curl -X PUT "https://programmable.dev/v1/app/providers/github/client" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"client_id":"Iv1.abc123","client_secret":"…"}'
TypeScript
await pd.setAppClient("github", {"client_id":"Iv1.abc123","client_secret":"…"});
Python
pd.set_app_client("github", {"client_id":"Iv1.abc123","client_secret":"…"})

DELETE/v1/app/providers/{provider}/client

Remove your OAuth client for a provider

409 CLIENT_IN_USE while connections were signed in with it; force=true marks them needs_reauth instead.

Path: {provider}

Query
force"true"Remove it even while connections use it.
Answer 200
deleted*boolean
needs_reauth*integer

Errors: NO_CLIENT, CLIENT_IN_USE

Examples
curl
curl -X DELETE "https://programmable.dev/v1/app/providers/github/client" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.deleteAppClient("github");
Python
pd.delete_app_client("github")

MCP sign-in

Let the person your app names connect a stock MCP client (Claude, n8n) to their agent by signing in, instead of pasting a token.

GET/v1/tenants/{tenant}/mcp-oauth-email

Is an address bound for MCP sign-in

Whether this tenant has an address that may authorize stock MCP clients (Claude, n8n) for its actors through our OAuth authorization server. The address itself is never returned. 404 while MCP sign-in is off on this service.

Path: {tenant}

Answer 200
mcp_oauth_email*McpOauthEmail

Errors: NO_TENANT

Examples
curl
curl "https://programmable.dev/v1/tenants/acme/mcp-oauth-email" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getMcpOauthEmail("acme");
Python
pd.get_mcp_oauth_email("acme")

PUT/v1/tenants/{tenant}/mcp-oauth-email

Bind the address that may authorize MCP clients

The one person whose verified Programmable sign-in address is this may authorize an MCP client for the listed actors (1 to 20 of your actor ids) of this tenant, at https://<host>/mcp/<your app slug>/<tenant>/<actor>, once your app's MCP sign-in switch is on (Developers > Server access). Only a keyed hash is stored, with the key you used: revoking that key unbinds the address and ends what it authorized (a rotation moves it to the new key). The same address again updates the actor list (actors dropped from it lose their clients); a different one replaces it and ends everything the old one authorized. Sends mcp_oauth.email_bound. Live tenants only (409 MCP_OAUTH_LIVE_ONLY with a test key); never your dashboard's test tenant (409 MCP_OAUTH_TEST_ACCOUNT).

Path: {tenant}

Body
email*string 3-254 chars
actors*string[] (≤ 20)
Answer 200
mcp_oauth_email*McpOauthEmail

Errors: NO_TENANT, BAD_EMAIL, BAD_ACTORS, MCP_OAUTH_LIVE_ONLY, MCP_OAUTH_TEST_ACCOUNT

Examples
curl
curl -X PUT "https://programmable.dev/v1/tenants/acme/mcp-oauth-email" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","actors":["support-bot"]}'
TypeScript
await pd.setMcpOauthEmail("acme", {"email":"[email protected]","actors":["support-bot"]});
Python
pd.set_mcp_oauth_email("acme", {"email":"[email protected]","actors":["support-bot"]})

DELETE/v1/tenants/{tenant}/mcp-oauth-email

Unbind the address

Every MCP client the address authorized for this tenant stops at its next request. Sends mcp_oauth.email_unbound.

Path: {tenant}

Answer 200
deleted*booleanfalse when no address was bound.

Errors: NO_TENANT

Examples
curl
curl -X DELETE "https://programmable.dev/v1/tenants/acme/mcp-oauth-email" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.deleteMcpOauthEmail("acme");
Python
pd.delete_mcp_oauth_email("acme")

Access requests

Let an agent ask your server for a tool it doesn't have.

GET/v1/app/access-requests

Can your agents ask for access

Whether your actors get the built-in tool request_access, over MCP and in listTools / callTool. Off by default.

Answer 200
access_requests*AccessRequests
Examples
curl
curl "https://programmable.dev/v1/app/access-requests" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getAccessRequests();
Python
pd.get_access_requests()

PUT/v1/app/access-requests

Let your agents ask for access

Needs a webhook (409 NO_WEBHOOK): each request arrives as an access.requested event. Nothing is connected or granted; your server decides.

Body
enabled*boolean
Answer 200
access_requests*AccessRequests

Errors: NO_WEBHOOK

Examples
curl
curl -X PUT "https://programmable.dev/v1/app/access-requests" \
  -H "Authorization: Bearer $PD_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'
TypeScript
await pd.setAccessRequests({"enabled":true});
Python
pd.set_access_requests({"enabled":True})

MCP server catalogue

Remote MCP servers your users can connect.

GET/v1/catalog/search

Search MCP servers

Remote MCP servers your users can connect (with a connect session's catalog_entry_id). Vendor-official servers first.

Query
qstring ≤ 200 charsSearch text.
providerstring ≤ 120 charsOnly this provider.
official_only"true" | "1"Only servers run by the service's own vendor.
remote_only"true" | "1"Only servers with a remote URL.
limitinteger 1-50Default 20.
Answer 200
items*CatalogServer[]
Examples
curl
curl "https://programmable.dev/v1/catalog/search" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.searchCatalog();
Python
pd.search_catalog()

GET/v1/catalog/servers/{slug}

Get one MCP server

One server with every listing of the same endpoint.

Path: {slug}

Answer 200
server*CatalogServer
listings*(object (map))[]

Errors: NO_SERVER

Examples
curl
curl "https://programmable.dev/v1/catalog/servers/linear" \
  -H "Authorization: Bearer $PD_APP_KEY"
TypeScript
await pd.getCatalogServer("linear");
Python
pd.get_catalog_server("linear")