`/ai/agent`
Use this when your caller already knows the target agent and wants to start, continue, approve, or resume agent work directly.
The core framework exposes two public REST surfaces:
`/ai/agent`
Use this when your caller already knows the target agent and wants to start, continue, approve, or resume agent work directly.
`/ai/ingress`
Use this when inbound traffic first needs to be normalized, routed, associated with a session, and translated into the framework’s runtime model.
The easiest way to choose the right API is to ask one question:
does the caller already know it is making an agent execution request, or is it first delivering an inbound interaction that the framework still needs to interpret?
If the answer is “we already know the agent and just want it to run,” use /ai/agent.
If the answer is “this payload came from a channel, middleware layer, or transport integration and
the framework still needs to normalize and route it,” use /ai/ingress.
Base path:
/services/apexrest/ai/agentThis surface is centered on agent lifecycle operations. It is the right fit for:
POST /processPOST /hitl/executePOST /hitl/followupPOST /resume/processUse this endpoint to start a new execution or continue an existing one when the caller already knows which agent should handle the request.
Typical uses:
originalUserId, agentDefinitionId, and turnIdentifier are requiredexecutionId is optional when continuing an existing executioninteractionSessionId is optional when you want durable session continuity across executionsuserMessage may be omitted for non-interactive or non-chat scenariosIn practice, think of these fields as serving four roles:
originalUserIdagentDefinitionIdturnIdentifieruserMessage and any continuation identifiersExample request body:
{ "originalUserId": "005xxxxxxxxxxxx", "agentDefinitionId": "a00xxxxxxxxxxxx", "turnIdentifier": "turn-001", "userMessage": "Look up the contact with email john.smith@example.com"}Use the agent REST surface when the caller already knows which agent should handle the work and does not need inbound channel normalization first.
Good agent REST clients usually:
turnIdentifier for each new turn or requestinteractionSessionId when continuity matters across turnsuserMessage explicit rather than vagueThe remaining /ai/agent endpoints exist because execution is not always one-shot. In governed
workflows, the runtime may pause for confirmation, approval, or later continuation. Those endpoints
let a caller participate in that lifecycle without inventing a separate approval API model.
Base path:
/services/apexrest/ai/ingressThis REST surface is intended for middleware or channel integrations that already speak the framework’s normalized inbound contract.
This is the better fit when the inbound request is not yet a clean “run this agent now” call. It is especially useful when:
InteractionSession__cUsing /ai/ingress keeps transport-facing concerns outside the core execution contract. That means
the framework can:
That separation is one of the reasons the runtime scales better than systems that try to force every integration directly into one generic chat endpoint.
Use normal Salesforce authentication such as a session token or OAuth bearer token.
Authorization: Bearer YOUR_ACCESS_TOKENContent-Type: application/jsonUse the same authentication approach you would use for other Salesforce-protected REST resources. The framework does not introduce a separate auth model for these core endpoints.
/ai/agent and /ai/ingress/ai/agent when your caller is starting or resuming agent work directly/ai/ingress when the inbound source behaves like a channel and you need normalization,
routing, and session resolution firstUse /ai/agent when your UI already knows which agent is active. Pass the user id, target agent,
turn identifier, and message payload directly.
Use /ai/ingress when middleware is translating provider or channel traffic into the framework’s
normalized inbound shape before routing and execution begin.
Use /ai/agent for direct automation scenarios when a Flow, service, or integration wants a bounded
runtime invocation instead of a transport-oriented session flow.
AgentExecution__c, InteractionSession__c, InteractionMessage__c, and ExecutionStep__c together when debugging API-driven behavior.