# Ajentify API Documentation

Welcome to the Ajentify API documentation. Select an endpoint below to view its documentation.

## Quick Start Guides

| Guide | Description |
|-------|-------------|
| [Web Chat Quick-Start](/docs/web-chat-quickstart) | Embed an Ajentify agent in your web app with `@ajentify/chat` |

## API Reference

### Authentication

| Guide | Description |
|-------|-------------|
| [Authentication Guide](/docs/api/authentication) | API keys, coding agent setup, and security best practices |

Don't have an API key? [Generate one here](https://ajentify.com/api-keys).

## Agent

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `GET` | [/agents](/docs/GET/agents) | Private | List all agents for the authenticated user |
| `POST` | [/agent](/docs/POST/agent) | Private | Create a new AI agent with a system prompt, tools, and configuration |
| `GET` | [/agent/{agent_id}](/docs/GET/agent/{agent_id}) | Public | Retrieve an agent by ID |
| `POST` | [/agent/{agent_id}](/docs/POST/agent/{agent_id}) | Private | Update an existing agent's configuration. Pass `stage_id` and `logical_name` together to attach this agent to a stage so it appears in /deploy manifests and is reachable via runtime addressing on POST /context; pass both as null to detach. If the agent ends up with a stage, every user-defined tool it references is reconciled into the same stage — unattached tools are auto-claimed; tools already in another stage 409. |
| `DELETE` | [/agent/{agent_id}](/docs/DELETE/agent/{agent_id}) | Private | Delete an agent (and its schedules; phone numbers connected to it are detached, not deleted) |

## Context

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/context](/docs/POST/context) | Public | Create a new conversation context for an agent. The agent can be addressed in two ways: by its server-assigned `agent_id` (UUID), or by the `(stage, agent)` pair where `stage` is a stable stage name (e.g. 'frontend-staging') and `agent` is the logical name declared in the stage's deploy manifest (e.g. 'cara'). Both forms are accepted; `agent_id` wins if both are provided. |
| `GET` | [/context/{context_id}](/docs/GET/context/{context_id}) | Public | Retrieve an existing context by ID |
| `DELETE` | [/context/{context_id}](/docs/DELETE/context/{context_id}) | Private | Delete an existing context |
| `GET` | [/context-history](/docs/GET/context-history) | Private | Retrieve conversation history. By default returns contexts for the authenticated user. Pass ?client_id=X to fetch contexts for a specific org-owned client; the authenticated caller's org must own that client_id. |
| `POST` | [/context/add-messages](/docs/POST/context/add-messages) | Public | Append messages to an existing context |
| `POST` | [/context/set-messages](/docs/POST/context/set-messages) | Public | Replace all messages in a context |
| `POST` | [/context/set-user-defined](/docs/POST/context/set-user-defined) | Public | Update only the user_defined field of a context |

## Chat

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/chat](/docs/POST/chat) | Public | Send a message to an agent and get a response |
| `POST` | [/chat/add-ai-message](/docs/POST/chat/add-ai-message) | Public | Add an AI message or trigger an AI response with a system prompt |
| `POST` | [/chat/invoke](/docs/POST/chat/invoke) | Public | Invoke the agent without adding a human message |
| `POST` | [/chat/client-side-tool-responses](/docs/POST/chat/client-side-tool-responses) | Public | Submit responses for client-side tool calls and continue the conversation |

## Tool

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/tool](/docs/POST/tool) | Private | Create a new tool with code that agents can execute |
| `GET` | [/tool/{tool_id}](/docs/GET/tool/{tool_id}) | Private | Retrieve a tool by ID |
| `POST` | [/tool/{tool_id}](/docs/POST/tool/{tool_id}) | Private | Update an existing tool. Pass `stage_id` and `logical_name` together to attach this tool to a stage so it appears in /deploy manifests; pass both as null to detach. The tool's Parameter Definition follows the tool's stage binding automatically — attaching to a stage claims the PD into the same stage with logical name `_tool_<logical>_schema`; detaching releases it. |
| `DELETE` | [/tool/{tool_id}](/docs/DELETE/tool/{tool_id}) | Private | Delete a tool |
| `GET` | [/tools](/docs/GET/tools) | Private | List all tools for the user |
| `GET` | [/default-tools](/docs/GET/default-tools) | Private | List all built-in default tools |
| `POST` | [/test-tool](/docs/POST/test-tool) | Private | Test tool code execution without creating the tool |

