https://api.agentpmt.comProgrammatic API endpoints for platform integration.
Tool Calls Via REST API
GET/credits/balance
Get My Credit Balance
Check credit balance.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization (header) | string | yes | -- |
Responses
| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | no | `true` when the balance lookup succeeded. |
| message | string | no | Human-readable status message. |
| data | CustomerCreditBalanceData | yes | -- |
| balance | integer | yes | Current available credit balance, in whole credits (100 credits = $1). |
| expiration | string | no | ISO-8601 timestamp of the next credit expiration, or null when the balance is zero.anyOf variant 1 of 2 |
| expires_in_days | integer | no | Whole days until the next expiration, or null when the balance is zero.anyOf variant 1 of 2 |
Example response
{
"success": true,
"message": "string",
"data": {
"balance": 0,
"expiration": "string",
"expires_in_days": 0
}
}| Field | Type | Required | Description |
|---|---|---|---|
| detail | ValidationError[] | no | -- |
| [item] | ValidationError | no | -- |
| loc | string[] | yes | -- |
| [item] | string | no | anyOf variant 1 of 2 |
| msg | string | yes | -- |
| type | string | yes | -- |
| input | any | no | -- |
| ctx | object | no | -- |
Example response
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}curl -X GET "https://api.agentpmt.com/credits/balance"GET/credits/history
Get My Credit History
View credit transaction history.
https://api.agentpmt.comParameters
| Name | Type | Required | Description |
|---|---|---|---|
| limit (query) | integer | no | -- |
| Authorization (header) | string | yes | -- |
Responses
| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | no | `true` when the history lookup succeeded. |
| message | string | no | Human-readable status message. |
| data | CustomerCreditHistoryData | yes | -- |
| grants | CustomerCreditGrant[] | yes | Credit grants owned by the caller, newest first. |
| [item] | CustomerCreditGrant | no | -- |
| _id | string | yes | Grant document ID (serialized as `_id` in the response). |
| user_id | string | yes | Owning user ID. |
| amount_credits | integer | yes | Credits originally granted (positive integer). |
| amount_usd | number | yes | USD equivalent of the grant at issuance. |
| remaining_credits | integer | yes | Credits still available from this grant. |
| credit_type | string | yes | Grant source classification (for example `admin_grant`, `referral_signup`, `x402_purchase`). |
| source_metadata | object | no | Free-form metadata supplied when the grant was created. |
| date_created | string | yes | ISO-8601 timestamp the grant was issued. |
| pooled_at | string | no | ISO-8601 timestamp the grant was added to the pool.anyOf variant 1 of 2 |
| expires_at | string | no | ISO-8601 timestamp the grant expires.anyOf variant 1 of 2 |
| transactions | CustomerCreditTransaction[] | yes | Transaction audit trail, newest first. |
| [item] | CustomerCreditTransaction | no | -- |
| _id | string | yes | Transaction document ID (serialized as `_id` in the response). |
| user_id | string | yes | Owning user ID. |
| transaction_type | string | yes | One of `grant`, `expiration`, `revocation`, or `purchase` (tool deduction). |
| amount_credits | integer | yes | Credits applied by this transaction. Negative for debits (expiration/revocation/purchase), positive for grants. |
| amount_usd | number | yes | USD equivalent of the transaction. |
| balance_after_credits | integer | yes | Balance in credits after applying the transaction. |
| balance_after_usd | number | yes | Balance in USD after applying the transaction. |
| date_created | string | yes | ISO-8601 timestamp of the transaction. |
Example response
{
"success": true,
"message": "string",
"data": {
"grants": [
{
"_id": "string",
"user_id": "string",
"amount_credits": 0,
"amount_usd": 0,
"remaining_credits": 0,
"credit_type": "string",
"source_metadata": {},
"date_created": "string",
"pooled_at": "string",
"expires_at": "string"
}
],
"transactions": [
{
"_id": "string",
"user_id": "string",
"transaction_type": "string",
"amount_credits": 0,
"amount_usd": 0,
"balance_after_credits": 0,
"balance_after_usd": 0,
"date_created": "string"
}
]
}
}| Field | Type | Required | Description |
|---|---|---|---|
| detail | ValidationError[] | no | -- |
| [item] | ValidationError | no | -- |
| loc | string[] | yes | -- |
| [item] | string | no | anyOf variant 1 of 2 |
| msg | string | yes | -- |
| type | string | yes | -- |
| input | any | no | -- |
| ctx | object | no | -- |
Example response
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}curl -X GET "https://api.agentpmt.com/credits/history"POST/issues/report
Report an issue with a tool call
Report an issue with a tool call. Args: request: FastAPI Request object. issue_data: Issue report data (product_id, error_message, recommended_improvements). authorization: Authorization Bearer token. x_instance_id: Optional connection instance ID (x-instance-id header). Returns: Success response with created issue ID.
https://api.agentpmt.comParameters
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization (header) | string | yes | Bearer access token |
| x-instance-id (header) | string | no | Connection instance ID for persistent storage |
Request Body (required)
Request model for reporting tool usage errors
| Field | Type | Required | Description |
|---|---|---|---|
| product_id | string | yes | -- |
| error_message | string | yes | -- |
| recommended_improvements | string | no | -- |
Example request body
{
"product_id": "string",
"error_message": "string",
"recommended_improvements": "string"
}Responses
| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | no | `true` when the issue report was accepted. |
| message | string | no | Human-readable status message. |
| data | IssueReportData | yes | -- |
| issue_id | string | yes | ID of the issue document that was created. |
| product_found | boolean | yes | True when the reported product identifier resolved to a known product; false when the issue was still recorded against the raw identifier the caller supplied. |
| lookup_method | string | yes | How the product identifier was resolved (for example `object_id`, `slug`, `exact_name`, or `not_found`). |
| product_id | string | yes | Original product identifier the caller supplied. |
| product_name | string | no | Canonical product name, when the identifier resolved.anyOf variant 1 of 2 |
| status | string | yes | Issue status after creation. Reports are always opened in `open`. |
Example response
{
"success": true,
"message": "string",
"data": {
"issue_id": "string",
"product_found": true,
"lookup_method": "string",
"product_id": "string",
"product_name": "string",
"status": "string"
}
}| Field | Type | Required | Description |
|---|---|---|---|
| detail | ValidationError[] | no | -- |
| [item] | ValidationError | no | -- |
| loc | string[] | yes | -- |
| [item] | string | no | anyOf variant 1 of 2 |
| msg | string | yes | -- |
| type | string | yes | -- |
| input | any | no | -- |
| ctx | object | no | -- |
Example response
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}curl -X POST "https://api.agentpmt.com/issues/report" \
-H "Content-Type: application/json" \
-d '{
"product_id": "string",
"error_message": "string",
"recommended_improvements": "string"
}'GET/products/fetch
List tools available in your budget
List tools available in your budget.
https://api.agentpmt.comParameters
| Name | Type | Required | Description |
|---|---|---|---|
| page (query) | integer | no | Page number (1-based) |
| page_size (query) | integer | no | Items per page (max 100) |
| Authorization (header) | string | yes | Bearer access token |
| X-Page (header) | integer | no | Page number from header (alternative to query param) |
| X-Page-Size (header) | integer | no | Page size from header (alternative to query param) |
| x-instance-id (header) | string | no | Connection instance ID for persistent storage |
| x-instance-metadata (header) | string | no | Instance metadata as JSON string |
Responses
| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | no | `true` when the catalog was fetched successfully. |
| instance_id | string | no | Connection instance ID the caller can persist and echo back via the `x-instance-id` header on subsequent calls to keep per-session context.anyOf variant 1 of 2 |
| details | ProductsFetchDetails | yes | -- |
| tools_on_this_page | integer | yes | Number of tools included in this page of results. |
| total_qualified_tools | integer | yes | Total number of tools accessible to the caller (across all pages). |
| page_returned | integer | yes | Page index returned (1-based). |
| page_size_requested | integer | yes | Requested page size. |
| page_source | string | yes | `header` when the caller supplied `X-Page`; `query` otherwise. |
| page_size_source | string | yes | `header` when the caller supplied `X-Page-Size`; `query` otherwise. |
| total_pages | integer | yes | Total number of pages available. |
| has_next_page | boolean | yes | True when another page exists after this one. |
| has_previous_page | boolean | yes | True when a page exists before this one. |
| preprompt | string | yes | Human-readable preamble generated for downstream LLM callers. Changes based on whether any tools matched. |
| tools | ProductsFetchTool[] | yes | Tools available to the caller on this page. |
| [item] | ProductsFetchTool | no | Loose representation of a tool/product entry returned by /products/fetch. The full tool schema is product-specific; only the identifier, display label, and action metadata are stable across the catalog. Additional product-declared fields are passed through unchanged. |
| product_id | string | no | Tool ObjectId as a string.anyOf variant 1 of 2 |
| name | string | no | Tool function name used when invoking the tool.anyOf variant 1 of 2 |
| display_name | string | no | Human-readable product name.anyOf variant 1 of 2 |
| description | string | no | Short description of what the tool does.anyOf variant 1 of 2 |
| pagination | ProductsFetchPagination | yes | Canonical pagination descriptor (matches the `details` block). |
| page | integer | yes | Page index returned (1-based). |
| page_size | integer | yes | Page size used to compute this response. |
| total_count | integer | yes | Total number of items across all pages. |
| total_pages | integer | yes | Total number of pages available. |
| has_next | boolean | yes | True when another page exists after this one. |
| has_prev | boolean | yes | True when a page exists before this one. |
| example_tool_call | string | no | Illustrative curl command showing how to invoke one of the returned tools.anyOf variant 1 of 2 |
Example response
{
"success": true,
"instance_id": "string",
"details": {
"tools_on_this_page": 0,
"total_qualified_tools": 0,
"page_returned": 0,
"page_size_requested": 0,
"page_source": "string",
"page_size_source": "string",
"total_pages": 0,
"has_next_page": true,
"has_previous_page": true
},
"preprompt": "string",
"tools": [
{
"product_id": "string",
"name": "string",
"display_name": "string",
"description": "string"
}
],
"pagination": {
"page": 0,
"page_size": 0,
"total_count": 0,
"total_pages": 0,
"has_next": true,
"has_prev": true
},
"example_tool_call": "string"
}| Field | Type | Required | Description |
|---|---|---|---|
| detail | ValidationError[] | no | -- |
| [item] | ValidationError | no | -- |
| loc | string[] | yes | -- |
| [item] | string | no | anyOf variant 1 of 2 |
| msg | string | yes | -- |
| type | string | yes | -- |
| input | any | no | -- |
| ctx | object | no | -- |
Example response
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}curl -X GET "https://api.agentpmt.com/products/fetch"POST/products/purchase
Purchase Products Endpoint
Purchase and invoke a tool. Returns: Product call response with order confirmation and instance_id for connection tracking.
https://api.agentpmt.comParameters
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization (header) | string | yes | Bearer access token |
| x-instance-id (header) | string | no | Connection instance ID for persistent storage |
| x-instance-metadata (header) | string | no | Instance metadata as JSON string (AI agent info) |
Request Body (required)
Purchase-and-invoke request envelope. The `parameters` field is tool-specific; retrieve the declared action schema from `GET /products/fetch` or the product's marketplace page.
| Field | Type | Required | Description |
|---|---|---|---|
| product_id | string | yes | The ID of the tool (product) to purchase and invoke. |
| parameters | object | no | Action-specific parameters. The shape depends on the product's declared action schema. |
Example request body
{
"product_id": "<product_id>",
"parameters": {
"action": "<action_name>",
"example_param": "value"
}
}Responses
| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | no | -- |
| data | object | no | Tool-specific response payload returned by the product. |
| order_id | string | no | Identifier for the purchase/order that was created. |
| instance_id | string | no | Connection instance the caller can pass back via `x-instance-id` to persist state across calls. |
Example response
{
"success": true,
"data": {
"result": "value"
},
"order_id": "ord_01HXXXXXXXXXXXXXXX",
"instance_id": "inst_01HXXXXXXXXXXXXXXX"
}| Field | Type | Required | Description |
|---|---|---|---|
| detail | ValidationError[] | no | -- |
| [item] | ValidationError | no | -- |
| loc | string[] | yes | -- |
| [item] | string | no | anyOf variant 1 of 2 |
| msg | string | yes | -- |
| type | string | yes | -- |
| input | any | no | -- |
| ctx | object | no | -- |
Example response
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}curl -X POST "https://api.agentpmt.com/products/purchase" \
-H "Content-Type: application/json" \
-d '{
"product_id": "<product_id>",
"parameters": {
"action": "<action_name>",
"example_param": "value"
}
}'Trigger Autonomous Workflows Via Webhooks
POST/api/external/agent-webhooks/{workflowId}/trigger
Trigger a workflow run
https://www.agentpmt.comRequest Body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| prompt | string | yes | Prompt forwarded to the workflow for execution. |
| request_id | string | no | Caller-supplied idempotency key. Retrying with the same key returns the existing run. |
| callback_url | string | no | HTTPS URL that will receive a POST with the final run status. |
| request_metadata | object | no | 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
| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | yes | `true` when the trigger was accepted. |
| data | object | yes | -- |
| run | object | yes | -- |
| run_id | string | yes | MongoDB ObjectId of the run document. |
| workflow_id | string | yes | ObjectId of the workflow being executed. |
| status | "queued" | "running" | "succeeded" | "failed" | "cancelled" | yes | Lifecycle status of the run.enum: "queued", "running", "succeeded", "failed", "cancelled" |
| created_at | string | yes | ISO-8601 timestamp when the run was created. |
| updated_at | string | yes | ISO-8601 timestamp of the most recent state change. |
| status_url | string | yes | Absolute URL the caller can poll for run status. |
| message | string | yes | -- |
Example response
{
"success": true,
"data": {
"run": {
"run_id": "string",
"workflow_id": "string",
"status": "queued",
"created_at": "string",
"updated_at": "string"
},
"status_url": "string"
},
"message": "Workflow trigger accepted"
}| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | yes | `true` when the trigger was accepted. |
| data | object | yes | -- |
| run | object | yes | -- |
| run_id | string | yes | MongoDB ObjectId of the run document. |
| workflow_id | string | yes | ObjectId of the workflow being executed. |
| status | "queued" | "running" | "succeeded" | "failed" | "cancelled" | yes | Lifecycle status of the run.enum: "queued", "running", "succeeded", "failed", "cancelled" |
| created_at | string | yes | ISO-8601 timestamp when the run was created. |
| updated_at | string | yes | ISO-8601 timestamp of the most recent state change. |
| status_url | string | yes | Absolute URL the caller can poll for run status. |
| message | string | yes | -- |
Example response
{
"success": true,
"data": {
"run": {
"run_id": "string",
"workflow_id": "string",
"status": "queued",
"created_at": "string",
"updated_at": "string"
},
"status_url": "string"
},
"message": "Workflow trigger accepted"
}| Field | Type | Required | Description |
|---|---|---|---|
| success | false | yes | enum: false |
| error | string | yes | Stable machine-readable error code. |
| message | string | yes | Human-readable error message. |
Example response
{
"success": false,
"error": "string",
"message": "string"
}| Field | Type | Required | Description |
|---|---|---|---|
| success | false | yes | enum: false |
| error | string | yes | Stable machine-readable error code. |
| message | string | yes | Human-readable error message. |
Example response
{
"success": false,
"error": "string",
"message": "string"
}| Field | Type | Required | Description |
|---|---|---|---|
| success | false | yes | enum: false |
| error | "workflow_not_on_budget" | "missing_credentials" | "setup_required" | yes | Stable machine-readable error code.enum: "workflow_not_on_budget", "missing_credentials", "setup_required" |
| message | string | yes | -- |
| data | object | no | -- |
| workflow_request_id | any | no | Approval request ID when the workflow is not yet enabled on the budget. |
| credential_request_ids | string[] | no | Approval request IDs opened for the missing credentials. |
| [item] | string | no | -- |
| add_workflow | any | no | Card payload describing the workflow that needs to be added. |
| missing_credentials | object[] | no | Requirement descriptors for credentials that still need to be configured. |
| [item] | object | no | -- |
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": [
{}
]
}
}| Field | Type | Required | Description |
|---|---|---|---|
| success | false | yes | enum: false |
| error | string | yes | Stable machine-readable error code. |
| message | string | yes | Human-readable error message. |
Example response
{
"success": false,
"error": "string",
"message": "string"
}curl -X POST "https://www.agentpmt.com/api/external/agent-webhooks/example-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/external/agent-webhooks/runs/{runId}
Get workflow run status
https://www.agentpmt.comResponses
| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | yes | `true` when the run was located. |
| data | object | yes | -- |
| run | object | yes | -- |
| run_id | string | yes | MongoDB ObjectId of the run document. |
| workflow_id | string | yes | ObjectId of the workflow being executed. |
| status | "queued" | "running" | "succeeded" | "failed" | "cancelled" | yes | Lifecycle status of the run.enum: "queued", "running", "succeeded", "failed", "cancelled" |
| prompt | string | yes | Original prompt supplied when the run was triggered. |
| response_text | any | no | Final model response text once the run completes. |
| session_id | any | no | Chat session ID bound to this run, when available. |
| model | any | no | Model used to execute the run, when known. |
| error_code | any | no | Stable error code when the run failed. |
| error_message | any | no | Human-readable error message when the run failed. |
| callback_url | any | no | Registered callback URL, if the caller supplied one. |
| callback_status | "pending" | "delivered" | "failed" | "skipped" | yes | Delivery status of the callback.enum: "pending", "delivered", "failed", "skipped" |
| callback_last_status | any | no | HTTP status code from the most recent callback attempt. |
| callback_last_error | any | no | Error message from the most recent failed callback attempt. |
| callback_attempted_at | any | no | ISO-8601 timestamp of the most recent callback attempt. |
| callback_delivered_at | any | no | ISO-8601 timestamp when the callback was delivered successfully. |
| request_metadata | object | no | Metadata supplied with the original trigger request. |
| run_metadata | object | no | Internal per-run metadata captured during execution. |
| created_at | string | yes | ISO-8601 timestamp when the run was created. |
| updated_at | string | yes | ISO-8601 timestamp of the most recent state change. |
| started_at | any | no | ISO-8601 timestamp when execution began. |
| completed_at | any | no | ISO-8601 timestamp when execution finished, if completed. |
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
}
}
}| Field | Type | Required | Description |
|---|---|---|---|
| success | false | yes | enum: false |
| error | string | yes | Stable machine-readable error code. |
| message | string | yes | Human-readable error message. |
Example response
{
"success": false,
"error": "string",
"message": "string"
}| Field | Type | Required | Description |
|---|---|---|---|
| success | false | yes | enum: false |
| error | string | yes | Stable machine-readable error code. |
| message | string | yes | Human-readable error message. |
Example response
{
"success": false,
"error": "string",
"message": "string"
}| Field | Type | Required | Description |
|---|---|---|---|
| success | false | yes | enum: false |
| error | string | yes | Stable machine-readable error code. |
| message | string | yes | Human-readable error message. |
Example response
{
"success": false,
"error": "string",
"message": "string"
}| Field | Type | Required | Description |
|---|---|---|---|
| success | false | yes | enum: false |
| error | string | yes | Stable machine-readable error code. |
| message | string | yes | Human-readable error message. |
Example response
{
"success": false,
"error": "string",
"message": "string"
}curl -X GET "https://www.agentpmt.com/api/external/agent-webhooks/runs/example-runId"Public
GET/health
API health probe
https://api.agentpmt.comResponses
Response shape for the API health probe.
| Field | Type | Required | Description |
|---|---|---|---|
| status | string | yes | Always `ok` when the API process is accepting requests. |
Example response
{
"status": "string"
}curl -X GET "https://api.agentpmt.com/health"GET/public/jwt-public-key
Fetch the JWT verification public key
Get the JWT public key for verifying vendor access tokens.
https://api.agentpmt.comResponses
Response shape for the public JWT verification key endpoint.
| Field | Type | Required | Description |
|---|---|---|---|
| success | boolean | no | `true` when the key was returned. |
| public_key | string | yes | PEM-encoded public key callers can use to verify access tokens issued by this API. |
| algorithm | string | yes | JWT signing algorithm paired with `public_key`. |
| message | string | yes | Human-readable explanation of the payload. |
Example response
{
"success": true,
"public_key": "string",
"algorithm": "string",
"message": "string"
}curl -X GET "https://api.agentpmt.com/public/jwt-public-key"Embedding
GET/embed.js
Load the AgentPMT chat widget loader script
https://www.agentpmt.comResponses
Returns JavaScript source.
No response body schema published.
No response body schema published.
No response body schema published.
curl -X GET "https://www.agentpmt.com/embed.js"GET/embed/{workflowId}
Embed the chat widget scoped to a workflow
https://www.agentpmt.comResponses
Returns HTML document.
No response body schema published.
No response body schema published.
Returns HTML document.
No response body schema published.
curl -X GET "https://www.agentpmt.com/embed/example-workflowId"GET/embed/bundle/{bundleId}
Embed the chat widget scoped to a bundle of tools and workflows
https://www.agentpmt.comResponses
Returns HTML document.
No response body schema published.
No response body schema published.
Returns HTML document.
No response body schema published.
curl -X GET "https://www.agentpmt.com/embed/bundle/example-bundleId"GET/embed/product/{productId}
Embed the chat widget scoped to a single product tool
https://www.agentpmt.comResponses
Returns HTML document.
No response body schema published.
No response body schema published.
Returns HTML document.
No response body schema published.
curl -X GET "https://www.agentpmt.com/embed/product/example-productId"
