curl --request POST \
--url https://omnicommerce.ai/api/v1/follow-ups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"threadId": "thread_123",
"note": "Compare SKU A-1's units sold over the 7 days since the price cut with the 7 days before; if there is no lift, propose reverting the price."
}
EOFconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
threadId: 'thread_123',
note: 'Compare SKU A-1\'s units sold over the 7 days since the price cut with the 7 days before; if there is no lift, propose reverting the price.'
})
};
fetch('https://omnicommerce.ai/api/v1/follow-ups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.ai/api/v1/follow-ups"
payload = {
"threadId": "thread_123",
"note": "Compare SKU A-1's units sold over the 7 days since the price cut with the 7 days before; if there is no lift, propose reverting the price."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"operationId": "<string>",
"status": "<string>",
"data": {
"followUp": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"threadId": "<string>",
"state": "waiting",
"trigger": "schedule",
"note": "<string>",
"then": "resume",
"expiresAt": "2023-11-07T05:31:56Z",
"ownerUserId": "<string>",
"fireAt": "2023-11-07T05:31:56Z",
"eventType": "<string>",
"match": "<string>",
"firedAt": "2023-11-07T05:31:56Z",
"failure": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"url": "<string>"
}
}
}Create Follow-up
Leave a one-shot follow-up on an assistant conversation you can open. Give exactly one of at (ISO 8601 with a timezone), after (a duration such as 90m, 4h, 14d or 2w) or eventType with an optional CEL match over event (the event’s condition fields, as in AOP event triggers).
When it fires it continues threadId from note as you (then=resume, the default) or only emails you (then=notify). It never interrupts a run in progress: the continuation waits in the conversation’s queue. A stopped conversation, or one whose last run failed, is not continued.
An event follow-up waits expires (10d by default) for its event; a timed one may be at most a year ahead.
Authorization
Requires agents:invoke with a person’s credential (API key or session); OAuth client credentials act for no one and are refused. The follow-up runs as that person.
curl --request POST \
--url https://omnicommerce.ai/api/v1/follow-ups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"threadId": "thread_123",
"note": "Compare SKU A-1's units sold over the 7 days since the price cut with the 7 days before; if there is no lift, propose reverting the price."
}
EOFconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
threadId: 'thread_123',
note: 'Compare SKU A-1\'s units sold over the 7 days since the price cut with the 7 days before; if there is no lift, propose reverting the price.'
})
};
fetch('https://omnicommerce.ai/api/v1/follow-ups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.ai/api/v1/follow-ups"
payload = {
"threadId": "thread_123",
"note": "Compare SKU A-1's units sold over the 7 days since the price cut with the 7 days before; if there is no lift, propose reverting the price."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"operationId": "<string>",
"status": "<string>",
"data": {
"followUp": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"threadId": "<string>",
"state": "waiting",
"trigger": "schedule",
"note": "<string>",
"then": "resume",
"expiresAt": "2023-11-07T05:31:56Z",
"ownerUserId": "<string>",
"fireAt": "2023-11-07T05:31:56Z",
"eventType": "<string>",
"match": "<string>",
"firedAt": "2023-11-07T05:31:56Z",
"failure": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"url": "<string>"
}
}
}Authorizations
Bearer API key for server-to-server access. Session auth is also supported in first-party UI flows.
Body
What to check or do when the follow-up fires.
1 - 4000The assistant conversation (session) to continue.
1 - 200Future ISO 8601 time with timezone. Use only one trigger.
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$Delay such as 90m, 4h, 14d or 2w.
Fire on this event's first matching occurrence.
telegram.message.received, customer.message.received, product.created, product.updated, product.deleted, product.delisted, product.price.changed, product.inventory.changed, product.enrichment.started, product.enrichment.completed, product.listing.error, product.geo.created, product.geo.updated, product.ai_visibility.measured, agent.action.approved, order.created, order.updated, order.deleted, order.status.changed, look.created, look.deleted, review.created, review.updated, review.status.changed, campaign.started, campaign.window.started, campaign.window.completed, campaign.window.failed, campaign.offer.failed, campaign.completed, account_statement.created, account_statement.updated, account_statement.status.changed, account_statement.reconciliation.changed, account_statement.transactions.synced, account_statement.transactions.failed, account_statement.sync.queued, account_statement.sync.started, account_statement.sync.completed, account_statement.sync.failed, account_statement.sync.unavailable CEL event filter, e.g. event.sku == "A-1". Only with eventType.
2000resume continues this chat (default); notify only emails you.
resume, notify Expiry duration; events default to 10d. Must outlast a timed trigger.
1 - 120