## Structured Response Endpoint

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/sre](/docs/POST/sre) | Private | Create a structured response endpoint for generating typed JSON output from prompts |
| `GET` | [/sre/{sre_id}](/docs/GET/sre/{sre_id}) | Private | Retrieve an SRE by ID |
| `POST` | [/sre/{sre_id}](/docs/POST/sre/{sre_id}) | Private | Update an existing SRE. Pass `stage_id` and `logical_name` together to attach this SRE to a stage so it appears in /deploy manifests; pass both as null to detach. The SRE's Parameter Definition follows the SRE's stage binding automatically — attaching to a stage claims the PD into the same stage with logical name `_sre_<logical>_schema`; detaching releases it. |
| `DELETE` | [/sre/{sre_id}](/docs/DELETE/sre/{sre_id}) | Private | Delete an SRE |
| `GET` | [/sres](/docs/GET/sres) | Private | List all SREs for the user |
| `POST` | [/run-sre](/docs/POST/run-sre) | Private | Run a one-off structured extraction without creating an SRE or parameter definition |
| `POST` | [/run-sre/{sre_id}](/docs/POST/run-sre/{sre_id}) | Public | Execute an SRE with variable values to generate a structured response |

## Parameter Definition

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/parameter-definition](/docs/POST/parameter-definition) | Private | Create a parameter definition that defines structured input/output schemas |
| `GET` | [/parameter-definition/{pd_id}](/docs/GET/parameter-definition/{pd_id}) | Private | Retrieve a parameter definition by ID |
| `POST` | [/parameter-definition/{pd_id}](/docs/POST/parameter-definition/{pd_id}) | Private | Update an existing parameter definition |
| `DELETE` | [/parameter-definition/{pd_id}](/docs/DELETE/parameter-definition/{pd_id}) | Private | Delete a parameter definition |
| `GET` | [/parameter-definitions](/docs/GET/parameter-definitions) | Private | List all parameter definitions for the user |

## Stage

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/stage](/docs/POST/stage) | Private | Create a new stage. Stages logically group deployed resources (Agents, Tools, SREs, Parameter Definitions, Data Windows, Documents) so they can be reconciled together via /deploy and addressed at runtime by (stage, logical_name). |
| `GET` | [/stage/{stage_id}](/docs/GET/stage/{stage_id}) | Private | Retrieve a stage by ID. |
| `POST` | [/stage/{stage_id}](/docs/POST/stage/{stage_id}) | Private | Update an existing stage. Renaming a stage updates its name in place; resources deployed to this stage are unaffected and continue to be reconciled by stage_id. |
| `DELETE` | [/stage/{stage_id}](/docs/DELETE/stage/{stage_id}) | Private | Delete a stage. Requires `mode` in the body: 'destroy' wipes every child resource alongside the stage; 'detach' strips the stage binding from each child (turning them back into dashboard-managed resources) and then deletes the stage record. There is no default — the field is required so the destructive choice is always explicit. |
| `GET` | [/stages](/docs/GET/stages) | Private | List all stages for the user's organization. |
| `GET` | [/stage/{stage_id}/manifest](/docs/GET/stage/{stage_id}/manifest) | Private | Export a stage's current resources as a stage-agnostic `ajentify.json` manifest. The returned body has only `tools`, `sres`, and `agents` — the target stage is supplied separately on the deploy request envelope, so the same manifest can be re-deployed into a different stage to promote it. Deploying the exported manifest back into the source stage is a no-op. |

## Deploy

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/deploy](/docs/POST/deploy) | Private | Reconcile a stage's resources to match the submitted manifest. The request wraps a stage-agnostic `manifest` body together with the target `stage` (and optionally `org_id`); the same manifest can be promoted between stages by re-deploying with a different `stage`. Creates the stage if it does not exist; creates / updates / deletes Parameter Definitions, Tools, SREs, and Agents to converge to the desired state. Logical names (the keys in each map) are stable identifiers within the stage and are used as the reconciliation key. Resource IDs are server-managed and never appear in the manifest. Idempotent — re-deploying the same request is a no-op. |
| `POST` | [/deploy/plan](/docs/POST/deploy/plan) | Private | Dry-run version of POST /deploy. Validates the request, computes the plan that would be applied to the named stage, and returns it without making any changes. Useful for CI / pre-merge review. |

