curl --request POST \
--url https://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"email": "jane@example.com",
"status": "Attended"
}
'import requests
url = "https://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members"
payload = {
"email": "jane@example.com",
"status": "Attended"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'jane@example.com', status: 'Attended'})
};
fetch('https://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members', 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://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members",
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([
'email' => 'jane@example.com',
'status' => 'Attended'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members"
payload := strings.NewReader("{\n \"email\": \"jane@example.com\",\n \"status\": \"Attended\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jane@example.com\",\n \"status\": \"Attended\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jane@example.com\",\n \"status\": \"Attended\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"campaignMemberId": "9a0b1c2d-3e4f-4a5b-8c6d-7e8f9a0b1c2d",
"contactId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}Add Campaign Member
Add one member to a custom campaign by email. Same rules as POST /v2/campaigns/{campaignId}/members/batch: the contact is created if it does not exist, adding is an idempotent upsert, and status progression is forward-only for existing members.
curl --request POST \
--url https://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"email": "jane@example.com",
"status": "Attended"
}
'import requests
url = "https://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members"
payload = {
"email": "jane@example.com",
"status": "Attended"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'jane@example.com', status: 'Attended'})
};
fetch('https://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members', 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://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members",
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([
'email' => 'jane@example.com',
'status' => 'Attended'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members"
payload := strings.NewReader("{\n \"email\": \"jane@example.com\",\n \"status\": \"Attended\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jane@example.com\",\n \"status\": \"Attended\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pub-api.conversion.ai/api/v2/campaigns/{campaignId}/members")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"jane@example.com\",\n \"status\": \"Attended\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"campaignMemberId": "9a0b1c2d-3e4f-4a5b-8c6d-7e8f9a0b1c2d",
"contactId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}Authorizations
Your Conversion API key. Found in Settings > Integrations in the dashboard. Format: sk_live_<key_id>_<secret>.
Path Parameters
The Conversion campaign id, as returned by GET /v2/campaigns.
Body
The member's email address, normalized (trimmed and lowercased) before matching. An invalid email returns 400 invalid_email and creates no contact.
"jane@example.com"
The campaign status id to place the member in, as returned by GET /v2/campaigns/{campaignId}. Takes precedence over status. An id that is not a status of the campaign's type returns 400 invalid_campaign_status.
"8f9a0b1c-2d3e-4f4a-9b5c-6d7e8f9a0b1c"
The campaign status name, case-insensitive. Used only when statusId is not set. Omit both to use the campaign type's first status.
"Attended"
Response
Member added or updated.
Show child attributes
Show child attributes
Was this page helpful?