curl --request PATCH \
--url https://api.rigaly.com/api/v1/raffles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"max_entries": 750
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({max_entries: 750})
};
fetch('https://api.rigaly.com/api/v1/raffles/{id}', 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/{id}"
payload = { "max_entries": 750 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(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/{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([
'max_entries' => 750
]),
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": "FIELDS_LOCKED"
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}Update a raffle
Partial update — include only the fields to change.
Once the raffle has entries, points_cost, entries_per_user,
winners_count and max_entries_mode are locked (FIELDS_LOCKED,
400): customers already paid for the odds they were shown. max_entries
stays editable — raise it to reopen a full raffle — but lowering it
below the entries already recorded returns
MAX_ENTRIES_BELOW_CURRENT (400). Only active raffles can be edited.
curl --request PATCH \
--url https://api.rigaly.com/api/v1/raffles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"max_entries": 750
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({max_entries: 750})
};
fetch('https://api.rigaly.com/api/v1/raffles/{id}', 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/{id}"
payload = { "max_entries": 750 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(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/{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([
'max_entries' => 750
]),
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": "FIELDS_LOCKED"
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}Authorizations
API key from the Rigaly dashboard: Authorization: Bearer rgly_sk_...
Path Parameters
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