curl --request PATCH \
--url https://api.1club.ai/v1/platform/messages/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "<string>",
"content": "<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/{id}"
payload = {
"subject": "<string>",
"content": "<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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject: '<string>',
content: '<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/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'subject' => '<string>',
'content' => '<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/{id}"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"content\": \"<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("PATCH", 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.patch("https://api.1club.ai/v1/platform/messages/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"content\": \"<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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"<string>\",\n \"content\": \"<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": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Update a message draft
Edits a draft. Send only what changes; an empty body is refused. A Message that has been sent cannot be changed (409, MESSAGE_NOT_DRAFT), and nothing here sends one. The channel is fixed: write a new draft to change it.
Sending contactIds or segment replaces the audience and switches the draft to that kind of audience. An API key may edit only drafts written through the API (403 otherwise), so a draft a member of staff started stays theirs; an assistant acting for a member of staff may edit any.
curl --request PATCH \
--url https://api.1club.ai/v1/platform/messages/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "<string>",
"content": "<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/{id}"
payload = {
"subject": "<string>",
"content": "<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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject: '<string>',
content: '<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/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'subject' => '<string>',
'content' => '<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/{id}"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"content\": \"<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("PATCH", 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.patch("https://api.1club.ai/v1/platform/messages/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"content\": \"<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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"<string>\",\n \"content\": \"<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": {}
}{
"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
255Path Parameters
1club message id
Body
Changes to a draft. Send only what changes. Sending contactIds or segment replaces the audience. The channel cannot change.
1 - 200The 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.
1A 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
The updated draft. 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?