Skip to content
Updated Apr 17, 2026

Programmatic Access

Trigger Autonomous Workflows Via Webhooks

POST/api/agent-webhooks/{workflowId}/trigger

Trigger a workflow run

Base URL: https://www.agentpmt.com

Request Body (required)

promptstringRequired

Prompt forwarded to the workflow for execution.

request_idstringOptional

Caller-supplied idempotency key. Retrying with the same key returns the existing run.

callback_urlstringOptional

HTTPS URL that will receive a POST with the final run status.

request_metadataobjectOptional

Free-form metadata persisted alongside the run for caller-side tracing.

Example request body
json
{
  "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.
successbooleanRequired

`true` when the trigger was accepted.

dataobjectRequired
runobjectRequired
run_idstringRequired

MongoDB ObjectId of the run document.

workflow_idstringRequired

ObjectId of the workflow being executed.

statusenumRequired

Lifecycle status of the run.

Allowed values"queued""running""completed""failed""setup_required""cancelled"
created_atstringRequired

ISO-8601 timestamp when the run was created.

updated_atstringRequired

ISO-8601 timestamp of the most recent state change.

cancel_requested_atanyOptional

ISO-8601 timestamp when cancellation was requested.

cancel_request_idanyOptional

Request identifier associated with the cancellation request.

cancel_reasonanyOptional

Bounded reason for the cancellation request.

status_urlstringRequired

Absolute URL the caller can poll for run status.

messagestringRequired

No description provided.

Example response
json
{
  "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.
successbooleanRequired

`true` when the trigger was accepted.

dataobjectRequired
runobjectRequired
run_idstringRequired

MongoDB ObjectId of the run document.

workflow_idstringRequired

ObjectId of the workflow being executed.

statusenumRequired

Lifecycle status of the run.

Allowed values"queued""running""completed""failed""setup_required""cancelled"
created_atstringRequired

ISO-8601 timestamp when the run was created.

updated_atstringRequired

ISO-8601 timestamp of the most recent state change.

cancel_requested_atanyOptional

ISO-8601 timestamp when cancellation was requested.

cancel_request_idanyOptional

Request identifier associated with the cancellation request.

cancel_reasonanyOptional

Bounded reason for the cancellation request.

status_urlstringRequired

Absolute URL the caller can poll for run status.

messagestringRequired

No description provided.

Example response
json
{
  "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.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}
401Missing or invalid bearer token.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "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.
successenumRequired

No description provided.

Allowed valuesfalse
errorenumRequired

Stable machine-readable error code.

Allowed values"workflow_not_on_budget""missing_credentials""setup_required"
messagestringRequired

No description provided.

dataobjectOptional
workflow_request_idanyOptional

Approval request ID when the workflow is not yet enabled on the budget.

credential_request_idsstring[]Optional

Approval request IDs opened for the missing credentials.

[item]string

No description provided.

add_workflowanyOptional

Card payload describing the workflow that needs to be added.

missing_credentialsobject[]Optional

Requirement descriptors for credentials that still need to be configured.

[item]object

No description provided.

Example response
json
{
  "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.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}

Example

Request skeleton

Replace placeholder values before sending this request.

bash
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

Base URL: https://www.agentpmt.com

Responses

200Current status and payload of the workflow run.
successbooleanRequired

`true` when the run was located.

dataobjectRequired
runobjectRequired
run_idstringRequired

MongoDB ObjectId of the run document.

workflow_idstringRequired

ObjectId of the workflow being executed.

statusenumRequired

Lifecycle status of the run.

Allowed values"queued""running""completed""failed""setup_required""cancelled"
promptstringRequired

Original prompt supplied when the run was triggered.

response_textanyOptional

Final model response text once the run completes.

session_idanyOptional

Chat session ID bound to this run, when available.

modelanyOptional

Model used to execute the run, when known.

error_codeanyOptional

Stable error code when the run failed.

error_messageanyOptional

Human-readable error message when the run failed.

callback_urlanyOptional

Registered callback URL, if the caller supplied one.

callback_statusenumRequired

Delivery status of the callback.

Allowed values"pending""delivered""failed""skipped"
callback_last_statusanyOptional

HTTP status code from the most recent callback attempt.

callback_last_erroranyOptional

Error message from the most recent failed callback attempt.

callback_attempted_atanyOptional

ISO-8601 timestamp of the most recent callback attempt.

callback_delivered_atanyOptional

ISO-8601 timestamp when the callback was delivered successfully.

request_metadataobjectOptional

Metadata supplied with the original trigger request.

run_metadataobjectOptional

Internal per-run metadata captured during execution.

created_atstringRequired

ISO-8601 timestamp when the run was created.

updated_atstringRequired

ISO-8601 timestamp of the most recent state change.

started_atanyOptional

ISO-8601 timestamp when execution began.

completed_atanyOptional

ISO-8601 timestamp when execution finished, if completed.

cancel_requested_atanyOptional

ISO-8601 timestamp when cancellation was requested.

cancel_requested_by_user_idanyOptional

User ObjectId that requested cancellation, when applicable.

cancel_request_idanyOptional

Request identifier associated with the cancellation request.

cancel_reasonanyOptional

Bounded reason for the cancellation request.

Example response
json
{
  "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.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}
401Missing or invalid bearer token.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}
404Run not found for the caller.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}
500Unexpected server error.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}

Example

Request skeleton

Replace placeholder values before sending this request.

bash
curl -X GET "https://www.agentpmt.com/api/agent-webhooks/runs/<runId>"

POST/api/agent-webhooks/runs/{runId}/cancel

Cancel a workflow run

Base URL: https://www.agentpmt.com

Responses

200Run cancellation was accepted or the run was already cancelled.
successbooleanRequired

`true` when the run was located.

dataobjectRequired
runobjectRequired
run_idstringRequired

MongoDB ObjectId of the run document.

workflow_idstringRequired

ObjectId of the workflow being executed.

statusenumRequired

Lifecycle status of the run.

Allowed values"queued""running""completed""failed""setup_required""cancelled"
promptstringRequired

Original prompt supplied when the run was triggered.

response_textanyOptional

Final model response text once the run completes.

session_idanyOptional

Chat session ID bound to this run, when available.

modelanyOptional

Model used to execute the run, when known.

error_codeanyOptional

Stable error code when the run failed.

error_messageanyOptional

Human-readable error message when the run failed.

callback_urlanyOptional

Registered callback URL, if the caller supplied one.

callback_statusenumRequired

Delivery status of the callback.

Allowed values"pending""delivered""failed""skipped"
callback_last_statusanyOptional

HTTP status code from the most recent callback attempt.

callback_last_erroranyOptional

Error message from the most recent failed callback attempt.

callback_attempted_atanyOptional

ISO-8601 timestamp of the most recent callback attempt.

callback_delivered_atanyOptional

ISO-8601 timestamp when the callback was delivered successfully.

request_metadataobjectOptional

Metadata supplied with the original trigger request.

run_metadataobjectOptional

Internal per-run metadata captured during execution.

created_atstringRequired

ISO-8601 timestamp when the run was created.

updated_atstringRequired

ISO-8601 timestamp of the most recent state change.

started_atanyOptional

ISO-8601 timestamp when execution began.

completed_atanyOptional

ISO-8601 timestamp when execution finished, if completed.

cancel_requested_atanyOptional

ISO-8601 timestamp when cancellation was requested.

cancel_requested_by_user_idanyOptional

User ObjectId that requested cancellation, when applicable.

cancel_request_idanyOptional

Request identifier associated with the cancellation request.

cancel_reasonanyOptional

Bounded reason for the cancellation request.

Example response
json
{
  "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.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}
401Missing or invalid bearer token.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}
404Run not found for the caller.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}
409Run is already terminal and cannot be cancelled.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}
500Unexpected server error.
successenumRequired

