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
Headers
Body
Changes to a draft. Send only what changes. Sending contactIds or segment replaces the audience. The channel cannot change.
Response
The updated draft. Not sent.
An email, SMS or WhatsApp Message. This API writes drafts only; it never sends one.
Was this page helpful?