API referenceCustom moments

Update a custom moment

PUT
/moments/{id}

Send only the fields to change. Until the custom moment first goes live, a change to when, not_when, the examples, the timing or min_confidence edits its draft in place. Once it has a live_version, such a change writes the next version as a draft, and live_version keeps running until the draft is shadowed and promoted, or promoted directly. A status change, live or disabled, reaches live conversations within seconds.

Authorization

apiKey
X-API-Key<token>

API key (prefix spk_test_ or spk_live_) or personal access token (prefix pat_)

In: header

Path Parameters

id*string

Custom moment ID

Header Parameters

Idempotency-Key*string

Idempotency key that prevents processing a request twice. Use a unique UUID v4 per request.

Lengthlength <= 255

Request Body

application/json

color?string

The color it is shown in. Makes no new version; moments already detected keep the color they carry

Value in

  • "violet"
  • "blue"
  • "teal"
  • "green"
  • "yellow"
  • "orange"
  • "red"
  • "pink"
  • "gray"
examples?

Replaces both example lists

label?string

Its display name, 1 to 60 characters. Makes no new version; moments already detected keep the label they carry

Lengthlength <= 60
min_confidence?number

The classifier's probability a turn needs to fire it

Formatdouble
not_when?string

When it does not fire

Lengthlength <= 1000
status?string

live to run it on conversations, disabled to stop it; a custom moment never goes back to draft

Value in

  • "draft"
  • "live"
  • "disabled"
timing?string

Its timing profile

Value in

  • "act"
  • "answer"
  • "ideas"
when?string

When it fires

Lengthlength <= 1000

Response Body

application/json

application/json

curl -X PUT "https://example.com/moments/mdef_2jxsy8cc8v0348asy6t1" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{}'
{  "color": "violet",  "created_at": "2019-08-24T14:15:22Z",  "examples": {    "fire": [      "string"    ],    "skip": [      "string"    ]  },  "id": "mdef_2jxsy8cc8v0348asy6t1",  "label": "Pricing objection",  "live_version": 0,  "min_confidence": 0.1,  "name": "pricing_objection",  "not_when": "string",  "shadow_version": 0,  "status": "draft",  "timing": "act",  "updated_at": "2019-08-24T14:15:22Z",  "version": 0,  "when": "string"}