cURL
curl --request PATCH \
--url https://api.growi.io/api/public/v1/campaign_affiliates/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"affiliates": [
{
"id": 3490313,
"tag": "OLLYCODE"
}
]
}
'import requests
url = "https://api.growi.io/api/public/v1/campaign_affiliates/bulk"
payload = { "affiliates": [
{
"id": 3490313,
"tag": "OLLYCODE"
}
] }
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({affiliates: [{id: 3490313, tag: 'OLLYCODE'}]})
};
fetch('https://api.growi.io/api/public/v1/campaign_affiliates/bulk', 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.growi.io/api/public/v1/campaign_affiliates/bulk",
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([
'affiliates' => [
[
'id' => 3490313,
'tag' => 'OLLYCODE'
]
]
]),
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.growi.io/api/public/v1/campaign_affiliates/bulk"
payload := strings.NewReader("{\n \"affiliates\": [\n {\n \"id\": 3490313,\n \"tag\": \"OLLYCODE\"\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.growi.io/api/public/v1/campaign_affiliates/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"affiliates\": [\n {\n \"id\": 3490313,\n \"tag\": \"OLLYCODE\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.growi.io/api/public/v1/campaign_affiliates/bulk")
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 \"affiliates\": [\n {\n \"id\": 3490313,\n \"tag\": \"OLLYCODE\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"updated": [
{
"id": 123,
"tag": "<string>"
}
],
"errors": [
{
"id": 123,
"error": "<string>"
}
]
}{
"error": "Not Authenticated"
}{
"success": false,
"error": "<string>",
"updated": [
{}
],
"errors": [
{}
]
}Organization API
Bulk Update Campaign Affiliates
Sets default affiliate tags for up to 300 creators in one request. Valid rows still update when another row fails. Each success fires campaign_affiliate.code_updated.
PATCH
/
campaign_affiliates
/
bulk
cURL
curl --request PATCH \
--url https://api.growi.io/api/public/v1/campaign_affiliates/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"affiliates": [
{
"id": 3490313,
"tag": "OLLYCODE"
}
]
}
'import requests
url = "https://api.growi.io/api/public/v1/campaign_affiliates/bulk"
payload = { "affiliates": [
{
"id": 3490313,
"tag": "OLLYCODE"
}
] }
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({affiliates: [{id: 3490313, tag: 'OLLYCODE'}]})
};
fetch('https://api.growi.io/api/public/v1/campaign_affiliates/bulk', 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.growi.io/api/public/v1/campaign_affiliates/bulk",
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([
'affiliates' => [
[
'id' => 3490313,
'tag' => 'OLLYCODE'
]
]
]),
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.growi.io/api/public/v1/campaign_affiliates/bulk"
payload := strings.NewReader("{\n \"affiliates\": [\n {\n \"id\": 3490313,\n \"tag\": \"OLLYCODE\"\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.growi.io/api/public/v1/campaign_affiliates/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"affiliates\": [\n {\n \"id\": 3490313,\n \"tag\": \"OLLYCODE\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.growi.io/api/public/v1/campaign_affiliates/bulk")
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 \"affiliates\": [\n {\n \"id\": 3490313,\n \"tag\": \"OLLYCODE\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"updated": [
{
"id": 123,
"tag": "<string>"
}
],
"errors": [
{
"id": 123,
"error": "<string>"
}
]
}{
"error": "Not Authenticated"
}{
"success": false,
"error": "<string>",
"updated": [
{}
],
"errors": [
{}
]
}Sets default affiliate tags for many creators in one request. Built for spoken-code migrations (keep the codes creators already use when you move them onto a revenue campaign).
Each row is independent: valid rows still update when another row fails. Codes must be unique inside your organization. Each successful rename fires
Partial failure (HTTP 422 — successful rows are still saved):
campaign_affiliate.code_updated.
Maximum 300 affiliates per request.
Request Body
| Field | Type | Description | Required |
|---|---|---|---|
affiliates | Array | Rows to update. Each row needs id (campaign-affiliate enrollment ID) and tag (new code). | Yes |
Request Example
curl -X PATCH "https://api.growi.io/api/public/v1/campaign_affiliates/bulk" \
-H "Authorization: Bearer YOUR_PUBLIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"affiliates": [
{ "id": 3490313, "tag": "OLLYCODE" },
{ "id": 3490314, "tag": "SURESH10" }
]
}'
Response Example
All rows succeeded:{
"success": true,
"updated": [
{ "id": 3490313, "tag": "ollycode" },
{ "id": 3490314, "tag": "suresh10" }
],
"errors": []
}
{
"success": false,
"updated": [
{ "id": 3490313, "tag": "ollycode" }
],
"errors": [
{ "id": 0, "error": "Campaign affiliate not found." }
]
}
Authentication
Send your organization’s public API key as a Bearer token. Viewer (read-only) keys cannot call this. See Rate Limits & Authentication.Error Responses
| Status | Body | When |
|---|---|---|
401 | { "error": "Not Authenticated" } | Missing or invalid API key. |
403 | { "error": "This API key is read-only and cannot modify data." } | Viewer key. |
422 | { "error": "affiliates is required" } | Missing / empty affiliates. |
422 | { "error": "Maximum 300 affiliates per request." } | More than 300 rows. |
422 | { "success": false, "updated": [...], "errors": [...] } | At least one row failed. Successful rows are still saved. |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Maximum array length:
300Show child attributes
Show child attributes