AgentPMT

Programmatic API endpoints for platform integration.

Trigger Autonomous Workflows Via Webhooks

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

Trigger a workflow run

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

Request Body (required)

Field
prompt
Type
string
Required
yes
Description
Prompt forwarded to the workflow for execution.
Field
request_id
Type
string
Required
no
Description
Caller-supplied idempotency key. Retrying with the same key returns the existing run.
Field
callback_url
Type
string
Required
no
Description
HTTPS URL that will receive a POST with the final run status.
Field
request_metadata
Type
object
Required
no
Description
Free-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.
Field
success
Type
boolean
Required
yes
Description
`true` when the trigger was accepted.
Field
data
Type
object
Required
yes
Description
--
Field
run
Type
object
Required
yes
Description
--
Field
run_id
Type
string
Required
yes
Description
MongoDB ObjectId of the run document.
Field
workflow_id
Type
string
Required
yes
Description
ObjectId of the workflow being executed.
Field
status
Type
"queued" | "running" | "completed" | "failed" | "setup_required" | "cancelled"
Required
yes
Description
Lifecycle status of the run.enum: "queued", "running", "completed", "failed", "setup_required", "cancelled"
Field
created_at
Type
string
Required
yes
Description
ISO-8601 timestamp when the run was created.
Field
updated_at
Type
string
Required
yes
Description
ISO-8601 timestamp of the most recent state change.
Field
cancel_requested_at
Type
any
Required
no
Description
ISO-8601 timestamp when cancellation was requested.
Field
cancel_request_id
Type
any
Required
no
Description
Request identifier associated with the cancellation request.
Field
cancel_reason
Type
any
Required
no
Description
Bounded reason for the cancellation request.
Field
status_url
Type
string
Required
yes
Description
Absolute URL the caller can poll for run status.
Field
message
Type
string
Required
yes
Description
--

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.
Field
success
Type
boolean
Required
yes
Description
`true` when the trigger was accepted.
Field
data
Type
object
Required
yes
Description
--
Field
run
Type
object
Required
yes
Description
--
Field
run_id
Type
string
Required
yes
Description
MongoDB ObjectId of the run document.
Field
workflow_id
Type
string
Required
yes
Description
ObjectId of the workflow being executed.
Field
status
Type
"queued" | "running" | "completed" | "failed" | "setup_required" | "cancelled"
Required
yes
Description
Lifecycle status of the run.enum: "queued", "running", "completed", "failed", "setup_required", "cancelled"
Field
created_at
Type
string
Required
yes
Description
ISO-8601 timestamp when the run was created.
Field
updated_at
Type
string
Required
yes
Description
ISO-8601 timestamp of the most recent state change.
Field
cancel_requested_at
Type
any
Required
no
Description
ISO-8601 timestamp when cancellation was requested.
Field
cancel_request_id
Type
any
Required
no
Description
Request identifier associated with the cancellation request.
Field
cancel_reason
Type
any
Required
no
Description
Bounded reason for the cancellation request.
Field
status_url
Type
string
Required
yes
Description
Absolute URL the caller can poll for run status.
Field
message
Type
string
Required
yes
Description
--

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.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-readable error message.

Example response

{
  "success": false,
  "error": "string",
  "message": "string"
}
401Missing or invalid bearer token.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-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.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
"workflow_not_on_budget" | "missing_credentials" | "setup_required"
Required
yes
Description
Stable machine-readable error code.enum: "workflow_not_on_budget", "missing_credentials", "setup_required"
Field
message
Type
string
Required
yes
Description
--
Field
data
Type
object
Required
no
Description
--
Field
workflow_request_id
Type
any
Required
no
Description
Approval request ID when the workflow is not yet enabled on the budget.
Field
credential_request_ids
Type
string[]
Required
no
Description
Approval request IDs opened for the missing credentials.
Field
[item]
Type
string
Required
no
Description
--
Field
add_workflow
Type
any
Required
no
Description
Card payload describing the workflow that needs to be added.
Field
missing_credentials
Type
object[]
Required
no
Description
Requirement descriptors for credentials that still need to be configured.
Field
[item]
Type
object
Required
no
Description
--

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.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-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

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

Responses

200Current status and payload of the workflow run.
Field
success
Type
boolean
Required
yes
Description
`true` when the run was located.
Field
data
Type
object
Required
yes
Description
--
Field
run
Type
object
Required
yes
Description
--
Field
run_id
Type
string
Required
yes
Description
MongoDB ObjectId of the run document.
Field
workflow_id
Type
string
Required
yes
Description
ObjectId of the workflow being executed.
Field
status
Type
"queued" | "running" | "completed" | "failed" | "setup_required" | "cancelled"
Required
yes
Description
Lifecycle status of the run.enum: "queued", "running", "completed", "failed", "setup_required", "cancelled"
Field
prompt
Type
string
Required
yes
Description
Original prompt supplied when the run was triggered.
Field
response_text
Type
any
Required
no
Description
Final model response text once the run completes.
Field
session_id
Type
any
Required
no
Description
Chat session ID bound to this run, when available.
Field
model
Type
any
Required
no
Description
Model used to execute the run, when known.
Field
error_code
Type
any
Required
no
Description
Stable error code when the run failed.
Field
error_message
Type
any
Required
no
Description
Human-readable error message when the run failed.
Field
callback_url
Type
any
Required
no
Description
Registered callback URL, if the caller supplied one.
Field
callback_status
Type
"pending" | "delivered" | "failed" | "skipped"
Required
yes
Description
Delivery status of the callback.enum: "pending", "delivered", "failed", "skipped"
Field
callback_last_status
Type
any
Required
no
Description
HTTP status code from the most recent callback attempt.
Field
callback_last_error
Type
any
Required
no
Description
Error message from the most recent failed callback attempt.
Field
callback_attempted_at
Type
any
Required
no
Description
ISO-8601 timestamp of the most recent callback attempt.
Field
callback_delivered_at
Type
any
Required
no
Description
ISO-8601 timestamp when the callback was delivered successfully.
Field
request_metadata
Type
object
Required
no
Description
Metadata supplied with the original trigger request.
Field
run_metadata
Type
object
Required
no
Description
Internal per-run metadata captured during execution.
Field
created_at
Type
string
Required
yes
Description
ISO-8601 timestamp when the run was created.
Field
updated_at
Type
string
Required
yes
Description
ISO-8601 timestamp of the most recent state change.
Field
started_at
Type
any
Required
no
Description
ISO-8601 timestamp when execution began.
Field
completed_at
Type
any
Required
no
Description
ISO-8601 timestamp when execution finished, if completed.
Field
cancel_requested_at
Type
any
Required
no
Description
ISO-8601 timestamp when cancellation was requested.
Field
cancel_requested_by_user_id
Type
any
Required
no
Description
User ObjectId that requested cancellation, when applicable.
Field
cancel_request_id
Type
any
Required
no
Description
Request identifier associated with the cancellation request.
Field
cancel_reason
Type
any
Required
no
Description
Bounded 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.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-readable error message.

