curl --request POST \
--url https://api.rigaly.com/api/v1/raffles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Win a year of free coffee",
"description": "One winner drinks free until next summer.",
"terms_conditions": "One prize. Must be 18+.",
"ends_at": "2026-08-31T23:59:59Z",
"points_cost": 100,
"entries_per_user": 5,
"winners_count": 1,
"max_entries": 500,
"max_entries_mode": "total"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Win a year of free coffee',
description: 'One winner drinks free until next summer.',
terms_conditions: 'One prize. Must be 18+.',
ends_at: '2026-08-31T23:59:59Z',
points_cost: 100,
entries_per_user: 5,
winners_count: 1,
max_entries: 500,
max_entries_mode: 'total'
})
};
fetch('https://api.rigaly.com/api/v1/raffles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/raffles"
payload = {
"name": "Win a year of free coffee",
"description": "One winner drinks free until next summer.",
"terms_conditions": "One prize. Must be 18+.",
"ends_at": "2026-08-31T23:59:59Z",
"points_cost": 100,
"entries_per_user": 5,
"winners_count": 1,
"max_entries": 500,
"max_entries_mode": "total"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/raffles",
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([
'name' => 'Win a year of free coffee',
'description' => 'One winner drinks free until next summer.',
'terms_conditions' => 'One prize. Must be 18+.',
'ends_at' => '2026-08-31T23:59:59Z',
'points_cost' => 100,
'entries_per_user' => 5,
'winners_count' => 1,
'max_entries' => 500,
'max_entries_mode' => 'total'
]),
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;
}{
"success": true,
"message": "<string>",
"data": {
"raffle": {
"name": "Win a year of free coffee",
"description": "<string>",
"terms_conditions": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"points_cost": 100,
"entries_per_user": 5,
"winners_count": 1,
"max_entries": 500,
"max_entries_mode": "total",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_url": "<string>",
"status": "active",
"availability": "open",
"drawn_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}Create a raffle
Creates a raffle customers enter with points. entries_per_user caps
one customer; max_entries caps the whole raffle — see the
raffles guide.
curl --request POST \
--url https://api.rigaly.com/api/v1/raffles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Win a year of free coffee",
"description": "One winner drinks free until next summer.",
"terms_conditions": "One prize. Must be 18+.",
"ends_at": "2026-08-31T23:59:59Z",
"points_cost": 100,
"entries_per_user": 5,
"winners_count": 1,
"max_entries": 500,
"max_entries_mode": "total"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Win a year of free coffee',
description: 'One winner drinks free until next summer.',
terms_conditions: 'One prize. Must be 18+.',
ends_at: '2026-08-31T23:59:59Z',
points_cost: 100,
entries_per_user: 5,
winners_count: 1,
max_entries: 500,
max_entries_mode: 'total'
})
};
fetch('https://api.rigaly.com/api/v1/raffles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/raffles"
payload = {
"name": "Win a year of free coffee",
"description": "One winner drinks free until next summer.",
"terms_conditions": "One prize. Must be 18+.",
"ends_at": "2026-08-31T23:59:59Z",
"points_cost": 100,
"entries_per_user": 5,
"winners_count": 1,
"max_entries": 500,
"max_entries_mode": "total"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/raffles",
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([
'name' => 'Win a year of free coffee',
'description' => 'One winner drinks free until next summer.',
'terms_conditions' => 'One prize. Must be 18+.',
'ends_at' => '2026-08-31T23:59:59Z',
'points_cost' => 100,
'entries_per_user' => 5,
'winners_count' => 1,
'max_entries' => 500,
'max_entries_mode' => 'total'
]),
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;
}{
"success": true,
"message": "<string>",
"data": {
"raffle": {
"name": "Win a year of free coffee",
"description": "<string>",
"terms_conditions": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"points_cost": 100,
"entries_per_user": 5,
"winners_count": 1,
"max_entries": 500,
"max_entries_mode": "total",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_url": "<string>",
"status": "active",
"availability": "open",
"drawn_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}Authorizations
API key from the Rigaly dashboard: Authorization: Bearer rgly_sk_...
Body
On create, name, description, terms_conditions and ends_at are required; on update, all fields are optional (and some lock once the raffle has entries).
3 - 255"Win a year of free coffee"
20005000Null/omitted = starts immediately
Must be in the future. Winners are drawn automatically at this moment.
Points per entry (0 = free raffle — free raffles allow exactly 1 entry per user)
0 <= x <= 1000000100
Per-customer entry limit. Null/omitted = unlimited
1 <= x <= 10005
1 <= x <= 100Ceiling for the whole raffle — what max_entries_mode counts stops
here. null (the default) = unlimited. A raffle at its ceiling stays
active and visible and still draws its winners at ends_at; only
new entries are blocked. Raise it at any time to reopen entries; it
can never be lowered below what has already been recorded.
1 <= x <= 1000000500
What max_entries counts. total: every entry, so 500 caps the
prize pool at 500 tickets however they are distributed.
participants: distinct customers, so 500 caps the raffle at 500
people who may each buy up to entries_per_user tickets.
Locks once the raffle has entries.
total, participants