## Billing

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `GET` | [/billing/plans](/docs/GET/billing/plans) | Public | Get the plan + top-up tier catalog (backend-owned numbers) |
| `POST` | [/billing/subscription-session](/docs/POST/billing/subscription-session) | Private | Create a Stripe hosted Checkout session to start a subscription |
| `POST` | [/billing/checkout-session](/docs/POST/billing/checkout-session) | Private | Create a Stripe hosted Checkout session for a one-off credit top-up |
| `POST` | [/billing/portal-session](/docs/POST/billing/portal-session) | Private | Create a Stripe Customer Portal session (manage card / invoices) |
| `POST` | [/billing/subscription/cancel](/docs/POST/billing/subscription/cancel) | Private | Cancel the subscription at period end (keeps access until the cycle ends) |

## Org Contexts

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `GET` | [/org-contexts](/docs/GET/org-contexts) | Private | List API-key-owned, public, and the caller's own contexts in an organization for the admin Contexts inspector. Other users' Cognito-owned contexts are excluded. |

## Schedule

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/schedule](/docs/POST/schedule) | Private | Create a schedule that invokes an agent on a recurring (`rate`/`cron`) or one-shot (`at`) EventBridge Scheduler expression. Every fire creates a new context (owned by the creator, attached to the schedule's client) with the stored prompt_args and optional kick-off message. |
| `GET` | [/schedule/{schedule_id}](/docs/GET/schedule/{schedule_id}) | Private | Get a schedule (including its last-run bookkeeping) |
| `POST` | [/schedule/{schedule_id}](/docs/POST/schedule/{schedule_id}) | Private | Partially update a schedule. Only fields present in the body change; pass `prompt_args: null` or `message: null` to clear them. Changing the expression, timezone or `enabled` re-syncs the EventBridge schedule (a rejected expression/timezone is a 400 and leaves the schedule unchanged). |
| `DELETE` | [/schedule/{schedule_id}](/docs/DELETE/schedule/{schedule_id}) | Private | Delete a schedule (its EventBridge schedule first, then the row). Contexts it created are kept. |
| `POST` | [/schedule/{schedule_id}/run](/docs/POST/schedule/{schedule_id}/run) | Private | Run a schedule now, exactly as a fire would (new context → optional kick-off message → invoke). Always asynchronous: returns a 202 job; poll `GET /job/{job_id}` for `{schedule, context_id}`. The run is recorded on the schedule like any other fire. |

## Schedules

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `GET` | [/schedules](/docs/GET/schedules) | Private | List schedules for an agent (`agent_id`) or an organization (`org_id`); one of the two is required |

## Telephony

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/phone-number](/docs/POST/phone-number) | Private | Register your own Twilio number (ownership `byo`) with an organization, optionally connecting it to a realtime agent. `twilio_auth_token` is required: Ajentify verifies Twilio's request signature with it, so nothing secret goes into Twilio. Then point the number's Voice webhook at `POST /telephony/twilio/voice` (HTTP POST, no authentication). |
| `GET` | [/phone-numbers](/docs/GET/phone-numbers) | Private | List phone numbers for an organization (`org_id`) or an agent (`agent_id`); one of the two is required |
| `GET` | [/phone-number/{phone_number_id}](/docs/GET/phone-number/{phone_number_id}) | Private | Get a phone number (the stored Twilio auth token is never returned; `has_twilio_auth_token` tells you whether one is set) |
| `POST` | [/phone-number/{phone_number_id}](/docs/POST/phone-number/{phone_number_id}) | Private | Partially update a phone number: connect it to a realtime agent (`agent_id`), detach it (`agent_id: null`), rename it, replace the stored Twilio auth token, or set / clear the Twilio Account SID. Only fields present in the body change. |
| `DELETE` | [/phone-number/{phone_number_id}](/docs/DELETE/phone-number/{phone_number_id}) | Private | Delete a phone number's registration. Calls to it get the rejection message from then on. The number itself is not released from Twilio (BYO numbers stay in your account). |
| `POST` | [/telephony/twilio/voice](/docs/POST/telephony/twilio/voice) | Public | Twilio Voice webhook (set it as the number's "A call comes in" URL, HTTP POST). Resolves the called number (`To`) to its agent, authenticates the request (Ajentify-owned numbers: Twilio signature + AccountSid; your own numbers: HTTP Basic `org_id` / telephony secret, plus the signature when you stored your auth token), creates a call context and answers TwiML that streams the call to the agent. Any rejection answers a short spoken message and hangs up. |

## Scrape Page

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `GET` | [/scrape-page/{link}](/docs/GET/scrape-page/{link}) | Private | Scrape content from a web page URL |

## Job

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `GET` | [/job/{job_id}](/docs/GET/job/{job_id}) | Private | Get the status and results of an async job |

## Data Window

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/data-window](/docs/POST/data-window) | Private | Create a data window for providing real-time cached data to agents |
| `GET` | [/data-window/{data_window_id}](/docs/GET/data-window/{data_window_id}) | Private | Retrieve a data window by ID |
| `POST` | [/data-window/{data_window_id}](/docs/POST/data-window/{data_window_id}) | Private | Update a data window's content or metadata |
| `DELETE` | [/data-window/{data_window_id}](/docs/DELETE/data-window/{data_window_id}) | Private | Delete a data window |
| `GET` | [/data-windows](/docs/GET/data-windows) | Private | List all data windows for the user |

