Set reward image
curl --request POST \
--url https://api.rigaly.com/api/v1/rewards/{id}/image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image_base64": "<string>",
"image_url": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({image_base64: '<string>', image_url: '<string>'})
};
fetch('https://api.rigaly.com/api/v1/rewards/{id}/image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/rewards/{id}/image"
payload = {
"image_base64": "<string>",
"image_url": "<string>"
}
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/rewards/{id}/image",
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([
'image_base64' => '<string>',
'image_url' => '<string>'
]),
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": {
"image_url": "<string>"
}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}Rewards
Set reward image
Sets the reward’s image (shown in the customer app). Accepts any ONE of:
multipart/form-datawith animagefile field- JSON
image_base64(raw base64 pluscontent_type, or adata:URI) — pairs perfectly with AI image APIs that return base64 (e.g. OpenAI’sgpt-imagemodels), so a script can generate and attach artwork in one flow - JSON
image_url(public https URL, downloaded server-side)
JPEG, PNG, or WebP, max 5MB. Replaces any existing image.
POST
/
api
/
v1
/
rewards
/
{id}
/
image
Set reward image
curl --request POST \
--url https://api.rigaly.com/api/v1/rewards/{id}/image \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image_base64": "<string>",
"image_url": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({image_base64: '<string>', image_url: '<string>'})
};
fetch('https://api.rigaly.com/api/v1/rewards/{id}/image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/rewards/{id}/image"
payload = {
"image_base64": "<string>",
"image_url": "<string>"
}
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/rewards/{id}/image",
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([
'image_base64' => '<string>',
'image_url' => '<string>'
]),
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": {
"image_url": "<string>"
}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}Authorizations
API key from the Rigaly dashboard: Authorization: Bearer rgly_sk_...
Path Parameters
Body
application/jsonmultipart/form-data
Provide exactly one of image_base64 (raw base64 + content_type, or a data: URI) or image_url (public https, downloaded server-side). JPEG/PNG/WebP, max 5MB.
Base64-encoded image, or a data:image/...;base64, URI. AI image APIs (e.g. OpenAI gpt-image) return this directly.
Required when image_base64 is raw base64 (not a data: URI).
Available options:
image/jpeg, image/png, image/webp Public https URL of the image to download and attach.