Create a config
curl --request POST \
--url https://api.donate.gg/api/v2/configs \
--header 'Content-Type: application/json' \
--header 'donate-api-key: <api-key>' \
--data '
{
"beneficiaries": [
{
"type": "charity",
"id": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": 3
},
{
"type": "campaign",
"id": "cmr2icrm701xu04jxvybvmgwn",
"weight": 1
}
]
}
'import requests
url = "https://api.donate.gg/api/v2/configs"
payload = { "beneficiaries": [
{
"type": "charity",
"id": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": 3
},
{
"type": "campaign",
"id": "cmr2icrm701xu04jxvybvmgwn",
"weight": 1
}
] }
headers = {
"donate-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'donate-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
beneficiaries: [
{type: 'charity', id: '9b4dae4e-d8c1-4322-a594-35a4858296b2', weight: 3},
{type: 'campaign', id: 'cmr2icrm701xu04jxvybvmgwn', weight: 1}
]
})
};
fetch('https://api.donate.gg/api/v2/configs', 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.donate.gg/api/v2/configs",
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([
'beneficiaries' => [
[
'type' => 'charity',
'id' => '9b4dae4e-d8c1-4322-a594-35a4858296b2',
'weight' => 3
],
[
'type' => 'campaign',
'id' => 'cmr2icrm701xu04jxvybvmgwn',
'weight' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"donate-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://api.donate.gg/api/v2/configs"
payload := strings.NewReader("{\n \"beneficiaries\": [\n {\n \"type\": \"charity\",\n \"id\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 3\n },\n {\n \"type\": \"campaign\",\n \"id\": \"cmr2icrm701xu04jxvybvmgwn\",\n \"weight\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("donate-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://api.donate.gg/api/v2/configs")
.header("donate-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"beneficiaries\": [\n {\n \"type\": \"charity\",\n \"id\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 3\n },\n {\n \"type\": \"campaign\",\n \"id\": \"cmr2icrm701xu04jxvybvmgwn\",\n \"weight\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.donate.gg/api/v2/configs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["donate-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"beneficiaries\": [\n {\n \"type\": \"charity\",\n \"id\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 3\n },\n {\n \"type\": \"campaign\",\n \"id\": \"cmr2icrm701xu04jxvybvmgwn\",\n \"weight\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "0x7ac4174ed42dc6285a4d8a29f33177218a9e99becb64a5c9845725d1ebfe29f3",
"idBase58": "9GEATUZ8sqNxgiuF3BauoNaUKoA7v1MMrV16UZFkqqpW",
"beneficiaries": [
{
"type": "charity",
"id": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": "3"
},
{
"type": "campaign",
"id": "cmr2icrm701xu04jxvybvmgwn",
"weight": "1"
}
],
"createdAt": "2026-11-19T09:12:04.118Z"
}{
"id": "0x7ac4174ed42dc6285a4d8a29f33177218a9e99becb64a5c9845725d1ebfe29f3",
"idBase58": "9GEATUZ8sqNxgiuF3BauoNaUKoA7v1MMrV16UZFkqqpW",
"beneficiaries": [
{
"type": "charity",
"id": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": "3"
},
{
"type": "campaign",
"id": "cmr2icrm701xu04jxvybvmgwn",
"weight": "1"
}
],
"createdAt": "2026-11-19T09:12:04.118Z"
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "required",
"message": "<string>"
}
]
}{
"code": "UNAUTHENTICATED",
"message": "This operation needs your API key. Send it in the donate-api-key header."
}{
"code": "PAYLOAD_TOO_LARGE",
"message": "<string>"
}{
"code": "BENEFICIARY_NOT_FOUND",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "required",
"message": "<string>"
}
]
}{
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Wait for the time in the Retry-After header."
}{
"code": "PROVIDER_UNAVAILABLE",
"message": "<string>"
}Configs
Create a config
A config is a permanent split: up to five charities and campaigns and the weight each receives. A campaign created on Donate counts once for each receiver it forwards to, and a config that would pay more than five in all answers 400. For your project, the same beneficiaries and weights always give the same config, so a retry is safe: 201 when this request created it, 200 when it already existed. The request names recipients and nothing else. The fee a donation pays is not part of a config: read it from GET /v2/configs/{configId}/fee. A 422 names each entry at fault in issues, by its path (beneficiaries[1]). Requires your API key.
POST
/
v2
/
configs
Create a config
curl --request POST \
--url https://api.donate.gg/api/v2/configs \
--header 'Content-Type: application/json' \
--header 'donate-api-key: <api-key>' \
--data '
{
"beneficiaries": [
{
"type": "charity",
"id": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": 3
},
{
"type": "campaign",
"id": "cmr2icrm701xu04jxvybvmgwn",
"weight": 1
}
]
}
'import requests
url = "https://api.donate.gg/api/v2/configs"
payload = { "beneficiaries": [
{
"type": "charity",
"id": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": 3
},
{
"type": "campaign",
"id": "cmr2icrm701xu04jxvybvmgwn",
"weight": 1
}
] }
headers = {
"donate-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'donate-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
beneficiaries: [
{type: 'charity', id: '9b4dae4e-d8c1-4322-a594-35a4858296b2', weight: 3},
{type: 'campaign', id: 'cmr2icrm701xu04jxvybvmgwn', weight: 1}
]
})
};
fetch('https://api.donate.gg/api/v2/configs', 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.donate.gg/api/v2/configs",
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([
'beneficiaries' => [
[
'type' => 'charity',
'id' => '9b4dae4e-d8c1-4322-a594-35a4858296b2',
'weight' => 3
],
[
'type' => 'campaign',
'id' => 'cmr2icrm701xu04jxvybvmgwn',
'weight' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"donate-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://api.donate.gg/api/v2/configs"
payload := strings.NewReader("{\n \"beneficiaries\": [\n {\n \"type\": \"charity\",\n \"id\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 3\n },\n {\n \"type\": \"campaign\",\n \"id\": \"cmr2icrm701xu04jxvybvmgwn\",\n \"weight\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("donate-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://api.donate.gg/api/v2/configs")
.header("donate-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"beneficiaries\": [\n {\n \"type\": \"charity\",\n \"id\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 3\n },\n {\n \"type\": \"campaign\",\n \"id\": \"cmr2icrm701xu04jxvybvmgwn\",\n \"weight\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.donate.gg/api/v2/configs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["donate-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"beneficiaries\": [\n {\n \"type\": \"charity\",\n \"id\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 3\n },\n {\n \"type\": \"campaign\",\n \"id\": \"cmr2icrm701xu04jxvybvmgwn\",\n \"weight\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "0x7ac4174ed42dc6285a4d8a29f33177218a9e99becb64a5c9845725d1ebfe29f3",
"idBase58": "9GEATUZ8sqNxgiuF3BauoNaUKoA7v1MMrV16UZFkqqpW",
"beneficiaries": [
{
"type": "charity",
"id": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": "3"
},
{
"type": "campaign",
"id": "cmr2icrm701xu04jxvybvmgwn",
"weight": "1"
}
],
"createdAt": "2026-11-19T09:12:04.118Z"
}{
"id": "0x7ac4174ed42dc6285a4d8a29f33177218a9e99becb64a5c9845725d1ebfe29f3",
"idBase58": "9GEATUZ8sqNxgiuF3BauoNaUKoA7v1MMrV16UZFkqqpW",
"beneficiaries": [
{
"type": "charity",
"id": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": "3"
},
{
"type": "campaign",
"id": "cmr2icrm701xu04jxvybvmgwn",
"weight": "1"
}
],
"createdAt": "2026-11-19T09:12:04.118Z"
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "required",
"message": "<string>"
}
]
}{
"code": "UNAUTHENTICATED",
"message": "This operation needs your API key. Send it in the donate-api-key header."
}{
"code": "PAYLOAD_TOO_LARGE",
"message": "<string>"
}{
"code": "BENEFICIARY_NOT_FOUND",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "required",
"message": "<string>"
}
]
}{
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Wait for the time in the Retry-After header."
}{
"code": "PROVIDER_UNAVAILABLE",
"message": "<string>"
}Authorizations
Body
application/json
Response
The config already existed.
Was this page helpful?