## API Key

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/generate-api-key](/docs/POST/generate-api-key) | Private | Generate an API key for programmatic access or client-side WebSocket streaming |
| `GET` | [/api-keys](/docs/GET/api-keys) | Private | List all API keys for an organization |
| `POST` | [/revoke-api-key](/docs/POST/revoke-api-key) | Private | Revoke an API key by marking it as invalid |

## Client

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/client](/docs/POST/client) | Private | Create a new client (one of your end-users) and get back its server-minted `client_id`, without creating a context. |

## Mcp Connection

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/mcp-connection](/docs/POST/mcp-connection) | Private | Create a new MCP connection with its selected tools |
| `GET` | [/mcp-connection/{mcp_connection_id}](/docs/GET/mcp-connection/{mcp_connection_id}) | Private | Retrieve an MCP connection by ID |
| `POST` | [/mcp-connection/{mcp_connection_id}](/docs/POST/mcp-connection/{mcp_connection_id}) | Private | Update an MCP connection (e.g. change the selected tool set or refresh tokens) |
| `DELETE` | [/mcp-connection/{mcp_connection_id}](/docs/DELETE/mcp-connection/{mcp_connection_id}) | Private | Delete an MCP connection |

## Mcp Connections

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `GET` | [/mcp-connections](/docs/GET/mcp-connections) | Private | List all MCP connections for the user |

## Mcp

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/mcp/discover](/docs/POST/mcp/discover) | Private | Resolve whether an MCP server requires OAuth and, if so, its authorize/token endpoints plus a ready-to-use client_id (client resolution + caching happen server-side) |
| `POST` | [/mcp/token](/docs/POST/mcp/token) | Private | Exchange an authorization code or refresh token for MCP access tokens (server-side to avoid browser CORS) |
| `POST` | [/mcp/tools](/docs/POST/mcp/tools) | Private | Relay an MCP server's tools/list and return its tools. Given an mcp_connection_id, refreshes the stored token on a 401 (and reports needs_reauth if that fails). |
| `POST` | [/mcp](/docs/POST/mcp) | Public | MCP server endpoint (JSON-RPC over HTTP). Authenticate with an OAuth access token from /oauth/token. |
| `GET` | [/mcp](/docs/GET/mcp) | Public | MCP server endpoint (JSON-RPC over HTTP). Authenticate with an OAuth access token from /oauth/token. |
| `DELETE` | [/mcp](/docs/DELETE/mcp) | Public | MCP server endpoint (JSON-RPC over HTTP). Authenticate with an OAuth access token from /oauth/token. |
| `PUT` | [/mcp](/docs/PUT/mcp) | Public | MCP server endpoint (JSON-RPC over HTTP). Authenticate with an OAuth access token from /oauth/token. |
| `PATCH` | [/mcp](/docs/PATCH/mcp) | Public | MCP server endpoint (JSON-RPC over HTTP). Authenticate with an OAuth access token from /oauth/token. |