No description provided.

Allowed valuesfalse
errorstringRequired

Stable machine-readable error code.

messagestringRequired

Human-readable error message.

Example response
json
{
  "success": false,
  "error": "string",
  "message": "string"
}

Example

Request skeleton

Replace placeholder values before sending this request.

bash
curl -X POST "https://www.agentpmt.com/api/agent-webhooks/runs/<runId>/cancel"

Public

GET/health

API health probe

Base URL: https://api.agentpmt.com

Responses

200Successful Response

Response shape for the API health probe.

Schema: HealthResponse
statusstringRequired

Always `ok` when the API process is accepting requests.

Example response
json
{
  "status": "string"
}

Example

Request skeleton

Replace placeholder values before sending this request.

bash
curl -X GET "https://api.agentpmt.com/health"

Embedding

GET/embed.js

Load the AgentPMT chat widget loader script

Base URL: https://www.agentpmt.com

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 request

No response body schema published.

401Unauthorized

No response body schema published.

500Internal server error

No response body schema published.

Example

Request skeleton

Replace placeholder values before sending this request.

bash
curl -X GET "https://www.agentpmt.com/embed.js"

GET/embed/{workflowId}

Embed the chat widget scoped to a workflow

Base URL: https://www.agentpmt.com

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 request

No response body schema published.

401Unauthorized

No response body schema published.

404The referenced tool, bundle, or workflow was not found.

Returns HTML document.

500Internal server error

No response body schema published.

Example

Request skeleton

Replace placeholder values before sending this request.

bash
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

Base URL: https://www.agentpmt.com

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 request

No response body schema published.

401Unauthorized

No response body schema published.

404The referenced tool, bundle, or workflow was not found.

Returns HTML document.

500Internal server error

No response body schema published.

Example

Request skeleton

Replace placeholder values before sending this request.

bash
curl -X GET "https://www.agentpmt.com/embed/bundle/<bundleId>"

GET/embed/product/{productId}

Embed the chat widget scoped to a single product tool

Base URL: https://www.agentpmt.com

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 request

No response body schema published.

401Unauthorized

No response body schema published.

404The referenced tool, bundle, or workflow was not found.

Returns HTML document.

500Internal server error

No response body schema published.

Example

Request skeleton

Replace placeholder values before sending this request.

bash
curl -X GET "https://www.agentpmt.com/embed/product/<productId>"