PinionAI API
This document provides details about the golang API endpoints available in the PinionAI API agent service.
Authentication
Most endpoints require a Bearer token in the Authorization header for authentication.
Authorization: Bearer <YOUR_ACCESS_TOKEN>
Endpoint Summary
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /agent/:uid | Yes | Start a new agent session from an agent UID |
| GET | /agentcore/:uid | Yes | Retrieve an agent's base configuration without creating a session |
| GET | /agentlist | Yes | Retrieve a list of active agents with their IDs and descriptions |
| GET | /schedules | Yes | Retrieve active schedules for the authenticated account |
| GET | /version/:uid | Yes | Start a new agent session from the latest version |
| GET | /version/:uid/:version_type | Yes | Start a new agent session from a specific version type |
| GET | /versioncore/:uid | Yes | Retrieve the live version configuration without creating a session |
| GET | /versioncore/:uid/:version_type | Yes | Retrieve a version configuration without creating a session |
| POST | /agent | No | Update agent data (stub implementation) |
| POST | /token | No | Create a bearer token using client credentials |
| POST | /session | Yes | Create or update a session with session data |
| GET | /session/:uid | Yes | Get session details by UID |
| GET | /session/:uid/lastmodified | Yes | Get session last modified timestamp |
| DELETE | /session/:uid | Yes | Delete a session of the account with its engagements and form transactions |
| POST | /engagement | Yes | Record a human engagement (hand-off) with a session of the account |
| POST | /events | Yes | Post events (single or batch) for the account's event routes; duplicates by key are ignored |
| GET | /customer/:value | Yes | Get customer by phone, email, or UID |
| POST | /customer | Yes | Create a new customer |
| POST | /customer/:uid | Yes | Update an existing customer |
| GET | /filesession/:uid | Yes | Create an empty session for an agent UID |
| POST | /filesession | No | Create a session using a version key and return a generated token |
| POST | /transaction | Yes | Create a new transaction record |
| GET | /transaction/:shortened | No | Retrieve transaction and form config by shortened token |
| POST | /compare/:uid | No | Compare a supplied value with an active transaction secret |
| PUT | /transaction/:uid | No | Update transaction status and response message |
| POST | /connector | Yes | Retrieve an auth token for a connector |
| POST | /vconnector | Yes | Retrieve a connector client secret |
| POST | /database | Yes | Retrieve database connector details |
| POST | /retrieve | Yes | Retrieve RAG store chunks (pgvector similarity search) |
| GET | /.well-known/oauth-authorization-server | No | RFC 8414 OAuth 2.0 Authorization Server Metadata (automated discovery) |
| GET | /.well-known/oauth-protected-resource | No | RFC 9728 OAuth 2.0 Protected Resource Metadata (links resource to its auth server) |
| GET | /mcp/sse | Yes | Connect to Model Context Protocol (MCP) server stream (SSE) |
| POST | /mcp/message | Yes* | Handle incoming MCP client JSON-RPC messages (requires active sessionId as query parameter) |
| POST | /mcp | Yes | Modern, stateless Model Context Protocol (MCP) Streamable HTTP endpoint |
| POST | /formname | Yes | Retrieve form fields from forms table by name |
| POST | /status | Yes | Retrieve transaction status and response message for a specific transaction |
Endpoints
1. Start Agent Session
- Endpoint:
GET /agent/:uid - Method:
GET - Description: Starts a new agent session by loading agent data for the requested UID and creating a session record.
- Authorization: Bearer token required.
- Path Parameters:
uid(string, required): Agent UID.- Response:
200 OKwith session metadata and raw session data.400 Bad Requestif the UID is invalid.401 Unauthorizedif the authorization header is missing, malformed, invalid, or expired.404 Not Foundif the agent does not exist.500 Internal Server Erroron database or session creation failures.
Example response:
{
"success": true,
"message": "Agent started successfully",
"data": {
"uid": "session_uid",
"customer_uid_fk": null,
"agent_uid_fk": "agent_id",
"account_uid_fk": "account_id",
"session_data": {
"agent": {
"agentId": "..."
}
},
"created": "...",
"lastmodified": "..."
}
}
1a. Retrieve Agent Configuration Without a Session
- Endpoint:
GET /agentcore/:uid - Method:
GET - Description: Retrieves the base agent configuration for the UID without creating a session.
- Authorization: Bearer token required.
- Path Parameters:
uid(string, required): Agent UID.- Response:
200 OKwith the raw agent configuration indata.401 Unauthorizedif authentication fails.404 Not Foundif the agent does not exist.
Example response:
{
"success": true,
"message": "Agent configuration retrieved successfully",
"data": {
"agent": {
"agentId": "..."
}
}
}
1b. Retrieve Agent List
- Endpoint:
GET /agentlist - Method:
GET - Description: Retrieves a list of active agents associated with the authorized account, sorted alphabetically by name.
- Authorization: Bearer token required.
- Response:
200 OKwith a JSON payload containing the success flag and the list of active agents with their unique IDs, names, and descriptions.401 Unauthorizedif the authorization header is missing, malformed, invalid, or expired.500 Internal Server Erroron database or query failures.
Example response:
{
"success": true,
"data": [
{
"uid": "agent-1-uuid",
"agent_name": "Billing Assistant",
"agent_description": "Handles billing questions"
},
{
"uid": "agent-2-uuid",
"agent_name": "Tech Support",
"agent_description": "Technical support agent"
}
]
}
1c. Retrieve Account Schedules
- Endpoint:
GET /schedules - Method:
GET - Description: Retrieves active schedules belonging to the account associated with the bearer token.
- Authorization: Bearer token required.
- Response:
200 OKwith adataarray containingschedule_id,agent_id,command,version,schedule_name,schedule_prompt_name,schedule_knowledge,schedule_plan, andcron_expressionfor each schedule.401 Unauthorizedif the authorization header is missing, malformed, invalid, or expired.500 Internal Server Erroron token lookup or schedule query failures.
Example response:
{
"success": true,
"data": [
{
"schedule_id": 11,
"agent_id": "agent-1",
"command": "run",
"version": "live",
"schedule_name": "Morning run",
"schedule_prompt_name": "daily_prompt",
"schedule_knowledge": "knowledge text",
"schedule_plan": "plan text",
"cron_expression": "0 9 * * *"
}
]
}
2. Start Agent Session from Latest Version
- Endpoint:
GET /version/:uid - Method:
GET - Description: Starts a new session using the latest available version for the agent UID.
- Authorization: Bearer token required.
- Path Parameters:
uid(string, required): Agent UID.- Response:
200 OKwith created session information.401 Unauthorizedif authentication fails.404 Not Foundif no version is found for the account and agent.500 Internal Server Erroron query or session creation failures.
3. Start Agent Session from Specific Version Type
- Endpoint:
GET /version/:uid/:version_type - Method:
GET - Description: Starts a new session using a specific version type (for example,
sandboxorlive). - Authorization: Bearer token required.
- Path Parameters:
uid(string, required): Agent UID.version_type(string, required): Version type.- Response: Same as
GET /version/:uid.
3a. Retrieve Latest Live Version Without a Session
- Endpoint:
GET /versioncore/:uid - Method:
GET - Description: Retrieves the active
liveversion configuration for the agent without creating a session. The version lookup uses the authenticated account and the most recently modified active version. - Authorization: Bearer token required.
- Path Parameters:
uid(string, required): Agent UID.- Response:
200 OKwith the selected version's agent configuration indata.401 Unauthorizedif authentication fails.404 Not Foundif no matching version exists.
3b. Retrieve Specific Version Without a Session
- Endpoint:
GET /versioncore/:uid/:version_type - Method:
GET - Description: Retrieves the most recently modified active version configuration of the requested type without creating a session (for example,
sandboxorlive). - Authorization: Bearer token required.
- Path Parameters:
uid(string, required): Agent UID.version_type(string, required): Version type.- Response: Same as
GET /versioncore/:uid, with the requested version type selected.
3c. Compare Transaction Secret
- Endpoint:
POST /compare/:uid - Method:
POST - Description: Compares the supplied value with the secret for an unexpired transaction that has not succeeded. The path UID is the transaction UID. No sign-in; limited to 5 attempts a minute per client address and, per transaction, locked for 15 minutes after 5 wrong values (
429). - Authorization: No bearer token required by this handler.
- Path Parameters:
uid(string, required): Transaction UID.- Request Body:
- Response:
200 OKwith the bare JSON booleantruewhen the value matches; otherwisefalse. A missing eligible transaction also returnsfalse.400 Bad Requestif the path or JSON body is invalid, orvalueis missing.500 Internal Server Erroron database failures.
4. Update Agent
- Endpoint:
POST /agent - Method:
POST - Description: Accepts agent update payloads and returns a fixed success response.
- Authorization: No explicit bearer check in code.
- Request Body:
- Response:
201 Createdwith a placeholder success response.
Example response:
5. Generate Token
- Endpoint:
POST /token - Method:
POST - Description: Creates an access token from client credentials.
- Content-Type:
application/x-www-form-urlencoded - Request Body Fields:
grant_type(required): Must beclient_credentials.client_id(required)client_secret(required)- Response:
200 OKwith token details.400 Bad Requestif the content type or grant type is invalid.401 Unauthorizedif credentials are invalid.500 Internal Server Errorif token generation fails.
Example response:
6. Create or Update Session
- Endpoint:
POST /session - Method:
POST - Description: Creates or updates session data for an existing session UID.
- Authorization: Bearer token required.
- Request Body:
{
"sessionUid": "session_uid",
"data": {
"...": "..."
},
"transferRequested": "2026-07-06T12:00:00Z",
"transferAccepted": "2026-07-06T12:05:00Z"
}
- Notes:
sessionUidanddataare required.transferRequestedandtransferAcceptedare optional RFC3339 timestamps.- Response:
200 OKwith updated session details.400 Bad Requeston invalid JSON or missing required fields.401 Unauthorizedif the token is invalid or expired.404 Not Foundif the session does not exist.500 Internal Server Errorif the update fails.
7. Get Session
- Endpoint:
GET /session/:uid - Method:
GET - Description: Fetches a session by UID.
- Authorization: Bearer token required.
- Path Parameters:
uid(string, required): Session UID.- Response:
200 OKwith session data.401 Unauthorizedif authentication fails.404 Not Foundif the session is missing.500 Internal Server Erroron query failure.
8. Get Session Last Modified Timestamp
- Endpoint:
GET /session/:uid/lastmodified - Method:
GET - Description: Returns the last modified timestamp of a session.
- Authorization: Bearer token required.
- Path Parameters:
uid(string, required): Session UID.- Response:
200 OKwith the timestamp.404 Not Foundif the session is missing.
8a. Delete Session
- Endpoint:
DELETE /session/:uid - Description: Deletes a session of the token's account together with its engagements and form transactions (a client's retention, or a person's request to be forgotten).
- Authorization: Bearer token required; only sessions of the token's account can be deleted.
- Response:
200 OK{"success": true, "data": {"deleted": "<uid>"}};404 Not Foundwhen the account has no such session.
8b. Record an Engagement
- Endpoint:
POST /engagement - Description: Records a human engagement with a session of the token's account. A client whose own desk answers transfer requests uses it, so the session leaves the Studio's User Agent queue and the hand-off is listed on the Engagements page.
- Authorization: Bearer token required.
- Body:
{"sessionUid": "...", "status": "Completed", "queue": "Support desk", "notes": "case 123", "completed": true}.statusis one ofAccepted,In Progress,Waiting,Completed(defaultCompleted);completed(defaulttrue) stamps the completion time;queueup to 100 characters. - Response:
200 OK{"success": true, "data": {"uid": "<engagement uid>", "arrival": "..."}};400for a missingsessionUidor an unknown status;404 Not Foundwhen the account has no such session.
8c. Post Events
- Endpoint:
POST /events - Description: Stores events for the token's account; PinionAI's event worker runs the agent intent each event's route names (Studio Events page), with retries.
- Authorization: Bearer token required.
- Body:
{"type": "deal.changed", "key": "deal:123:7", "occurred_at": "<RFC 3339, optional>", "payload": {...}}, or{"events": [...]}with 1-500 events.keyis an idempotency key per account;payloadmust be an object. - Response:
200 OK{"success": true, "data": {"accepted": n, "duplicates": n, "rejected": n, "events": [{"key", "uid", "duplicate", "error"}]}};400for a body that is not JSON or has no events.
9. Get Customer
- Endpoint:
GET /customer/:value - Method:
GET - Description: Retrieves customer details using phone, email, or UID. The stored password is never returned.
- Authorization: Bearer token required.
- Path Parameters:
value(string, required): Customer phone, email, or UID.- Response:
200 OKwith customer object.404 Not Foundif no matching customer exists.
10. Create Customer
- Endpoint:
POST /customer - Method:
POST - Description: Creates a new customer record for the authenticated account. Passwords are stored as bcrypt hashes (at most 72 bytes; longer is
400) and never returned. - Authorization: Bearer token required.
- Request Body:
{
"phone": "1234567890",
"email": "test@example.com",
"firstName": "John",
"lastName": "Doe",
"password": "securepassword"
}
- Response:
201 Createdwith the created customer object.400 Bad Requestif the body cannot be parsed.500 Internal Server Errorif the customer cannot be created.
11. Update Customer
- Endpoint:
POST /customer/:uid - Method:
POST - Description: Updates an existing customer record for the authenticated account. A new password is stored as a bcrypt hash; none is ever returned.
- Authorization: Bearer token required.
- Path Parameters:
uid(string, required): Customer UID.- Request Body:
{
"customerFirst": "Jane",
"customerLast": "Smith",
"customerEmail": "jane@example.com",
"customerPhone": "0987654321",
"customerConfig": {},
"customerData": {},
"customerPassword": "newpassword"
}
- Response:
200 OKwith the updated customer.400 Bad Requeston invalid body.404 Not Foundif the customer does not exist.
12. Create File Session
- Endpoint:
GET /filesession/:uid - Method:
GET - Description: Creates a new session for an agent with an empty JSON session payload.
- Authorization: Bearer token required.
- Path Parameters:
uid(string, required): Agent UID.- Response:
200 OKwith created session details.401 Unauthorizedif token authentication fails.
13. Create File Session from Version Key
- Endpoint:
POST /filesession - Method:
POST - Description: Creates a filesession from a version key and optionally returns a bearer token.
- Request Body:
{
"key_id": "key-id",
"version_name": "version-name",
"date_time": "2026-07-06T12:00:00Z",
"payload": true,
"key_secret": "optional-secret"
}
- Notes:
key_secretis required for private versions.payloaddefaults totrue; whentruean empty session is created.- Response:
200 OKwith session data, generated access token, expiry, and optionalkey_secret.
Example response:
{
"success": true,
"message": "filesession created",
"data": { ... },
"verion_type": "live",
"access_token": "...",
"expires_in": 3600,
"key_secret": null
}
14. Create Transaction
- Endpoint:
POST /transaction - Method:
POST - Description: Creates a transaction record and returns a success URL.
- Authorization: Bearer token required.
- Request Body:
{
"transaction_form_name": "form_name",
"transaction_variables": { "field1": "value" },
"agent_uid_fk": "agent_uid",
"session_uid_fk": "session_uid",
"ttl": 2
}
- Notes:
transaction_variablesdefaults to{}when omitted.ttlis in hours; defaults to1hour when omitted or non-positive.- Response:
201 Createdwith transaction details andsuccess_url.
Example response:
{
"success": true,
"message": "Transaction created successfully",
"data": { ... },
"success_url": "https://f.pinionai.com?f=<shortened>"
}
15. Get Transaction
- Endpoint:
GET /transaction/:shortened - Method:
GET - Description: Retrieves transaction data and form configuration by a shortened token that encodes the session UID and transaction UID.
- Path Parameters:
shortened(string, required): Base64 URL-safe encoded session and transaction IDs.- Response:
200 OKwith form configuration and transaction variables.400 Bad Requestif the shortened token cannot be decoded.404 Not Foundif the transaction is missing or expired.
Example response:
{
"success": true,
"data": {
"FormConfiguration": { ... },
"TransactionVariables": { ... },
"TransactionUid": "..."
}
}
16. Update Transaction Status
- Endpoint:
PUT /transaction/:uid - Method:
PUT - Description: The forms app reports a form's outcome: no sign-in, the random transaction UID in the form link is the credential. Only
successorerroris accepted, only while the transaction is open (not expired, not alreadysuccess); the message is cut to 2000 characters. - Path Parameters:
uid(string, required): Transaction UID.- Request Body:
- Response:
200 OKwith the updated transaction.400 Bad Requeston invalid JSON or another status.404 Not Foundif the transaction does not exist, has expired or already succeeded.
17. Get Connector Token
- Endpoint:
POST /connector - Method:
POST - Description: Retrieves a connector access token for the authenticated account.
- Authorization: Bearer token required.
- Request Body: Either a JSON object or raw JSON string specifying the connector name.
Example object format:
Example raw string format:
- Response:
200 OKwith the connector token.404 Not Foundif the connector is missing.500 Internal Server Errorif token generation fails.
Example response:
- API Key connectors: no token endpoint is called;
tokenis<auth scheme> <key>(or the key alone) andheadernames the header to send it in (defaultAuthorization).
18. Get Connector Client Secret
- Endpoint:
POST /vconnector - Method:
POST - Description: Retrieves the client secret for a connector.
- Authorization: Bearer token required.
- Request Body: Same formats as
/connector. - Response:
200 OKwithvconnectorsecret.404 Not Foundif the connector is missing.
Example response:
{
"success": true,
"message": "Client secret retrieved successfully",
"data": {
"vconnector": "secret-value"
}
}
19. Get Database Connector Details
- Endpoint:
POST /database - Method:
POST - Description: Retrieves database connector configuration details for the authenticated account.
- Authorization: Bearer token required.
- Request Body: Same
connector_nameformat as/connectorand/vconnector. - Response:
200 OKwith database connector details.404 Not Foundif the connector is missing.
Example response:
{
"success": true,
"message": "Connector details fetched successfully",
"data": {
"connector_name": "...",
"connector_url": "...",
"connector_client_id": "...",
"connector_client_secret": "...",
"connector_port": "..."
}
}
19a. Retrieve Store Chunks
- Endpoint:
POST /retrieve - Method:
POST - Description: Runs a pgvector similarity search for a RAG store owned by the authenticated account. The caller embeds the question with the store's embedding model (see
agent.stores[].embeddingModel/embeddingProvider/embeddingDimensionsin the session data) and sends the vector; the API resolves the store by name, picks the database that holds its chunks (the store's Database connector or the platform database) and returns the closest chunks. - Authorization: Bearer token required.
- Request Body:
{
"store": "Product Manuals",
"embedding": [0.0123, -0.0456],
"top_k": 10,
"threshold": 0.5,
"query_text": "how do I reset the device"
}
store(required): store name.embedding(required): query vector; its length must equal the store'sembeddingDimensions.top_k(optional, 1-100) andthreshold(optional cosine distance, 0-2) default to the store settings.query_text(optional): enables hybrid vector + full-text retrieval when the store has hybrid search turned on.- Response:
200 OKwith the chunks ordered by relevance.400 Bad Requestif the store is not configured for pgvector or the vector has the wrong size.404 Not Foundif the store does not exist for the account.502 Bad Gatewayif the store's database is unreachable.
Example response:
{
"success": true,
"message": "Chunks retrieved successfully",
"data": {
"store": "Product Manuals",
"store_uid": "4f4d4d9a-2f2e-4a0b-9c3f-0123456789ab",
"hybrid": false,
"top_k": 10,
"threshold": 0.5,
"count": 2,
"chunks": [
{
"id": 1,
"store_file_uid": "f1",
"file_name": "manual.pdf",
"chunk_index": 0,
"content": "...",
"distance": 0.12,
"metadata": {}
},
{
"id": 2,
"store_file_uid": "f1",
"file_name": "manual.pdf",
"chunk_index": 3,
"content": "...",
"distance": 0.31,
"metadata": {}
}
]
}
}
20. OAuth 2.0 Authorization Server Metadata
- Endpoint:
GET /.well-known/oauth-authorization-server - Method:
GET - Description: Returns RFC 8414 compliant metadata describing this server's OAuth capabilities and token endpoint. Used by automated clients for discovery.
- Authorization: No authorization required.
- Response:
200 OKwith JSON object containing server credentials configuration.
Example response:
{
"issuer": "https://api.example.com",
"token_endpoint": "https://api.example.com/token",
"token_endpoint_auth_methods_supported": ["client_secret_post"],
"grant_types_supported": ["client_credentials"],
"response_types_supported": []
}
21. OAuth 2.0 Protected Resource Metadata
- Endpoint:
GET /.well-known/oauth-protected-resource - Method:
GET - Description: Returns RFC 9728 compliant metadata linking this API (protected resource) to its matching Authorization Server (itself) to facilitate automated dynamic token discovery.
- Authorization: No authorization required.
- Response:
200 OKwith JSON metadata linking back to authorization resources.
Example response:
{
"resource": "https://api.example.com",
"authorization_servers": ["https://api.example.com"],
"scopes_supported": ["api"],
"bearer_methods_supported": ["header"]
}
22. MCP SSE Connection Endpoint
- Endpoint:
GET /mcp/sse - Method:
GET - Description: Establishes a persistent Server-Sent Events (SSE) connection to access Model Context Protocol (MCP) server capabilities. Upon connecting, the server immediately pushes an
endpointevent containing a relative message posting URI with an assignedsessionIdfor this client stream. - Authorization: Bearer token required (accepted via
Authorization: Bearer <token>header OR query parameter?token=<token>). - Response:
200 OKwithContent-Type: text/event-streamand chunked transfer.401 Unauthorizedif no valid token is provided or has expired.
Example handshake event pushed by server:
23. MCP Message Processor Endpoint
- Endpoint:
POST /mcp/message - Method:
POST - Description: Post endpoint for sending JSON-RPC 2.0 requests to the active MCP session. The request body is processed asynchronously and any resulting JSON-RPC response or error frame is returned via the corresponding SSE channel stream established on
/mcp/sse. - Query Parameters:
sessionId(string, required): The active session UUID returned by the initial/mcp/sseendpointhandshake event.- Request Body: Standard JSON-RPC 2.0 Request Object.
- Responses:
202 Acceptedindicating the message is successfully enqueued for processing.400 Bad Requeston invalid formatting.404 Not Foundif the session ID is missing or has expired.
Exposed MCP Tools
Under MCP capabilities, the API exposes the following executable tool:
create_transaction
- Description: Create a new transaction record for a form. Returns transaction details and a success URL.
- Arguments JSON Schema:
{ "type": "object", "properties": { "transaction_form_name": { "type": "string", "description": "The name of the form associated with the transaction." }, "transaction_variables": { "type": "object", "description": "JSON object containing form variables (key-value pairs)." }, "agent_uid_fk": { "type": "string", "description": "The unique identifier of the agent." }, "session_uid_fk": { "type": "string", "description": "The unique identifier of the session (optional, generated if omitted)." }, "ttl": { "type": "integer", "description": "Time to live in hours (optional, defaults to 1)." } }, "required": ["transaction_form_name", "agent_uid_fk"] }
get_form_fields
- Description: Retrieve form fields for a given form name.
- Arguments JSON Schema:
get_transaction_status
- Description: Retrieve transaction status and response message for a specific transaction.
- Arguments JSON Schema:
24. Form Fields Endpoint
- Endpoint:
POST /formname - Method:
POST - Description: Retrieve form fields from the forms table for a given form name.
- Authorization: Bearer token required (accepted via
Authorization: Bearer <token>header OR query parameter?token=<token>). - Request Body:
- Responses:
200 OKwith JSON payload containing the form name and fields.400 Bad Requestifform_nameis missing or invalid.401 Unauthorizedif token is missing, invalid, or expired.404 Not Foundif the form does not exist.
25. Modern MCP Endpoint
- Endpoint:
POST /mcp - Method:
POST - Description: Modern, stateless Model Context Protocol (MCP) Streamable HTTP endpoint. Processes incoming JSON-RPC 2.0 requests synchronously.
- Authorization: Bearer token required (accepted via
Authorization: Bearer <token>header OR query parameter?token=<token>). - Headers:
MCP-Protocol-Version(string, required): Must equal"2026-07-28"(or legacy"2024-11-05").Mcp-Method(string, required): Mirrors the JSON-RPC body method.Mcp-Name(string, optional): Required fortools/call, mirroring the tool name (e.g."create_transaction","get_form_fields", or"get_transaction_status").- Request Body: Standard JSON-RPC 2.0 Request Object.
- Responses:
200 OKwith standard JSON-RPC 2.0 Response Object in the body (application/json).400 Bad Requestwith code-32020on header mismatch or missing headers.401 Unauthorizedif token is missing or invalid.403 Forbiddenif theOriginheader is present but invalid.404 Not Foundwith code-32601if the method or tool is unknown.
26. Transaction Status Endpoint
- Endpoint:
POST /status - Method:
POST - Description: Retrieve transaction status and response message for a specific transaction.
- Authorization: Bearer token required (accepted via
Authorization: Bearer <token>header OR query parameter?token=<token>). - Request Body:
- Responses:
200 OKwith JSON payload containing the transaction status and optional response message.400 Bad RequestiftransactionUidis missing or invalid.401 Unauthorizedif token is missing, invalid, or expired.404 Not Foundif the transaction does not exist.
Data Structures
pathParameters
customerParameters
Token endpoint form fields
The /token endpoint requires application/x-www-form-urlencoded input with the following fields:
grant_type: must beclient_credentialsclient_idclient_secret
CreateCustomerRequest
type CreateCustomerRequest struct {
Phone string `json:"phone"`
Email string `json:"email"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Password string `json:"password"`
}
CreateTransactionRequest
type CreateTransactionRequest struct {
TransactionFormName string `json:"transaction_form_name" binding:"required"`
TransactionVariables json.RawMessage `json:"transaction_variables"`
AgentUidFk string `json:"agent_uid_fk" binding:"required"`
SessionUidFk string `json:"session_uid_fk" binding:"required"`
TTL int `json:"ttl"`
TransactionSecretFieldName string `json:"transaction_secret_field_name"`
TransactionSecret string `json:"transaction_secret"`
}
UpdateTransactionStatusRequest
type UpdateTransactionStatusRequest struct {
TransactionStatus string `json:"transaction_status" binding:"required"`
TransactionResponseMessage string `json:"transaction_response_message"`
}
GetTransactionStatusRequest
type GetTransactionStatusRequest struct {
TransactionUid string `json:"transactionUid" binding:"required"`
}
ConnectorRequest
RetrieveRequest
type RetrieveRequest struct {
Store string `json:"store" binding:"required"`
Embedding []float64 `json:"embedding" binding:"required"`
TopK *int `json:"top_k"`
Threshold *float64 `json:"threshold"`
QueryText string `json:"query_text"`
}
TokenResponse
type TokenResponse struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int64 `json:"expires_in"`
}
Token
type Token struct {
ID int64 `json:"id"`
AccountUidFk string `json:"account_uid_fk"`
TokenType int32 `json:"token_type"`
Token string `json:"token"`
Expiry time.Time `json:"expiry"`
Lastmodified time.Time `json:"lastmodified"`
}
Notes
- The
POST /agentendpoint is currently implemented as a placeholder and does not perform a real update. POST /sessionexpectsdataas a JSON object and requiressessionUid.POST /filesessionmay return a generated bearer token and access to a version-based session./transaction/:shorteneddecodes a combined session and transaction UID using a URL-safe Base64 format.- Most endpoints that require authentication use Bearer token validation with expiry checking.
- CORS is enabled for all origins by default (should be restricted for production use).