## .Well Known

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `GET` | [/.well-known/oauth-client](/docs/GET/.well-known/oauth-client) | Public | Public Client ID Metadata Document (CIMD) for the MCP OAuth flow. Authorization servers that support CIMD dereference the client_id URL to fetch this document. |
| `GET` | [/.well-known/jwks.json](/docs/GET/.well-known/jwks.json) | Public | Public JWKS for the MCP OAuth client. Authorization servers fetch this (via the CIMD document's jwks_uri) to verify the client_assertion signed during token/refresh requests. |
| `GET` | [/.well-known/oauth-authorization-server](/docs/GET/.well-known/oauth-authorization-server) | Public | OAuth 2.1 authorization-server metadata (RFC 8414) for connecting MCP clients to Ajentify. |
| `GET` | [/.well-known/oauth-protected-resource](/docs/GET/.well-known/oauth-protected-resource) | Public | OAuth 2.0 protected-resource metadata (RFC 9728) for the Ajentify MCP server. |
| `GET` | [/.well-known/oauth-protected-resource/mcp](/docs/GET/.well-known/oauth-protected-resource/mcp) | Public | OAuth 2.0 protected-resource metadata (RFC 9728) for the Ajentify MCP server. |

## JSON Document

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/json-document](/docs/POST/json-document) | Private | Create a JSON document for agent memory and structured data storage |
| `GET` | [/json-document/{document_id}](/docs/GET/json-document/{document_id}) | Public | Retrieve a JSON document by ID |
| `POST` | [/json-document/{document_id}](/docs/POST/json-document/{document_id}) | Private | Update a JSON document. Pass `stage_id` and `logical_name` together to attach this document to a stage so it appears in /deploy manifests; pass both as null to detach. |
| `DELETE` | [/json-document/{document_id}](/docs/DELETE/json-document/{document_id}) | Private | Delete a JSON document |
| `POST` | [/json-document/{document_id}/set](/docs/POST/json-document/{document_id}/set) | Public | Set a value at a specific path in a JSON document |
| `POST` | [/json-document/{document_id}/add](/docs/POST/json-document/{document_id}/add) | Public | Add an item to a list at a specific path |
| `POST` | [/json-document/{document_id}/delete](/docs/POST/json-document/{document_id}/delete) | Public | Delete a value at a specific path |
| `GET` | [/json-document/{document_id}/value](/docs/GET/json-document/{document_id}/value) | Public | Get a value at a specific path |
| `GET` | [/json-document/{document_id}/shape](/docs/GET/json-document/{document_id}/shape) | Public | Get the shape/schema of a JSON document |
| `GET` | [/json-documents](/docs/GET/json-documents) | Private | List all JSON documents for the user |

## Filesystem

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/filesystem](/docs/POST/filesystem) | Private | Create a filesystem — a hierarchical folder/file memory agents navigate with the Filesystem tools. The response's `filesystem_id` is the root segment of every tool path (`/<filesystem_id>/...`). |
| `GET` | [/filesystems](/docs/GET/filesystems) | Private | List the filesystems of an organization |
| `GET` | [/filesystem/{filesystem_id}](/docs/GET/filesystem/{filesystem_id}) | Private | Retrieve a filesystem by ID |
| `PUT` | [/filesystem/{filesystem_id}](/docs/PUT/filesystem/{filesystem_id}) | Private | Update a filesystem's name and/or description (the description doubles as the root folder's description) |
| `DELETE` | [/filesystem/{filesystem_id}](/docs/DELETE/filesystem/{filesystem_id}) | Private | Delete a filesystem and every folder and file inside it |
| `GET` | [/filesystem/{filesystem_id}/tree](/docs/GET/filesystem/{filesystem_id}/tree) | Private | Whole tree of a filesystem without file contents (one query) — drives the explorer |
| `GET` | [/filesystem/{filesystem_id}/node](/docs/GET/filesystem/{filesystem_id}/node) | Private | One node of a filesystem: a file (with content) or a folder (with its immediate children). `path=/` is the root folder. |
| `DELETE` | [/filesystem/{filesystem_id}/node](/docs/DELETE/filesystem/{filesystem_id}/node) | Private | Delete a file or folder; non-empty folders need `recursive=true` (409 `folder_not_empty` otherwise) |
| `POST` | [/filesystem/{filesystem_id}/folder](/docs/POST/filesystem/{filesystem_id}/folder) | Private | Create a folder (optionally with its missing parents, atomically) |
| `PUT` | [/filesystem/{filesystem_id}/folder](/docs/PUT/filesystem/{filesystem_id}/folder) | Private | Replace a folder's description (`path: "/"` edits the filesystem's root description) |
| `POST` | [/filesystem/{filesystem_id}/file](/docs/POST/filesystem/{filesystem_id}/file) | Private | Create a file with initial content (never overwrites; optionally creates missing parents) |
| `PUT` | [/filesystem/{filesystem_id}/file](/docs/PUT/filesystem/{filesystem_id}/file) | Private | Replace a file's content in full (web editor save) with optional optimistic locking on `updated_at` |
| `POST` | [/filesystem/{filesystem_id}/move](/docs/POST/filesystem/{filesystem_id}/move) | Private | Move or rename a file or folder (with all descendants) |
| `GET` | [/filesystem/{filesystem_id}/search](/docs/GET/filesystem/{filesystem_id}/search) | Private | Literal substring search over folder/file names and file contents in a subtree |