Example response

{
  "success": false,
  "error": "string",
  "message": "string"
}
401Missing or invalid bearer token.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-readable error message.

Example response

{
  "success": false,
  "error": "string",
  "message": "string"
}
404Run not found for the caller.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-readable error message.

Example response

{
  "success": false,
  "error": "string",
  "message": "string"
}
500Unexpected server error.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-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

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

Responses

200Run cancellation was accepted or the run was already cancelled.
Field
success
Type
boolean
Required
yes
Description
`true` when the run was located.
Field
data
Type
object
Required
yes
Description
--
Field
run
Type
object
Required
yes
Description
--
Field
run_id
Type
string
Required
yes
Description
MongoDB ObjectId of the run document.
Field
workflow_id
Type
string
Required
yes
Description
ObjectId of the workflow being executed.
Field
status
Type
"queued" | "running" | "completed" | "failed" | "setup_required" | "cancelled"
Required
yes
Description
Lifecycle status of the run.enum: "queued", "running", "completed", "failed", "setup_required", "cancelled"
Field
prompt
Type
string
Required
yes
Description
Original prompt supplied when the run was triggered.
Field
response_text
Type
any
Required
no
Description
Final model response text once the run completes.
Field
session_id
Type
any
Required
no
Description
Chat session ID bound to this run, when available.
Field
model
Type
any
Required
no
Description
Model used to execute the run, when known.
Field
error_code
Type
any
Required
no
Description
Stable error code when the run failed.
Field
error_message
Type
any
Required
no
Description
Human-readable error message when the run failed.
Field
callback_url
Type
any
Required
no
Description
Registered callback URL, if the caller supplied one.
Field
callback_status
Type
"pending" | "delivered" | "failed" | "skipped"
Required
yes
Description
Delivery status of the callback.enum: "pending", "delivered", "failed", "skipped"
Field
callback_last_status
Type
any
Required
no
Description
HTTP status code from the most recent callback attempt.
Field
callback_last_error
Type
any
Required
no
Description
Error message from the most recent failed callback attempt.
Field
callback_attempted_at
Type
any
Required
no
Description
ISO-8601 timestamp of the most recent callback attempt.
Field
callback_delivered_at
Type
any
Required
no
Description
ISO-8601 timestamp when the callback was delivered successfully.
Field
request_metadata
Type
object
Required
no
Description
Metadata supplied with the original trigger request.
Field
run_metadata
Type
object
Required
no
Description
Internal per-run metadata captured during execution.
Field
created_at
Type
string
Required
yes
Description
ISO-8601 timestamp when the run was created.
Field
updated_at
Type
string
Required
yes
Description
ISO-8601 timestamp of the most recent state change.
Field
started_at
Type
any
Required
no
Description
ISO-8601 timestamp when execution began.
Field
completed_at
Type
any
Required
no
Description
ISO-8601 timestamp when execution finished, if completed.
Field
cancel_requested_at
Type
any
Required
no
Description
ISO-8601 timestamp when cancellation was requested.
Field
cancel_requested_by_user_id
Type
any
Required
no
Description
User ObjectId that requested cancellation, when applicable.
Field
cancel_request_id
Type
any
Required
no
Description
Request identifier associated with the cancellation request.
Field
cancel_reason
Type
any
Required
no
Description
Bounded 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.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-readable error message.

Example response

{
  "success": false,
  "error": "string",
  "message": "string"
}
401Missing or invalid bearer token.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-readable error message.

Example response

{
  "success": false,
  "error": "string",
  "message": "string"
}
404Run not found for the caller.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-readable error message.

Example response

{
  "success": false,
  "error": "string",
  "message": "string"
}
409Run is already terminal and cannot be cancelled.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-readable error message.

Example response

{
  "success": false,
  "error": "string",
  "message": "string"
}
500Unexpected server error.
Field
success
Type
false
Required
yes
Description
enum: false
Field
error
Type
string
Required
yes
Description
Stable machine-readable error code.
Field
message
Type
string
Required
yes
Description
Human-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

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

Responses

200Successful Response

Response shape for the API health probe.

Field
status
Type
string
Required
yes
Description
Always `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

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.

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.

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.

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.

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

Try Building Your Own Autonomous Workflow!

It's free to start, no credit card required. Dive in and build it yourself, or bring in the AgentPMT experts for a seamless end-to-end implementation.

Free to start. Consulting available when you want expert implementation.