iotoms Docs

Propose a customer change with AI

POST
/api/v1/ai/agent/propose

Extracts customer details from a free-text description and returns a proposed create or update for a person to review. Nothing is saved until the proposal is confirmed; it expires after 5 minutes.

How to use it

  1. Send entityType CUSTOMER with a description such as a name, email and city, or UPDATE_CUSTOMER with the customerNumber (from List customers) and the change.
  2. Show the returned proposal and message to a person for review; nothing is saved yet.
  3. Within 5 minutes, call Confirm an AI customer proposal with the proposalId, or let it expire.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Header Parameters

Request Body

application/json
  1. body
entityType*string

What to propose: CUSTOMER to create a new customer or UPDATE_CUSTOMER to change one. ITEM is rejected here; items are drafted from the assistant chat.

Value in"CUSTOMER""UPDATE_CUSTOMER""ITEM"
description*string

Free-text description of the customer or the change, e.g. a name, email and city. Required, at most 500 characters. Text containing a web link or instruction-like phrases is rejected; characters such as < > quotes, ; and backticks are removed before the AI reads it.

customerNumber?|

Customer number of the customer to change. Required when entityType is UPDATE_CUSTOMER; it cannot be changed later at confirm time.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request was handled, ERROR otherwise.

message*string

Short human-readable message describing the outcome, e.g. which record was fetched or saved.

data?

The proposal the AI extracted, waiting for a person to review and confirm.

Example Request
curl -X POST 'https://beta.iotoms.com/api/v1/ai/agent/propose' \  -H 'Content-Type: application/json' \  -d '{  "entityType": "CUSTOMER",  "description": "string"}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "proposalId": "string",    "entityType": "CUSTOMER",    "status": "PENDING",    "proposal": {},    "expiresAt": "2019-08-24T14:15:22Z",    "message": "string",    "warnings": [      "string"    ]  }}