Create a chat button
curl --request POST \
--url https://api.meetdarwin.ai/v1/chat_buttons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"message": "<string>",
"colors": {
"background": "<string>",
"text": "<string>",
"border": "<string>",
"hover": "<string>"
},
"custom": {
"paddingX": 123,
"paddingY": 123,
"fontSize": 123,
"radius": 123
},
"nofollow": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
message: '<string>',
colors: {
background: '<string>',
text: '<string>',
border: '<string>',
hover: '<string>'
},
custom: {paddingX: 123, paddingY: 123, fontSize: 123, radius: 123},
nofollow: true
})
};
fetch('https://api.meetdarwin.ai/v1/chat_buttons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.meetdarwin.ai/v1/chat_buttons"
payload = {
"label": "<string>",
"message": "<string>",
"colors": {
"background": "<string>",
"text": "<string>",
"border": "<string>",
"hover": "<string>"
},
"custom": {
"paddingX": 123,
"paddingY": 123,
"fontSize": 123,
"radius": 123
},
"nofollow": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "btn_k3j9x2m4p7",
"object": "chat_button",
"label": "<string>",
"message": "<string>",
"behavior": "send",
"style": "brand",
"size": "sm",
"corners": "match",
"width": "auto",
"colors": {
"background": "<string>",
"text": "<string>",
"border": "<string>",
"hover": "<string>"
},
"custom": {
"paddingX": 123,
"paddingY": 123,
"fontSize": 123,
"radius": 123
},
"nofollow": true,
"link": "<string>",
"html": "<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>"
}{
"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>"
}Agent
Create a chat button
Requires the agent:write scope.
POST
/
chat_buttons
Create a chat button
curl --request POST \
--url https://api.meetdarwin.ai/v1/chat_buttons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"message": "<string>",
"colors": {
"background": "<string>",
"text": "<string>",
"border": "<string>",
"hover": "<string>"
},
"custom": {
"paddingX": 123,
"paddingY": 123,
"fontSize": 123,
"radius": 123
},
"nofollow": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
message: '<string>',
colors: {
background: '<string>',
text: '<string>',
border: '<string>',
hover: '<string>'
},
custom: {paddingX: 123, paddingY: 123, fontSize: 123, radius: 123},
nofollow: true
})
};
fetch('https://api.meetdarwin.ai/v1/chat_buttons', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.meetdarwin.ai/v1/chat_buttons"
payload = {
"label": "<string>",
"message": "<string>",
"colors": {
"background": "<string>",
"text": "<string>",
"border": "<string>",
"hover": "<string>"
},
"custom": {
"paddingX": 123,
"paddingY": 123,
"fontSize": 123,
"radius": 123
},
"nofollow": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "btn_k3j9x2m4p7",
"object": "chat_button",
"label": "<string>",
"message": "<string>",
"behavior": "send",
"style": "brand",
"size": "sm",
"corners": "match",
"width": "auto",
"colors": {
"background": "<string>",
"text": "<string>",
"border": "<string>",
"hover": "<string>"
},
"custom": {
"paddingX": 123,
"paddingY": 123,
"fontSize": 123,
"radius": 123
},
"nofollow": true,
"link": "<string>",
"html": "<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>"
}{
"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).
Maximum string length:
255Body
application/json
Required string length:
1 - 40Maximum string length:
200Available options:
send, fill, agent Available options:
brand, soft, outline, link Available options:
sm, md, lg, custom Available options:
match, square, pill, custom Available options:
auto, full Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
OK
Pattern:
^btn_Example:
"btn_k3j9x2m4p7"
Allowed value:
"chat_button"Available options:
send, fill, agent Available options:
brand, soft, outline, link Available options:
sm, md, lg, custom Available options:
match, square, pill, custom Available options:
auto, full Show child attributes
Show child attributes
Show child attributes
Show child attributes
The paste-in HTML: a plain link that opens the chat already on the page.