curl --request PATCH \
--url https://api.meetdarwin.ai/v1/outcomes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"button_label": "<string>",
"offer_when": "<string>",
"questions": [
{
"id": "<string>",
"question": "<string>",
"required": true,
"agent_can_fill": true,
"choices": [
"<string>"
],
"unit": "<string>",
"not_a_fit": [
"<string>"
],
"min": 123,
"max": 123
}
],
"done_message": "<string>",
"meeting_optional": true,
"not_fit_message": "<string>",
"notify": [
"<string>"
],
"top_of_chat": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
button_label: '<string>',
offer_when: '<string>',
questions: [
{
id: '<string>',
question: '<string>',
required: true,
agent_can_fill: true,
choices: ['<string>'],
unit: '<string>',
not_a_fit: ['<string>'],
min: 123,
max: 123
}
],
done_message: '<string>',
meeting_optional: true,
not_fit_message: '<string>',
notify: ['<string>'],
top_of_chat: true
})
};
fetch('https://api.meetdarwin.ai/v1/outcomes/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.meetdarwin.ai/v1/outcomes/{id}"
payload = {
"name": "<string>",
"button_label": "<string>",
"offer_when": "<string>",
"questions": [
{
"id": "<string>",
"question": "<string>",
"required": True,
"agent_can_fill": True,
"choices": ["<string>"],
"unit": "<string>",
"not_a_fit": ["<string>"],
"min": 123,
"max": 123
}
],
"done_message": "<string>",
"meeting_optional": True,
"not_fit_message": "<string>",
"notify": ["<string>"],
"top_of_chat": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "out_hnuk3nnp4kwt7hlb",
"object": "outcome",
"kind": "form",
"name": "<string>",
"status": "live",
"button_label": "<string>",
"offer_when": "<string>",
"then": "message",
"meeting_optional": true,
"required_before_booking": true,
"questions": [
{
"id": "<string>",
"key": "<string>",
"question": "<string>",
"type": "<string>",
"required": true,
"agent_can_fill": true,
"choices": [
"<string>"
],
"unit": "<string>",
"not_a_fit": [
"<string>"
],
"min": 123,
"max": 123
}
],
"phone": "off",
"done_message": "<string>",
"not_fit_message": "<string>",
"notify": [
"<string>"
],
"top_of_chat": true,
"results": {
"days": 0,
"started": 0,
"sent": 0,
"not_fit": 0
},
"version": 0,
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}Change an outcome form, or switch it live or off
Requires the agent:write scope.
Send only what changes; questions replaces the list, so send each kept question with its id. meeting as the id sets Book a meeting’s questions (asked before the calendar), phone step and not-a-fit message; it is live while it has questions.
curl --request PATCH \
--url https://api.meetdarwin.ai/v1/outcomes/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"button_label": "<string>",
"offer_when": "<string>",
"questions": [
{
"id": "<string>",
"question": "<string>",
"required": true,
"agent_can_fill": true,
"choices": [
"<string>"
],
"unit": "<string>",
"not_a_fit": [
"<string>"
],
"min": 123,
"max": 123
}
],
"done_message": "<string>",
"meeting_optional": true,
"not_fit_message": "<string>",
"notify": [
"<string>"
],
"top_of_chat": true
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
button_label: '<string>',
offer_when: '<string>',
questions: [
{
id: '<string>',
question: '<string>',
required: true,
agent_can_fill: true,
choices: ['<string>'],
unit: '<string>',
not_a_fit: ['<string>'],
min: 123,
max: 123
}
],
done_message: '<string>',
meeting_optional: true,
not_fit_message: '<string>',
notify: ['<string>'],
top_of_chat: true
})
};
fetch('https://api.meetdarwin.ai/v1/outcomes/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.meetdarwin.ai/v1/outcomes/{id}"
payload = {
"name": "<string>",
"button_label": "<string>",
"offer_when": "<string>",
"questions": [
{
"id": "<string>",
"question": "<string>",
"required": True,
"agent_can_fill": True,
"choices": ["<string>"],
"unit": "<string>",
"not_a_fit": ["<string>"],
"min": 123,
"max": 123
}
],
"done_message": "<string>",
"meeting_optional": True,
"not_fit_message": "<string>",
"notify": ["<string>"],
"top_of_chat": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": "out_hnuk3nnp4kwt7hlb",
"object": "outcome",
"kind": "form",
"name": "<string>",
"status": "live",
"button_label": "<string>",
"offer_when": "<string>",
"then": "message",
"meeting_optional": true,
"required_before_booking": true,
"questions": [
{
"id": "<string>",
"key": "<string>",
"question": "<string>",
"type": "<string>",
"required": true,
"agent_can_fill": true,
"choices": [
"<string>"
],
"unit": "<string>",
"not_a_fit": [
"<string>"
],
"min": 123,
"max": 123
}
],
"phone": "off",
"done_message": "<string>",
"not_fit_message": "<string>",
"notify": [
"<string>"
],
"top_of_chat": true,
"results": {
"days": 0,
"started": 0,
"sent": 0,
"not_fit": 0
},
"version": 0,
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}{
"type": "https://docs.meetdarwin.ai/api-reference/errors#insufficient_scope",
"title": "<string>",
"status": 0,
"code": "insufficient_scope",
"detail": "<string>",
"request_id": "req_8m2k4p0q1x7z9c3v5b6n",
"param": "<string>"
}Authorizations
A secret key (dk_live_…). Scopes: conversations:read, contacts:read, contacts:write, meetings:read, analytics:read, events:read, webhooks:write, knowledge:read, knowledge:write, agent:read, agent:write, experiments:read, experiments:write, privacy:write, chat:write.
Headers
Retry safely: the first response is replayed for 24 hours (not for streamed answers).
255Path Parameters
Body
The form's name, e.g. "Request a quote".
1 - 60The button the agent shows above the message box when it offers the form; the name when left out.
1 - 30When the agent opens it, finishing "Offer it when the visitor…", e.g. "asks what a job would cost or wants an estimate".
1 - 400Up to 7 questions, in order. Name and email are always asked last. Replaces the whole list.
7Show child attributes
Show child attributes
Whether the last step also asks for a phone number.
off, optional, required After the form: show done_message, or go on to book a meeting.
message, meeting The thank-you the visitor sees once it is sent.
200With then: meeting, the visitor may send the request without booking.
Shown instead of the calendar to a visitor whose answers are not a fit.
200Up to 5 extra addresses that get each request by email, such as sales@.
53 - 254Put its button under the agent's name at the top of the chat, in place of Book a meeting (one at a time; a form's shows while it is live).
live: the agent offers it to visitors. draft: saved but never offered. Default draft.
live, draft Response
OK
out_…, or meeting for Book a meeting before it has been saved with questions.
"out_hnuk3nnp4kwt7hlb"
"outcome"meeting: the built-in Book a meeting, whose questions come before the calendar. form: a form you built.
form, meeting live: the agent offers it. Book a meeting is live while it has questions.
live, draft The button the agent shows above the message box when it offers the form.
When the agent opens it: "Offer it when the visitor…".
message, meeting Show child attributes
Show child attributes
off, optional, required The last 30 days: forms the agent opened, requests sent, and sent requests that were not a fit. Preview chats are left out.
Show child attributes
Show child attributes
-9007199254740991 <= x <= 9007199254740991^(?:(?:\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)))$