## Tool Response

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/async-tool-response](/docs/POST/async-tool-response) | Private | Submit a response for an async tool call; the agent is run automatically to process it |

## InteliSort

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/inteli-sort](/docs/POST/inteli-sort) | Private | Sort items using LLM-powered pairwise comparison with a tournament bracket algorithm |

## Models

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `GET` | [/models](/docs/GET/models) | Private | List all available LLM models and their pricing |

## Ops

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `GET` | [/ops/alert-test](/docs/GET/ops/alert-test) | Private |  |

## Oauth

| Method | Endpoint | Auth | Description |
|--------|----------|------|-------------|
| `POST` | [/oauth/authorize/preview](/docs/POST/oauth/authorize/preview) | Private | Validate an MCP client's authorize request and return what the consent page must show. Writes nothing. |
| `POST` | [/oauth/authorize/grant](/docs/POST/oauth/authorize/grant) | Private | Record the user's consent for an MCP client: persists an authorization code and returns the redirect URL. |
| `POST` | [/oauth/token](/docs/POST/oauth/token) | Public | OAuth 2.1 token endpoint: exchange an authorization code (PKCE) or rotate a refresh token for an MCP access token. |
| `POST` | [/oauth/revoke](/docs/POST/oauth/revoke) | Public | OAuth 2.0 token revocation (RFC 7009): revoke a refresh token and its family. |
| `POST` | [/oauth/register](/docs/POST/oauth/register) | Public | OAuth 2.0 Dynamic Client Registration (RFC 7591) for MCP clients that cannot use a Client ID Metadata Document. |

## Guides

| Guide | Description |
|-------|-------------|
| [Data Usage Policy](/docs/data-usage-policy) | How we handle your data, and what our LLM providers do with it |
| [Authenticated Endpoints](/docs/auth-endpoints) | How to authenticate API requests |
| [Async Callbacks](/docs/async-callbacks) | Receiving responses via webhook callbacks |
| [Data Windows](/docs/data-windows-feature) | Real-time cached data for agents |
| [Client-Side Tools](/docs/ClientSideTools) | Tools that execute in the client |
| [Custom Code Tools](/docs/custom-code-tools) | Writing sandboxed Python tool code: function naming, parameters, available libraries, and built-in helpers |
| [Message Control](/docs/message-control-endpoints) | Fine-grained control over message generation and storage |
| [Prompt Arguments](/docs/prompt-arguments) | Dynamic prompt templating |
| [Initialize Tools](/docs/initialize-tools) | Pre-populating context with tool responses |
| [Async Tools](/docs/async-tools) | Tools with asynchronous execution |
| [Terminating Tool Calls](/docs/terminating-tool-calls) | Autonomous agent execution |
| [Memory Window](/docs/memory-window) | Context memory management |
| [WebSocket API](/docs/WEBSOCKET_API) | Real-time token streaming |
| [Client API Keys](/docs/api-keys) | Secure WebSocket connections |
| [Ajentify Testing](/docs/ajentify-testing) | Test agents with simulated conversations and LLM-powered assessments |
| [Prompt Auditing Principles](/docs/prompt-auditing-principles) | Audit system prompts against 11 quality principles |
| [AjDK Manifest JSON Schema](/docs/manifest-schema.json) | Canonical Draft 2020-12 schema for `ajentify.json`. Reference via `$schema` in your manifest for editor autocomplete. |
