curl --request POST \
--url https://api.1club.ai/v1/platform/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>",
"subject": "<string>",
"contactIds": [
123
],
"segment": {
"type": [
"<string>"
],
"clubId": 123,
"tags": [
123
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
],
"pipelineStageIds": [
123
],
"sourceIds": [
123
],
"progressionLevelIds": [
123
]
}
}
'import requests
url = "https://api.1club.ai/v1/platform/messages"
payload = {
"content": "<string>",
"subject": "<string>",
"contactIds": [123],
"segment": {
"type": ["<string>"],
"clubId": 123,
"tags": [123],
"membershipPlanIds": [123],
"membershipPlanCategoryIds": [123],
"pipelineStageIds": [123],
"sourceIds": [123],
"progressionLevelIds": [123]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '<string>',
subject: '<string>',
contactIds: [123],
segment: {
type: ['<string>'],
clubId: 123,
tags: [123],
membershipPlanIds: [123],
membershipPlanCategoryIds: [123],
pipelineStageIds: [123],
sourceIds: [123],
progressionLevelIds: [123]
}
})
};
fetch('https://api.1club.ai/v1/platform/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'subject' => '<string>',
'contactIds' => [
123
],
'segment' => [
'type' => [
'<string>'
],
'clubId' => 123,
'tags' => [
123
],
'membershipPlanIds' => [
123
],
'membershipPlanCategoryIds' => [
123
],
'pipelineStageIds' => [
123
],
'sourceIds' => [
123
],
'progressionLevelIds' => [
123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/messages"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"subject\": \"<string>\",\n \"contactIds\": [\n 123\n ],\n \"segment\": {\n \"type\": [\n \"<string>\"\n ],\n \"clubId\": 123,\n \"tags\": [\n 123\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ],\n \"progressionLevelIds\": [\n 123\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.1club.ai/v1/platform/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"subject\": \"<string>\",\n \"contactIds\": [\n 123\n ],\n \"segment\": {\n \"type\": [\n \"<string>\"\n ],\n \"clubId\": 123,\n \"tags\": [\n 123\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ],\n \"progressionLevelIds\": [\n 123\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"subject\": \"<string>\",\n \"contactIds\": [\n 123\n ],\n \"segment\": {\n \"type\": [\n \"<string>\"\n ],\n \"clubId\": 123,\n \"tags\": [\n 123\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ],\n \"progressionLevelIds\": [\n 123\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"direction": "outbound",
"status": "draft",
"subject": "<string>",
"content": {
"html": "<string>",
"blocks": {
"blocks": [
{
"type": "paragraph",
"data": {},
"id": "<string>",
"tunes": {}
}
],
"time": 123,
"version": "<string>"
}
},
"preview": "<string>",
"source": "<string>",
"sender": {
"userId": 123,
"name": "<string>"
},
"audience": {
"mode": "manual",
"segment": {
"type": [
"<string>"
],
"clubId": 123,
"tags": [
123
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
],
"pipelineStageIds": [
123
],
"sourceIds": [
123
],
"progressionLevelIds": [
123
]
}
},
"recipientCount": 123,
"recipients": [
{
"contactId": 123,
"name": "<string>",
"deliveryStatus": "<string>",
"engagementStatus": "open",
"skippedReason": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"openedAt": "2023-11-07T05:31:56Z",
"clickedAt": "2023-11-07T05:31:56Z",
"bouncedAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"unsubscribedAt": "2023-11-07T05:31:56Z"
}
],
"replyToMessageId": 123,
"sentAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Create a message draft
Writes a draft. It is never sent by this API: there is no send endpoint. The draft appears in the admin app, where a member of staff reviews it and sends it. Tell whoever asked for it that it is waiting there.
Name the audience with exactly one of contactIds (specific contacts, all of which must belong to the organization, at most 5,000) or segment (a filter resolved when the draft is sent - an empty segment is every contact). type is email, sms or whatsapp; push notifications cannot be composed. An email needs a subject. content is a string (HTML for email, which is sanitized; text for SMS and WhatsApp) or an object with html or Editor.js blocks.
The draft is attributed to a member of staff: the one an assistant is acting for, or for an API key the person who created the key - refused (403) when they are no longer an active member of the organization. It is stamped source: api. Supports the Idempotency-Key header.
curl --request POST \
--url https://api.1club.ai/v1/platform/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>",
"subject": "<string>",
"contactIds": [
123
],
"segment": {
"type": [
"<string>"
],
"clubId": 123,
"tags": [
123
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
],
"pipelineStageIds": [
123
],
"sourceIds": [
123
],
"progressionLevelIds": [
123
]
}
}
'import requests
url = "https://api.1club.ai/v1/platform/messages"
payload = {
"content": "<string>",
"subject": "<string>",
"contactIds": [123],
"segment": {
"type": ["<string>"],
"clubId": 123,
"tags": [123],
"membershipPlanIds": [123],
"membershipPlanCategoryIds": [123],
"pipelineStageIds": [123],
"sourceIds": [123],
"progressionLevelIds": [123]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '<string>',
subject: '<string>',
contactIds: [123],
segment: {
type: ['<string>'],
clubId: 123,
tags: [123],
membershipPlanIds: [123],
membershipPlanCategoryIds: [123],
pipelineStageIds: [123],
sourceIds: [123],
progressionLevelIds: [123]
}
})
};
fetch('https://api.1club.ai/v1/platform/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'subject' => '<string>',
'contactIds' => [
123
],
'segment' => [
'type' => [
'<string>'
],
'clubId' => 123,
'tags' => [
123
],
'membershipPlanIds' => [
123
],
'membershipPlanCategoryIds' => [
123
],
'pipelineStageIds' => [
123
],
'sourceIds' => [
123
],
'progressionLevelIds' => [
123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/messages"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"subject\": \"<string>\",\n \"contactIds\": [\n 123\n ],\n \"segment\": {\n \"type\": [\n \"<string>\"\n ],\n \"clubId\": 123,\n \"tags\": [\n 123\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ],\n \"progressionLevelIds\": [\n 123\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.1club.ai/v1/platform/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"subject\": \"<string>\",\n \"contactIds\": [\n 123\n ],\n \"segment\": {\n \"type\": [\n \"<string>\"\n ],\n \"clubId\": 123,\n \"tags\": [\n 123\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ],\n \"progressionLevelIds\": [\n 123\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"subject\": \"<string>\",\n \"contactIds\": [\n 123\n ],\n \"segment\": {\n \"type\": [\n \"<string>\"\n ],\n \"clubId\": 123,\n \"tags\": [\n 123\n ],\n \"membershipPlanIds\": [\n 123\n ],\n \"membershipPlanCategoryIds\": [\n 123\n ],\n \"pipelineStageIds\": [\n 123\n ],\n \"sourceIds\": [\n 123\n ],\n \"progressionLevelIds\": [\n 123\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"direction": "outbound",
"status": "draft",
"subject": "<string>",
"content": {
"html": "<string>",
"blocks": {
"blocks": [
{
"type": "paragraph",
"data": {},
"id": "<string>",
"tunes": {}
}
],
"time": 123,
"version": "<string>"
}
},
"preview": "<string>",
"source": "<string>",
"sender": {
"userId": 123,
"name": "<string>"
},
"audience": {
"mode": "manual",
"segment": {
"type": [
"<string>"
],
"clubId": 123,
"tags": [
123
],
"membershipPlanIds": [
123
],
"membershipPlanCategoryIds": [
123
],
"pipelineStageIds": [
123
],
"sourceIds": [
123
],
"progressionLevelIds": [
123
]
}
},
"recipientCount": 123,
"recipients": [
{
"contactId": 123,
"name": "<string>",
"deliveryStatus": "<string>",
"engagementStatus": "open",
"skippedReason": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"openedAt": "2023-11-07T05:31:56Z",
"clickedAt": "2023-11-07T05:31:56Z",
"bouncedAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"unsubscribedAt": "2023-11-07T05:31:56Z"
}
],
"replyToMessageId": 123,
"sentAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Organization-scoped bearer credential: a customer API key (1club_sk_live_...) or an MCP OAuth access token.
Headers
Retry-safe key; a repeat of the same request replays the first response
255Body
A new draft. It is never sent through this API: a member of staff reviews and sends it in the admin app. Name the audience with exactly one of contactIds or segment.
The channel, fixed once drafted. Push notifications cannot be composed.
email, sms, whatsapp The body. A string is HTML for email (sanitized) and plain text for SMS and WhatsApp. Or an object with html and/or Editor.js blocks, the shape the admin composer saves.
1Required for email.
1 - 200A hand-picked audience: contact ids, each in this organization. Mutually exclusive with segment.
1 - 5000 elementsAn audience resolved at the moment a member of staff sends the draft, so it includes whoever matches by then. Every criterion narrows it; an empty object is every contact in the organization. Mutually exclusive with contactIds.
Show child attributes
Show child attributes
Response
Draft created. Not sent.
An email, SMS or WhatsApp Message. This API writes drafts only; it never sends one.
email, sms or whatsapp
outbound, inbound draft: waiting for a member of staff to send it in the admin app; editable. sent: gone out (or received), read-only.
draft, sent Empty for SMS and WhatsApp.
The body as stored. On a single read and on writes; not in the list.
Show child attributes
Show child attributes
The start of the body as plain text.
api for a draft written through this API or MCP; other values for Messages written in 1club; null when not recorded.
The member of staff the Message is attributed to. For an API-key draft, the person who created the key.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
On a single read and on writes; not in the list. Empty on a segment draft, whose audience is resolved when it is sent.
Show child attributes
Show child attributes
The Message this one replies to, within a conversation.
When it went out; null for a draft.
Was this page helpful?