OAuth apps and consent API
OAuth 2.1 clients (MCP clients, platforms), grants and the agent consent screen.
Base URL https://api.ndstill.com/v2. Send Authorization: Bearer with a key, Ndstill-Version: 2026-11-01, and an Idempotency-Key on every POST. Conventions, scopes and errors are in the API overview and Errors and decline reasons. Examples come from the mock backend; the shapes are the TypeScript types in packages/api.
Create an OAuth app#
/v2/oauth-apps- namestringrequired
- kindstring enumrequired
"platform""mcp_client""integration" - redirect_urisstring[]required
- scopesstring[]required
- idId
- object"oauth_app"
- org_idId
- created_atTimestamp
- updated_atTimestampoptional
- test_modebooleanoptional
True for test-mode objects (simulations, sandbox).
- namestring
- kindstring enum
"platform""mcp_client""integration" - publisherobject
2 fields
- namestring
- verifiedboolean
- client_idstring
- redirect_urisstring[]
- scopesstring[]
- grantsOAuthGrant[]
OAuthGrant: 7 fields
- idIdoptional
Present on every grant the API returns; older objects may lack it.
- userRef
Small reference used for denormalized names in lists (no N+1 lookups in tables).
Ref: 2 fields
- idId
- namestring
- agentRef | null
Small reference used for denormalized names in lists (no N+1 lookups in tables).
Ref: 2 fields
- idId
- namestring
- scopesstring[]
- granted_atTimestamp
- allowanceobject | nulloptional
The spending allowance the person set on the consent screen.
2 fields
- limitMoney
An amount: integer minor units + asset.
Money: 2 fields
- amountnumber
- assetAssetCode
"USD""USDC""EUR""GBP"
- windowstring enum
"day""week""month"
- last_used_atTimestamp | nulloptional
- statusstring enum
"active""revoked" - last_used_atTimestamp | null
- registrationstring enumoptional
How the client registered: MCP clients use dynamic client registration.
"manual""dynamic" - client_typestring enumoptional
Public clients (PKCE, no secret) or confidential ones.
"public""confidential"
- 400invalid_request
A field is missing or invalid; fields names each one.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/oauth-apps" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Docs MCP client",
"kind": "mcp_client",
"redirect_uris": [
"https://example.com/callback"
],
"scopes": [
"pay",
"check_budget"
]
}'{
"id": "oapp_01M82XPRPQ0GDWQVKG5AHQ4A39",
"object": "oauth_app",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-23T00:43:13.495Z",
"name": "Docs MCP client",
"kind": "mcp_client",
"publisher": {
"name": "Acme Robotics",
"verified": false
},
"client_id": "oc_6d4b9c90fef45b1dbbdc",
"redirect_uris": [
"https://example.com/callback"
],
"scopes": [
"pay",
"check_budget"
],
"grants": [],
"status": "active",
"last_used_at": null,
"registration": "manual",
"client_type": "public"
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
List OAuth apps#
/v2/oauth-apps- kindstring enum
"platform""mcp_client""integration" - cursorstring
- limitnumber
1–200, default 50.
- qstring
Free-text search over names, ids and descriptors.
- sortstring
Sort field, prefix "-" for descending ("-created_at" is the default).
- created_gteTimestamp
created_at >= (ISO).
- created_lteTimestamp
created_at <= (ISO).
Returns a list envelope: object "list", data[], has_more, next_cursor (pass it back as cursor) and total when cheap to count. Items:
The same OAuthApp object as Create an OAuth app.
- 400invalid_request
A query parameter is invalid.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X GET "https://api.ndstill.com/v2/oauth-apps?limit=2" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01"{
"object": "list",
"data": [
{
"id": "oapp_01M5R85VME8B7WEE74V9K5F2CW",
"object": "oauth_app",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-10-25T00:43:11.374Z",
"name": "Acme Slack approvals",
"kind": "integration",
"publisher": {
"name": "Acme Robotics",
"verified": false
},
"client_id": "oc_22c9751f8e26ddbdbe52",
"redirect_uris": [
"https://slack.com/oauth/v2/ndstill/callback"
],
"scopes": [
"approvals:write",
"agents:freeze"
],
"grants": [
{
"id": "ogr_6f7c4f07103df08d37a890",
"user": {
"id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
"name": "Dana Whitfield"
},
"agent": null,
"scopes": [
"approvals:write",
"agents:freeze"
],
"granted_at": "2026-10-25T00:43:11.374Z",
"allowance": null,
"last_used_at": "2026-11-22T15:49:11.374Z"
},
{
"id": "ogr_5da8738cda52340506d722",
"user": {
"id": "usr_01K8M49NMEY9DX1Y08XB7WT6RT",
"name": "Marcus Lee"
},
"agent": null,
"scopes": [
"approvals:write",
"agents:freeze"
],
"granted_at": "2026-10-26T00:43:11.374Z",
"allowance": null,
"last_used_at": "2026-11-21T04:10:11.374Z"
},
{
"id": "ogr_3e836f87afcca3d5a6bdf3",
"user": {
"id": "usr_01K9R5VQME4Q4FSCTVNGTV56C2",
"name": "Priya Raman"
},
"agent": null,
"scopes": [
"approvals:write",
"agents:freeze"
],
"granted_at": "2026-10-27T00:43:11.374Z",
"allowance": null,
"last_used_at": "2026-11-21T17:06:11.374Z"
}
],
"status": "active",
"last_used_at": "2026-11-22T23:52:11.374Z",
"registration": "manual",
"client_type": "confidential"
},
{
"id": "oapp_01M4HM72MEZVEVXCEC1HQ9A819",
"object": "oauth_app",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-10-10T00:43:11.374Z",
"name": "ChatGPT",
"kind": "mcp_client",
"publisher": {
"name": "OpenAI",
"verified": true
},
"client_id": "oc_54f21f80ed580af75fdf",
"redirect_uris": [
"https://chatgpt.example/oauth/callback"
],
"scopes": [
"pay",
"check_budget",
"read_activity"
],
"grants": [
{
"id": "ogr_70e83482fc1aac43ec450f",
"user": {
"id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
"name": "Dana Whitfield"
},
"agent": {
"id": "agt_01KWEQTZGE7K1Y4XH61XNMMJ45",
"name": "Content writer"
},
"scopes": [
"pay",
"check_budget",
"read_activity"
],
"granted_at": "2026-10-10T00:43:11.374Z",
"allowance": {
"limit": {
"amount": 450000,
"asset": "USD"
},
"window": "month"
},
"last_used_at": "2026-11-21T01:07:11.374Z"
},
{
"id": "ogr_16cd1e8919905755a41726",
"user": {
"id": "usr_01K8M49NMEY9DX1Y08XB7WT6RT",
"name": "Marcus Lee"
},
"agent": {
"id": "agt_01KWY9N54EWVW2B9R5VCDZ7753",
"name": "Social scheduler"
},
"scopes": [
"pay",
"check_budget",
"read_activity"
],
"granted_at": "2026-10-11T00:43:11.374Z",
"allowance": {
"limit": {
"amount": 600000,
"asset": "USD"
},
"window": "month"
},
"last_used_at": "2026-11-22T00:40:11.374Z"
}
],
"status": "active",
"last_used_at": "2026-11-22T22:01:11.374Z",
"registration": "dynamic",
"client_type": "public"
}
],
"has_more": true,
"next_cursor": "Mg==",
"total": 4
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Retrieve an OAuth app#
/v2/oauth-apps/{id}- idIdrequired
A prefixed ID from this org.
The same OAuthApp object as Create an OAuth app.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X GET "https://api.ndstill.com/v2/oauth-apps/oapp_01M5R85VME8B7WEE74V9K5F2CW" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01"{
"id": "oapp_01M5R85VME8B7WEE74V9K5F2CW",
"object": "oauth_app",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-10-25T00:43:11.374Z",
"name": "Acme Slack approvals",
"kind": "integration",
"publisher": {
"name": "Acme Robotics",
"verified": false
},
"client_id": "oc_22c9751f8e26ddbdbe52",
"redirect_uris": [
"https://slack.com/oauth/v2/ndstill/callback"
],
"scopes": [
"approvals:write",
"agents:freeze"
],
"grants": [
{
"id": "ogr_6f7c4f07103df08d37a890",
"user": {
"id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
"name": "Dana Whitfield"
},
"agent": null,
"scopes": [
"approvals:write",
"agents:freeze"
],
"granted_at": "2026-10-25T00:43:11.374Z",
"allowance": null,
"last_used_at": "2026-11-22T15:49:11.374Z"
},
{
"id": "ogr_5da8738cda52340506d722",
"user": {
"id": "usr_01K8M49NMEY9DX1Y08XB7WT6RT",
"name": "Marcus Lee"
},
"agent": null,
"scopes": [
"approvals:write",
"agents:freeze"
],
"granted_at": "2026-10-26T00:43:11.374Z",
"allowance": null,
"last_used_at": "2026-11-21T04:10:11.374Z"
},
{
"id": "ogr_3e836f87afcca3d5a6bdf3",
"user": {
"id": "usr_01K9R5VQME4Q4FSCTVNGTV56C2",
"name": "Priya Raman"
},
"agent": null,
"scopes": [
"approvals:write",
"agents:freeze"
],
"granted_at": "2026-10-27T00:43:11.374Z",
"allowance": null,
"last_used_at": "2026-11-21T17:06:11.374Z"
}
],
"status": "active",
"last_used_at": "2026-11-22T23:52:11.374Z",
"registration": "manual",
"client_type": "confidential"
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Get a consent request#
/v2/oauth/consent-requests/{id}- idIdrequired
A prefixed ID from this org.
- object"consent_request"
- idId
- appobject
4 fields
- namestring
- publisherstring
- verifiedboolean
- client_idstring
- abilitiesobject[]
Plain-language abilities: "Pay for things", "Check its budget", "Read its activity".
3 fields
- scopestring
- labelstring
- detailstring
- suggestedobject
5 fields
- allowanceMoney
An amount: integer minor units + asset.
Money: 2 fields
- amountnumber
- assetAssetCode
"USD""USDC""EUR""GBP"
- windowstring enum
"week""month" - approve_aboveMoney
An amount: integer minor units + asset.
Money: 2 fields
- amountnumber
- assetAssetCode
"USD""USDC""EUR""GBP"
- categoriesstring[]
- expires_in_daysnumber
- funding_sourcesRef[]
Ref: 2 fields
- idId
- namestring
- railsRail[]
"card""network_token""checkout_token""stablecoin""bank""ai""cloud" - expires_atTimestamp
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X GET "https://api.ndstill.com/v2/oauth/consent-requests/{id}" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01"Runs against the in-browser mock with a test key. Nothing leaves your browser.
Revoke an OAuth app#
/v2/oauth-apps/{id}/revoke- idIdrequired
A prefixed ID from this org.
The same OAuthApp object as Create an OAuth app.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/oauth-apps/oapp_01M82XPRPQ0GDWQVKG5AHQ4A39/revoke" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)"{
"id": "oapp_01M82XPRPQ0GDWQVKG5AHQ4A39",
"object": "oauth_app",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-23T00:43:13.495Z",
"name": "Docs MCP client",
"kind": "mcp_client",
"publisher": {
"name": "Acme Robotics",
"verified": false
},
"client_id": "oc_6d4b9c90fef45b1dbbdc",
"redirect_uris": [
"https://example.com/callback"
],
"scopes": [
"pay",
"check_budget"
],
"grants": [],
"status": "revoked",
"last_used_at": null,
"registration": "manual",
"client_type": "public",
"updated_at": "2026-11-23T00:43:13.667Z"
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Revoke an OAuth grant#
/v2/oauth-grants/{id}/revoke- idIdrequired
A prefixed ID from this org.
The same OAuthApp object as Create an OAuth app.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/oauth-grants/{id}/revoke" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)"Runs against the in-browser mock with a test key. Nothing leaves your browser.
Deny consent#
/v2/oauth/consent-requests/{id}/deny- idIdrequired
A prefixed ID from this org.
- object"consent_denied"
- redirect_uristring
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/oauth/consent-requests/{id}/deny" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)"Runs against the in-browser mock with a test key. Nothing leaves your browser.
Grant consent to an agent#
/v2/oauth/consent-requests/{id}/grant- idIdrequired
A prefixed ID from this org.
- request_idIdrequired
- agent_namestringrequired
- allowanceMoneyrequired
An amount: integer minor units + asset.
Money: 2 fields
- amountnumberrequired
- assetAssetCoderequired
"USD""USDC""EUR""GBP"
- windowstring enumrequired
"week""month" - funding_source_idIdrequired
- approve_aboveMoneyrequired
An amount: integer minor units + asset.
Money: 2 fields
- amountnumberrequired
- assetAssetCoderequired
"USD""USDC""EUR""GBP"
- categoriesstring[]required
- expires_atTimestamp | nullrequired
- passkey_assertionstring
WebAuthn assertion (demo: any string).
- object"consent_granted"
- agent_idId
- policy_idId
- mandate_idId
- redirect_uristring
- 400invalid_request
A field is missing or invalid; fields names each one.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/oauth/consent-requests/{id}/grant" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)"Runs against the in-browser mock with a test key. Nothing leaves your browser.