REST API
Writes and idempotency
Idempotency-Key on every POST, expected revision, pausing the AI on a fan.
Idempotency-Key
Every POST requires an Idempotency-Key header: 8 to 128 characters A-Z a-z 0-9 _ . : -, a UUID for example.
- Replaying the same key with the same request returns the same response without a second write (header
Idempotent-Replayed: true), for 24 h. - The same key for another request answers
422. PUTandDELETEare idempotent by nature.
The team note
Writing the note requires the revision you read (expectedRevision): a concurrent write answers 409. Read the fan again, then write.
Pause the AI on a fan (MYM)
It is the same action as « Arrêter le chatting » (Stop chatting) in the dashboard: the creator's fan filter. Two cases answer 409 and must be done from the dashboard, because they go beyond this fan:
- a creator who answers everyone (the action would change her mode);
- the last fan of an allow list (removing it would cut off the whole creator).
curl -X POST https://app.fanconvert.ai/public/v1/creators/emma-demo/conversations/123/ai/pause \
-H "Authorization: Bearer $FANCONVERT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"…/ai/resume hands the fan back to the AI (« Relancer le chatting »).
Last updated on