curl --request POST \
--url https://api.snappy.com/public-api/v2/gifts \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"campaignId": "12345678",
"recipients": [
{
"firstname": "John",
"lastname": "Doe",
"externalId": "1234567890",
"phone": "+1234567890",
"email": "example@domain.com",
"key": "abc123"
}
],
"sendingMethod": "mail",
"customization": {
"recipientExperience": {
"type": "enterAddress",
"visualElements": {
"reveal": {
"type": "snowGlobe",
"primaryColor": "#000000",
"secondaryColor": "#000000",
"mediaItems": {
"logo": [
{
"type": "image",
"url": "https://example.com/media-item-1.jpg"
}
]
}
},
"greeting": {
"content": {
"ops": [
{
"attributes": {
"font": "pacifico",
"size": "32px",
"color": "#000000"
},
"insert": "Happy Birthday!"
}
]
},
"banner": {
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/media-item-1.jpg"
}
]
},
"text": "🎁 Enjoy your gift!",
"color": "#36d4ff"
}
},
"postClaim": {
"redirectAfterClaim": "https://example.com/redirect"
}
}
},
"giftProperties": {
"selectedGiftType": "product",
"product": {
"id": "productId",
"displayType": "displayAsSurprise"
},
"budget": {
"max": 100,
"min": 76
},
"expiration": {
"type": "daysFromSend",
"numberOfDays": 30
}
},
"notificationPolicy": {
"sendingChannels": [
"mail"
],
"disableReminders": true
}
},
"metadata": {
"key1": "value1",
"key2": "value2"
}
}
'import requests
url = "https://api.snappy.com/public-api/v2/gifts"
payload = {
"campaignId": "12345678",
"recipients": [
{
"firstname": "John",
"lastname": "Doe",
"externalId": "1234567890",
"phone": "+1234567890",
"email": "example@domain.com",
"key": "abc123"
}
],
"sendingMethod": "mail",
"customization": {
"recipientExperience": {
"type": "enterAddress",
"visualElements": {
"reveal": {
"type": "snowGlobe",
"primaryColor": "#000000",
"secondaryColor": "#000000",
"mediaItems": { "logo": [
{
"type": "image",
"url": "https://example.com/media-item-1.jpg"
}
] }
},
"greeting": {
"content": { "ops": [
{
"attributes": {
"font": "pacifico",
"size": "32px",
"color": "#000000"
},
"insert": "Happy Birthday!"
}
] },
"banner": {
"mediaItems": { "background": [
{
"type": "image",
"url": "https://example.com/media-item-1.jpg"
}
] },
"text": "🎁 Enjoy your gift!",
"color": "#36d4ff"
}
},
"postClaim": { "redirectAfterClaim": "https://example.com/redirect" }
}
},
"giftProperties": {
"selectedGiftType": "product",
"product": {
"id": "productId",
"displayType": "displayAsSurprise"
},
"budget": {
"max": 100,
"min": 76
},
"expiration": {
"type": "daysFromSend",
"numberOfDays": 30
}
},
"notificationPolicy": {
"sendingChannels": ["mail"],
"disableReminders": True
}
},
"metadata": {
"key1": "value1",
"key2": "value2"
}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
campaignId: '12345678',
recipients: [
{
firstname: 'John',
lastname: 'Doe',
externalId: '1234567890',
phone: '+1234567890',
email: 'example@domain.com',
key: 'abc123'
}
],
sendingMethod: 'mail',
customization: {
recipientExperience: {
type: 'enterAddress',
visualElements: {
reveal: {
type: 'snowGlobe',
primaryColor: '#000000',
secondaryColor: '#000000',
mediaItems: {logo: [{type: 'image', url: 'https://example.com/media-item-1.jpg'}]}
},
greeting: {
content: {
ops: [
{
attributes: {font: 'pacifico', size: '32px', color: '#000000'},
insert: 'Happy Birthday!'
}
]
},
banner: {
mediaItems: {background: [{type: 'image', url: 'https://example.com/media-item-1.jpg'}]},
text: '🎁 Enjoy your gift!',
color: '#36d4ff'
}
},
postClaim: {redirectAfterClaim: 'https://example.com/redirect'}
}
},
giftProperties: {
selectedGiftType: 'product',
product: {id: 'productId', displayType: 'displayAsSurprise'},
budget: {max: 100, min: 76},
expiration: {type: 'daysFromSend', numberOfDays: 30}
},
notificationPolicy: {sendingChannels: ['mail'], disableReminders: true}
},
metadata: {key1: 'value1', key2: 'value2'}
})
};
fetch('https://api.snappy.com/public-api/v2/gifts', 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.snappy.com/public-api/v2/gifts",
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([
'campaignId' => '12345678',
'recipients' => [
[
'firstname' => 'John',
'lastname' => 'Doe',
'externalId' => '1234567890',
'phone' => '+1234567890',
'email' => 'example@domain.com',
'key' => 'abc123'
]
],
'sendingMethod' => 'mail',
'customization' => [
'recipientExperience' => [
'type' => 'enterAddress',
'visualElements' => [
'reveal' => [
'type' => 'snowGlobe',
'primaryColor' => '#000000',
'secondaryColor' => '#000000',
'mediaItems' => [
'logo' => [
[
'type' => 'image',
'url' => 'https://example.com/media-item-1.jpg'
]
]
]
],
'greeting' => [
'content' => [
'ops' => [
[
'attributes' => [
'font' => 'pacifico',
'size' => '32px',
'color' => '#000000'
],
'insert' => 'Happy Birthday!'
]
]
],
'banner' => [
'mediaItems' => [
'background' => [
[
'type' => 'image',
'url' => 'https://example.com/media-item-1.jpg'
]
]
],
'text' => '🎁 Enjoy your gift!',
'color' => '#36d4ff'
]
],
'postClaim' => [
'redirectAfterClaim' => 'https://example.com/redirect'
]
]
],
'giftProperties' => [
'selectedGiftType' => 'product',
'product' => [
'id' => 'productId',
'displayType' => 'displayAsSurprise'
],
'budget' => [
'max' => 100,
'min' => 76
],
'expiration' => [
'type' => 'daysFromSend',
'numberOfDays' => 30
]
],
'notificationPolicy' => [
'sendingChannels' => [
'mail'
],
'disableReminders' => true
]
],
'metadata' => [
'key1' => 'value1',
'key2' => 'value2'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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.snappy.com/public-api/v2/gifts"
payload := strings.NewReader("{\n \"campaignId\": \"12345678\",\n \"recipients\": [\n {\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"externalId\": \"1234567890\",\n \"phone\": \"+1234567890\",\n \"email\": \"example@domain.com\",\n \"key\": \"abc123\"\n }\n ],\n \"sendingMethod\": \"mail\",\n \"customization\": {\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\",\n \"size\": \"32px\",\n \"color\": \"#000000\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ]\n },\n \"banner\": {\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n },\n \"text\": \"🎁 Enjoy your gift!\",\n \"color\": \"#36d4ff\"\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n },\n \"giftProperties\": {\n \"selectedGiftType\": \"product\",\n \"product\": {\n \"id\": \"productId\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"expiration\": {\n \"type\": \"daysFromSend\",\n \"numberOfDays\": 30\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\"\n ],\n \"disableReminders\": true\n }\n },\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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.snappy.com/public-api/v2/gifts")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"12345678\",\n \"recipients\": [\n {\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"externalId\": \"1234567890\",\n \"phone\": \"+1234567890\",\n \"email\": \"example@domain.com\",\n \"key\": \"abc123\"\n }\n ],\n \"sendingMethod\": \"mail\",\n \"customization\": {\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\",\n \"size\": \"32px\",\n \"color\": \"#000000\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ]\n },\n \"banner\": {\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n },\n \"text\": \"🎁 Enjoy your gift!\",\n \"color\": \"#36d4ff\"\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n },\n \"giftProperties\": {\n \"selectedGiftType\": \"product\",\n \"product\": {\n \"id\": \"productId\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"expiration\": {\n \"type\": \"daysFromSend\",\n \"numberOfDays\": 30\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\"\n ],\n \"disableReminders\": true\n }\n },\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snappy.com/public-api/v2/gifts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaignId\": \"12345678\",\n \"recipients\": [\n {\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"externalId\": \"1234567890\",\n \"phone\": \"+1234567890\",\n \"email\": \"example@domain.com\",\n \"key\": \"abc123\"\n }\n ],\n \"sendingMethod\": \"mail\",\n \"customization\": {\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\",\n \"size\": \"32px\",\n \"color\": \"#000000\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ]\n },\n \"banner\": {\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n },\n \"text\": \"🎁 Enjoy your gift!\",\n \"color\": \"#36d4ff\"\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n },\n \"giftProperties\": {\n \"selectedGiftType\": \"product\",\n \"product\": {\n \"id\": \"productId\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"expiration\": {\n \"type\": \"daysFromSend\",\n \"numberOfDays\": 30\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\"\n ],\n \"disableReminders\": true\n }\n },\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "2 gifts out of 3 have been sent successfully",
"metadata": {
"campaignName": "Employee Appreciation Q1 2025",
"totalRecipients": 3,
"batchId": "batch_20250609_001"
},
"results": [
{
"success": true,
"link": "https://snappy.com/experience/K9mP3xL7dN",
"id": "G7nR4bD9mK",
"experienceId": "exp_2024_john_001"
},
{
"success": true,
"link": "https://snappy.com/experience/X2pQ8vB5jL",
"id": "H8sT6cF2nP",
"experienceId": "exp_2024_jane_002"
},
{
"success": false,
"message": "Gift creation failed",
"errorCode": 40000
}
]
}Create gifts
Use this endpoint to create one or more gifts within a Campaign and initiate the Triggered Gifting flow. Snappy will notify recipients based on the Campaign’s Notification Policy.
Required fields:
campaignId- the Campaign ID to send underrecipients- array of recipients, each requiring at minimum afirstnameand an identifier to send to (email or phone). Include a uniquekeyper recipient for duplicate detection.
Optional fields:
customization- Gift Customization overrides (giftProperties,notificationPolicy,recipientExperience). Overrides apply only to gifts created in this call.metadata- optional key-value pairs (max 50 pairs, keys up to 40 chars, values up to 500 chars)companyIdquery parameter - Company ID (when not inferable from the calling key)Request-Sourceheader - source of the request (api_native,api_zapier,api_salesforce,api_ftp,api_make)
Behavior Notes:
- Supports batch creation - multiple recipients in a single request. Each recipient generates its own Gift with its own
linkandkey. - A successful request returns the Gift objects with an initial status of
unopenedand a unique claimlinkfor each recipient. - Webhook events fired through the lifecycle:
gift-status-changed(unopened→unwrapped→opened→claimed/expired), andgift-notification-initial-sent. - The top-level
sendingMethodfield is deprecated - usecustomization.notificationPolicy.sendingChannelsinstead.
Permissions
- Requires:
gifts:create
curl --request POST \
--url https://api.snappy.com/public-api/v2/gifts \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"campaignId": "12345678",
"recipients": [
{
"firstname": "John",
"lastname": "Doe",
"externalId": "1234567890",
"phone": "+1234567890",
"email": "example@domain.com",
"key": "abc123"
}
],
"sendingMethod": "mail",
"customization": {
"recipientExperience": {
"type": "enterAddress",
"visualElements": {
"reveal": {
"type": "snowGlobe",
"primaryColor": "#000000",
"secondaryColor": "#000000",
"mediaItems": {
"logo": [
{
"type": "image",
"url": "https://example.com/media-item-1.jpg"
}
]
}
},
"greeting": {
"content": {
"ops": [
{
"attributes": {
"font": "pacifico",
"size": "32px",
"color": "#000000"
},
"insert": "Happy Birthday!"
}
]
},
"banner": {
"mediaItems": {
"background": [
{
"type": "image",
"url": "https://example.com/media-item-1.jpg"
}
]
},
"text": "🎁 Enjoy your gift!",
"color": "#36d4ff"
}
},
"postClaim": {
"redirectAfterClaim": "https://example.com/redirect"
}
}
},
"giftProperties": {
"selectedGiftType": "product",
"product": {
"id": "productId",
"displayType": "displayAsSurprise"
},
"budget": {
"max": 100,
"min": 76
},
"expiration": {
"type": "daysFromSend",
"numberOfDays": 30
}
},
"notificationPolicy": {
"sendingChannels": [
"mail"
],
"disableReminders": true
}
},
"metadata": {
"key1": "value1",
"key2": "value2"
}
}
'import requests
url = "https://api.snappy.com/public-api/v2/gifts"
payload = {
"campaignId": "12345678",
"recipients": [
{
"firstname": "John",
"lastname": "Doe",
"externalId": "1234567890",
"phone": "+1234567890",
"email": "example@domain.com",
"key": "abc123"
}
],
"sendingMethod": "mail",
"customization": {
"recipientExperience": {
"type": "enterAddress",
"visualElements": {
"reveal": {
"type": "snowGlobe",
"primaryColor": "#000000",
"secondaryColor": "#000000",
"mediaItems": { "logo": [
{
"type": "image",
"url": "https://example.com/media-item-1.jpg"
}
] }
},
"greeting": {
"content": { "ops": [
{
"attributes": {
"font": "pacifico",
"size": "32px",
"color": "#000000"
},
"insert": "Happy Birthday!"
}
] },
"banner": {
"mediaItems": { "background": [
{
"type": "image",
"url": "https://example.com/media-item-1.jpg"
}
] },
"text": "🎁 Enjoy your gift!",
"color": "#36d4ff"
}
},
"postClaim": { "redirectAfterClaim": "https://example.com/redirect" }
}
},
"giftProperties": {
"selectedGiftType": "product",
"product": {
"id": "productId",
"displayType": "displayAsSurprise"
},
"budget": {
"max": 100,
"min": 76
},
"expiration": {
"type": "daysFromSend",
"numberOfDays": 30
}
},
"notificationPolicy": {
"sendingChannels": ["mail"],
"disableReminders": True
}
},
"metadata": {
"key1": "value1",
"key2": "value2"
}
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
campaignId: '12345678',
recipients: [
{
firstname: 'John',
lastname: 'Doe',
externalId: '1234567890',
phone: '+1234567890',
email: 'example@domain.com',
key: 'abc123'
}
],
sendingMethod: 'mail',
customization: {
recipientExperience: {
type: 'enterAddress',
visualElements: {
reveal: {
type: 'snowGlobe',
primaryColor: '#000000',
secondaryColor: '#000000',
mediaItems: {logo: [{type: 'image', url: 'https://example.com/media-item-1.jpg'}]}
},
greeting: {
content: {
ops: [
{
attributes: {font: 'pacifico', size: '32px', color: '#000000'},
insert: 'Happy Birthday!'
}
]
},
banner: {
mediaItems: {background: [{type: 'image', url: 'https://example.com/media-item-1.jpg'}]},
text: '🎁 Enjoy your gift!',
color: '#36d4ff'
}
},
postClaim: {redirectAfterClaim: 'https://example.com/redirect'}
}
},
giftProperties: {
selectedGiftType: 'product',
product: {id: 'productId', displayType: 'displayAsSurprise'},
budget: {max: 100, min: 76},
expiration: {type: 'daysFromSend', numberOfDays: 30}
},
notificationPolicy: {sendingChannels: ['mail'], disableReminders: true}
},
metadata: {key1: 'value1', key2: 'value2'}
})
};
fetch('https://api.snappy.com/public-api/v2/gifts', 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.snappy.com/public-api/v2/gifts",
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([
'campaignId' => '12345678',
'recipients' => [
[
'firstname' => 'John',
'lastname' => 'Doe',
'externalId' => '1234567890',
'phone' => '+1234567890',
'email' => 'example@domain.com',
'key' => 'abc123'
]
],
'sendingMethod' => 'mail',
'customization' => [
'recipientExperience' => [
'type' => 'enterAddress',
'visualElements' => [
'reveal' => [
'type' => 'snowGlobe',
'primaryColor' => '#000000',
'secondaryColor' => '#000000',
'mediaItems' => [
'logo' => [
[
'type' => 'image',
'url' => 'https://example.com/media-item-1.jpg'
]
]
]
],
'greeting' => [
'content' => [
'ops' => [
[
'attributes' => [
'font' => 'pacifico',
'size' => '32px',
'color' => '#000000'
],
'insert' => 'Happy Birthday!'
]
]
],
'banner' => [
'mediaItems' => [
'background' => [
[
'type' => 'image',
'url' => 'https://example.com/media-item-1.jpg'
]
]
],
'text' => '🎁 Enjoy your gift!',
'color' => '#36d4ff'
]
],
'postClaim' => [
'redirectAfterClaim' => 'https://example.com/redirect'
]
]
],
'giftProperties' => [
'selectedGiftType' => 'product',
'product' => [
'id' => 'productId',
'displayType' => 'displayAsSurprise'
],
'budget' => [
'max' => 100,
'min' => 76
],
'expiration' => [
'type' => 'daysFromSend',
'numberOfDays' => 30
]
],
'notificationPolicy' => [
'sendingChannels' => [
'mail'
],
'disableReminders' => true
]
],
'metadata' => [
'key1' => 'value1',
'key2' => 'value2'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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.snappy.com/public-api/v2/gifts"
payload := strings.NewReader("{\n \"campaignId\": \"12345678\",\n \"recipients\": [\n {\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"externalId\": \"1234567890\",\n \"phone\": \"+1234567890\",\n \"email\": \"example@domain.com\",\n \"key\": \"abc123\"\n }\n ],\n \"sendingMethod\": \"mail\",\n \"customization\": {\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\",\n \"size\": \"32px\",\n \"color\": \"#000000\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ]\n },\n \"banner\": {\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n },\n \"text\": \"🎁 Enjoy your gift!\",\n \"color\": \"#36d4ff\"\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n },\n \"giftProperties\": {\n \"selectedGiftType\": \"product\",\n \"product\": {\n \"id\": \"productId\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"expiration\": {\n \"type\": \"daysFromSend\",\n \"numberOfDays\": 30\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\"\n ],\n \"disableReminders\": true\n }\n },\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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.snappy.com/public-api/v2/gifts")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"12345678\",\n \"recipients\": [\n {\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"externalId\": \"1234567890\",\n \"phone\": \"+1234567890\",\n \"email\": \"example@domain.com\",\n \"key\": \"abc123\"\n }\n ],\n \"sendingMethod\": \"mail\",\n \"customization\": {\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\",\n \"size\": \"32px\",\n \"color\": \"#000000\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ]\n },\n \"banner\": {\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n },\n \"text\": \"🎁 Enjoy your gift!\",\n \"color\": \"#36d4ff\"\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n },\n \"giftProperties\": {\n \"selectedGiftType\": \"product\",\n \"product\": {\n \"id\": \"productId\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"expiration\": {\n \"type\": \"daysFromSend\",\n \"numberOfDays\": 30\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\"\n ],\n \"disableReminders\": true\n }\n },\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snappy.com/public-api/v2/gifts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaignId\": \"12345678\",\n \"recipients\": [\n {\n \"firstname\": \"John\",\n \"lastname\": \"Doe\",\n \"externalId\": \"1234567890\",\n \"phone\": \"+1234567890\",\n \"email\": \"example@domain.com\",\n \"key\": \"abc123\"\n }\n ],\n \"sendingMethod\": \"mail\",\n \"customization\": {\n \"recipientExperience\": {\n \"type\": \"enterAddress\",\n \"visualElements\": {\n \"reveal\": {\n \"type\": \"snowGlobe\",\n \"primaryColor\": \"#000000\",\n \"secondaryColor\": \"#000000\",\n \"mediaItems\": {\n \"logo\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n }\n },\n \"greeting\": {\n \"content\": {\n \"ops\": [\n {\n \"attributes\": {\n \"font\": \"pacifico\",\n \"size\": \"32px\",\n \"color\": \"#000000\"\n },\n \"insert\": \"Happy Birthday!\"\n }\n ]\n },\n \"banner\": {\n \"mediaItems\": {\n \"background\": [\n {\n \"type\": \"image\",\n \"url\": \"https://example.com/media-item-1.jpg\"\n }\n ]\n },\n \"text\": \"🎁 Enjoy your gift!\",\n \"color\": \"#36d4ff\"\n }\n },\n \"postClaim\": {\n \"redirectAfterClaim\": \"https://example.com/redirect\"\n }\n }\n },\n \"giftProperties\": {\n \"selectedGiftType\": \"product\",\n \"product\": {\n \"id\": \"productId\",\n \"displayType\": \"displayAsSurprise\"\n },\n \"budget\": {\n \"max\": 100,\n \"min\": 76\n },\n \"expiration\": {\n \"type\": \"daysFromSend\",\n \"numberOfDays\": 30\n }\n },\n \"notificationPolicy\": {\n \"sendingChannels\": [\n \"mail\"\n ],\n \"disableReminders\": true\n }\n },\n \"metadata\": {\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "2 gifts out of 3 have been sent successfully",
"metadata": {
"campaignName": "Employee Appreciation Q1 2025",
"totalRecipients": 3,
"batchId": "batch_20250609_001"
},
"results": [
{
"success": true,
"link": "https://snappy.com/experience/K9mP3xL7dN",
"id": "G7nR4bD9mK",
"experienceId": "exp_2024_john_001"
},
{
"success": true,
"link": "https://snappy.com/experience/X2pQ8vB5jL",
"id": "H8sT6cF2nP",
"experienceId": "exp_2024_jane_002"
},
{
"success": false,
"message": "Gift creation failed",
"errorCode": 40000
}
]
}Authorizations
Company Level Authentication
Company level authentication provides access to all resources under your company, including accounts, campaigns, gifts, and recipients.
Getting Your API Key
- Create an API Key: Use the
POST /v2/authentication/apiKeysendpoint to generate a new API key - Set Expiration: Choose from 30, 60, 90, or 180 days (default: 90 days)
- Optional mTLS: Enable mutual TLS for enhanced security
- Name Your Key: Provide a descriptive name for easy identification
Using Your API Key
Include your API key in the X-Api-Key header for every request:
X-Api-Key: YOUR_24_CHARACTER_API_KEY
API Key Management
- Maximum Keys: Up to 3 active API keys per company
- Rotation: Delete old keys before creating new ones when at the limit
- Security: Keys are hashed and cannot be retrieved after creation
Enhanced Security (mTLS)
For production environments, enable mutual TLS authentication:
- Set
enforceMtls: truewhen creating the API key - Contact support to obtain your client certificates
- Use the mTLS endpoint:
https://mtls-api.snappy.com/public-api
Headers
Source of the request
api_native, api_zapier, api_salesforce, api_ftp, api_make "api_native"
Query Parameters
Company ID
^[A-Za-z0-9]{8,}$"12345678"
Body
The gift object.
Campaign ID
^[A-Za-z0-9]{8,}$"12345678"
The recipients of the gift.
Show child attributes
Show child attributes
Deprecated. Use "customization.notificationPolicy.sendingChannels" instead.
mail, sms, mailAndSms, link "mail"
Customization configuration of the gift.
Show child attributes
Show child attributes
Optional metadata object with key-value pairs. Keys must be alphanumeric (including underscores) and up to 40 characters. Values must be alphanumeric and up to 500 characters. Maximum 50 key-value pairs allowed.
Show child attributes
Show child attributes
{ "key1": "value1", "key2": "value2" }
Response
Ok
The response of the gift creation
The message of the response
Optional metadata object with key-value pairs. Keys must be alphanumeric (including underscores) and up to 40 characters. Values must be alphanumeric and up to 500 characters. Maximum 50 key-value pairs allowed.
Show child attributes
Show child attributes
{ "key1": "value1", "key2": "value2" }
Show child attributes
Show child attributes
Was this page helpful?