Programmatic Access
Trigger Autonomous Workflows Via Webhooks
POST/api/agent-webhooks/{workflowId}/trigger
Trigger a workflow run
Request Body (required)
promptPrompt forwarded to the workflow for execution.
request_idCaller-supplied idempotency key. Retrying with the same key returns the existing run.
callback_urlHTTPS URL that will receive a POST with the final run status.
request_metadataFree-form metadata persisted alongside the run for caller-side tracing.
Example request body
{
"prompt": "Summarize the status of open orders",
"request_id": "req_01HXXXXXXXXXXXXXXX",
"callback_url": "https://example.com/hooks/agentpmt",
"request_metadata": {}
}Responses
200Run created or existing run returned by idempotency key.success`true` when the trigger was accepted.
datarunrun_idMongoDB ObjectId of the run document.
workflow_idObjectId of the workflow being executed.
statusLifecycle status of the run.
Allowed values"queued""running""completed""failed""setup_required""cancelled"created_atISO-8601 timestamp when the run was created.
updated_atISO-8601 timestamp of the most recent state change.
cancel_requested_atISO-8601 timestamp when cancellation was requested.
cancel_request_idRequest identifier associated with the cancellation request.
cancel_reasonBounded reason for the cancellation request.
status_urlAbsolute URL the caller can poll for run status.
messageNo description provided.
Example response
{
"success": true,
"data": {
"run": {
"run_id": "string",
"workflow_id": "string",
"status": "queued",
"created_at": "string",
"updated_at": "string",
"cancel_requested_at": null,
"cancel_request_id": null,
"cancel_reason": null
},
"status_url": "string"
},
"message": "Workflow trigger accepted"
}202Idempotent replay - the existing run matching `request_id` is returned.success`true` when the trigger was accepted.
datarunrun_idMongoDB ObjectId of the run document.
workflow_idObjectId of the workflow being executed.
statusLifecycle status of the run.
Allowed values"queued""running""completed""failed""setup_required""cancelled"created_atISO-8601 timestamp when the run was created.
updated_atISO-8601 timestamp of the most recent state change.
cancel_requested_atISO-8601 timestamp when cancellation was requested.
cancel_request_idRequest identifier associated with the cancellation request.
cancel_reasonBounded reason for the cancellation request.
status_urlAbsolute URL the caller can poll for run status.
messageNo description provided.
Example response
{
"success": true,
"data": {
"run": {
"run_id": "string",
"workflow_id": "string",
"status": "queued",
"created_at": "string",
"updated_at": "string",
"cancel_requested_at": null,
"cancel_request_id": null,
"cancel_reason": null
},
"status_url": "string"
},
"message": "Workflow trigger accepted"
}400Invalid workflow ID, invalid payload, or malformed request.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}401Missing or invalid bearer token.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}409Workflow is not enabled on the caller's budget and/or required credentials are missing. The response enumerates the approval request IDs created to clear the block.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
Allowed values"workflow_not_on_budget""missing_credentials""setup_required"messageNo description provided.
dataworkflow_request_idApproval request ID when the workflow is not yet enabled on the budget.
credential_request_idsApproval request IDs opened for the missing credentials.
[item]No description provided.
add_workflowCard payload describing the workflow that needs to be added.
missing_credentialsRequirement descriptors for credentials that still need to be configured.
[item]No description provided.
Example response
{
"success": false,
"error": "workflow_not_on_budget",
"message": "string",
"data": {
"workflow_request_id": null,
"credential_request_ids": [
"string"
],
"add_workflow": null,
"missing_credentials": [
{}
]
}
}500Unexpected server error.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}Example
Request skeleton
Replace placeholder values before sending this request.
curl -X POST "https://www.agentpmt.com/api/agent-webhooks/<workflowId>/trigger" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Summarize the status of open orders",
"request_id": "req_01HXXXXXXXXXXXXXXX",
"callback_url": "https://example.com/hooks/agentpmt",
"request_metadata": {}
}'GET/api/agent-webhooks/runs/{runId}
Get workflow run status
Responses
200Current status and payload of the workflow run.success`true` when the run was located.
datarunrun_idMongoDB ObjectId of the run document.
workflow_idObjectId of the workflow being executed.
statusLifecycle status of the run.
Allowed values"queued""running""completed""failed""setup_required""cancelled"promptOriginal prompt supplied when the run was triggered.
response_textFinal model response text once the run completes.
session_idChat session ID bound to this run, when available.
modelModel used to execute the run, when known.
error_codeStable error code when the run failed.
error_messageHuman-readable error message when the run failed.
callback_urlRegistered callback URL, if the caller supplied one.
callback_statusDelivery status of the callback.
Allowed values"pending""delivered""failed""skipped"callback_last_statusHTTP status code from the most recent callback attempt.
callback_last_errorError message from the most recent failed callback attempt.
callback_attempted_atISO-8601 timestamp of the most recent callback attempt.
callback_delivered_atISO-8601 timestamp when the callback was delivered successfully.
request_metadataMetadata supplied with the original trigger request.
run_metadataInternal per-run metadata captured during execution.
created_atISO-8601 timestamp when the run was created.
updated_atISO-8601 timestamp of the most recent state change.
started_atISO-8601 timestamp when execution began.
completed_atISO-8601 timestamp when execution finished, if completed.
cancel_requested_atISO-8601 timestamp when cancellation was requested.
cancel_requested_by_user_idUser ObjectId that requested cancellation, when applicable.
cancel_request_idRequest identifier associated with the cancellation request.
cancel_reasonBounded reason for the cancellation request.
Example response
{
"success": true,
"data": {
"run": {
"run_id": "string",
"workflow_id": "string",
"status": "queued",
"prompt": "string",
"response_text": null,
"session_id": null,
"model": null,
"error_code": null,
"error_message": null,
"callback_url": null,
"callback_status": "pending",
"callback_last_status": null,
"callback_last_error": null,
"callback_attempted_at": null,
"callback_delivered_at": null,
"request_metadata": {},
"run_metadata": {},
"created_at": "string",
"updated_at": "string",
"started_at": null,
"completed_at": null,
"cancel_requested_at": null,
"cancel_requested_by_user_id": null,
"cancel_request_id": null,
"cancel_reason": null
}
}
}400Invalid run ID.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}401Missing or invalid bearer token.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}404Run not found for the caller.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}500Unexpected server error.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}Example
Request skeleton
Replace placeholder values before sending this request.
curl -X GET "https://www.agentpmt.com/api/agent-webhooks/runs/<runId>"POST/api/agent-webhooks/runs/{runId}/cancel
Cancel a workflow run
Responses
200Run cancellation was accepted or the run was already cancelled.success`true` when the run was located.
datarunrun_idMongoDB ObjectId of the run document.
workflow_idObjectId of the workflow being executed.
statusLifecycle status of the run.
Allowed values"queued""running""completed""failed""setup_required""cancelled"promptOriginal prompt supplied when the run was triggered.
response_textFinal model response text once the run completes.
session_idChat session ID bound to this run, when available.
modelModel used to execute the run, when known.
error_codeStable error code when the run failed.
error_messageHuman-readable error message when the run failed.
callback_urlRegistered callback URL, if the caller supplied one.
callback_statusDelivery status of the callback.
Allowed values"pending""delivered""failed""skipped"callback_last_statusHTTP status code from the most recent callback attempt.
callback_last_errorError message from the most recent failed callback attempt.
callback_attempted_atISO-8601 timestamp of the most recent callback attempt.
callback_delivered_atISO-8601 timestamp when the callback was delivered successfully.
request_metadataMetadata supplied with the original trigger request.
run_metadataInternal per-run metadata captured during execution.
created_atISO-8601 timestamp when the run was created.
updated_atISO-8601 timestamp of the most recent state change.
started_atISO-8601 timestamp when execution began.
completed_atISO-8601 timestamp when execution finished, if completed.
cancel_requested_atISO-8601 timestamp when cancellation was requested.
cancel_requested_by_user_idUser ObjectId that requested cancellation, when applicable.
cancel_request_idRequest identifier associated with the cancellation request.
cancel_reasonBounded reason for the cancellation request.
Example response
{
"success": true,
"data": {
"run": {
"run_id": "string",
"workflow_id": "string",
"status": "queued",
"prompt": "string",
"response_text": null,
"session_id": null,
"model": null,
"error_code": null,
"error_message": null,
"callback_url": null,
"callback_status": "pending",
"callback_last_status": null,
"callback_last_error": null,
"callback_attempted_at": null,
"callback_delivered_at": null,
"request_metadata": {},
"run_metadata": {},
"created_at": "string",
"updated_at": "string",
"started_at": null,
"completed_at": null,
"cancel_requested_at": null,
"cancel_requested_by_user_id": null,
"cancel_request_id": null,
"cancel_reason": null
}
}
}400Invalid run ID.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}401Missing or invalid bearer token.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}404Run not found for the caller.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}409Run is already terminal and cannot be cancelled.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}500Unexpected server error.successNo description provided.
Allowed valuesfalseerrorStable machine-readable error code.
messageHuman-readable error message.
Example response
{
"success": false,
"error": "string",
"message": "string"
}Example
Request skeleton
Replace placeholder values before sending this request.
curl -X POST "https://www.agentpmt.com/api/agent-webhooks/runs/<runId>/cancel"Public
GET/health
API health probe
Responses
200Successful ResponseResponse shape for the API health probe.
HealthResponsestatusAlways `ok` when the API process is accepting requests.
Example response
{
"status": "string"
}Example
Request skeleton
Replace placeholder values before sending this request.
curl -X GET "https://api.agentpmt.com/health"Embedding
GET/embed.js
Load the AgentPMT chat widget loader script
Responses
200Loader script that appends the AgentPMT chat widget to the host page. Include with a standard `<script src="/embed.js" async></script>` tag.Returns JavaScript source.
400Bad requestNo response body schema published.
401UnauthorizedNo response body schema published.
500Internal server errorNo response body schema published.
Example
Request skeleton
Replace placeholder values before sending this request.
curl -X GET "https://www.agentpmt.com/embed.js"GET/embed/{workflowId}
Embed the chat widget scoped to a workflow
Responses
200HTML document that renders the AgentPMT chat widget inside an `<iframe>`. End users sign in with their own AgentPMT credentials.Returns HTML document.
400Bad requestNo response body schema published.
401UnauthorizedNo response body schema published.
404The referenced tool, bundle, or workflow was not found.Returns HTML document.
500Internal server errorNo response body schema published.
Example
Request skeleton
Replace placeholder values before sending this request.
curl -X GET "https://www.agentpmt.com/embed/<workflowId>"GET/embed/bundle/{bundleId}
Embed the chat widget scoped to a bundle of tools and workflows
Responses
200HTML document that renders the AgentPMT chat widget inside an `<iframe>`. End users sign in with their own AgentPMT credentials.Returns HTML document.
400Bad requestNo response body schema published.
401UnauthorizedNo response body schema published.
404The referenced tool, bundle, or workflow was not found.Returns HTML document.
500Internal server errorNo response body schema published.
Example
Request skeleton
Replace placeholder values before sending this request.
curl -X GET "https://www.agentpmt.com/embed/bundle/<bundleId>"GET/embed/product/{productId}
Embed the chat widget scoped to a single product tool
Responses
200HTML document that renders the AgentPMT chat widget inside an `<iframe>`. End users sign in with their own AgentPMT credentials.Returns HTML document.
400Bad requestNo response body schema published.
401UnauthorizedNo response body schema published.
404The referenced tool, bundle, or workflow was not found.Returns HTML document.
500Internal server errorNo response body schema published.
Example
Request skeleton
Replace placeholder values before sending this request.
curl -X GET "https://www.agentpmt.com/embed/product/<productId>"