const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Thank You Message',
type: 'postcard',
content: 'Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!'
})
};
fetch('https://api.thanks.io/api/v2/message-templates/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.thanks.io/api/v2/message-templates/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Thank You Message",
"type": "postcard",
"content": "Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!"
}
'import requests
url = "https://api.thanks.io/api/v2/message-templates/"
payload = {
"name": "Thank You Message",
"type": "postcard",
"content": "Hey %FIRST_NAME%!,
THANK YOU for allowing us the opportunity to HELP you with your plan!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 1912,
"user_id": 2,
"sub_account_id": null,
"handwriting_style_id": 102,
"font_size": "small",
"font_color": "#000000",
"name": "Thank You Message Templates",
"content": "Dear %FIRST_NAME%\\n\\nThis is another test message.",
"additional_pages": null,
"skip_creative_generation": 0,
"custom_background_url": null,
"qrcode_url": "https://www.google.com",
"cc_emails": [],
"created_at": "2026-08-05T02:38:44.000000Z",
"updated_at": "2026-08-05T02:39:04.000000Z",
"type": "postcard",
"giftcard_brand_code": "",
"giftcard_brand_image": null,
"giftcard_amount": "",
"youtube_id": "",
"landing_page_url": "",
"share_uuid": "TL9C-UUBP-SNT2-SX5Q",
"brand_data": {
"brand_code": "amazonus",
"title": "Amazon.com",
"image": "https://cdn.thanks.io/giftcards/amazonus.png",
"available_amounts": [
500,
1000,
1500,
2000,
2500,
3000,
4000,
5000,
10000,
20000
]
},
"handwriting_realism": false
}{
"message": "Unauthorized"
}Create Message Template
Create a message template for the authenticated user using the public v2 request shape.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Thank You Message',
type: 'postcard',
content: 'Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!'
})
};
fetch('https://api.thanks.io/api/v2/message-templates/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.thanks.io/api/v2/message-templates/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Thank You Message",
"type": "postcard",
"content": "Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!"
}
'import requests
url = "https://api.thanks.io/api/v2/message-templates/"
payload = {
"name": "Thank You Message",
"type": "postcard",
"content": "Hey %FIRST_NAME%!,
THANK YOU for allowing us the opportunity to HELP you with your plan!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": 1912,
"user_id": 2,
"sub_account_id": null,
"handwriting_style_id": 102,
"font_size": "small",
"font_color": "#000000",
"name": "Thank You Message Templates",
"content": "Dear %FIRST_NAME%\\n\\nThis is another test message.",
"additional_pages": null,
"skip_creative_generation": 0,
"custom_background_url": null,
"qrcode_url": "https://www.google.com",
"cc_emails": [],
"created_at": "2026-08-05T02:38:44.000000Z",
"updated_at": "2026-08-05T02:39:04.000000Z",
"type": "postcard",
"giftcard_brand_code": "",
"giftcard_brand_image": null,
"giftcard_amount": "",
"youtube_id": "",
"landing_page_url": "",
"share_uuid": "TL9C-UUBP-SNT2-SX5Q",
"brand_data": {
"brand_code": "amazonus",
"title": "Amazon.com",
"image": "https://cdn.thanks.io/giftcards/amazonus.png",
"available_amounts": [
500,
1000,
1500,
2000,
2500,
3000,
4000,
5000,
10000,
20000
]
},
"handwriting_realism": false
}{
"message": "Unauthorized"
}Authorizations
Bearer token authentication using your thanks.io API key
Body
Type of the message template
postcard, postcard6x11, letter, windowlessletter, notecard, giftcard, magnacard "notecard"
Name of the message template
"Thank You Message"
Handwriting style ID for the message template
4
Handwriting color to use
"rgba(31,0,113,0.80)"
Set to true to enable the realism effect for AI fonts.
true
Template body content.
"Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!"
ID of the sub-account to associate with this template.
7
URL to additional pages to include with the cover letter. Only valid for letter templates.
"https://example.com/additional-pages.pdf"
URL to PDF file to use for entire mailer. If this is specified, no cover letter is generated. Valid for letter templates only. Providing this URL automatically sets skip_creative_generation to true. For windowed letter templates, leave the upper-left address area of page 1 blank and do not include a recipient address in the PDF; thanks.io prints each recipient's address there.
"https://example.com/mailer.pdf"
URL of a custom background image for the template. Only valid for postcard backs and the interior background of notecards and giftcards.
"https://example.com/background.png"
URL of the QR code image to use for the template.
"https://www.thanks.io"
List of email addresses to CC when a QR code is scanned
Brand code of the gift card. Required when type is giftcard.
"amazonus"
Amount of the gift card in cents. Required when type is giftcard. Use this field for public v2 requests instead of giftcard_amount_in_cents.
5000
URL of the gated landing page (also known as a gating URL). Recipients must visit this page before they can redeem the gift card, letting you gate redemption behind an action such as booking a demo or completing a form. Only valid for giftcards.
"https://example.com/landing"
Response
Created
2
2
ID of the handwriting style used in the message template
18
Font size used in the message template. Only valid for AI fonts
auto, large, medium, small Font color used in the message template.
"#000000"
Handwriting realism level used in the message template. Only valid for AI fonts
"Thank You Message"
"Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!"
URL to additional pages to include with the cover letter. Only valid for letter templates.
Flag to skip creative generation. Set when message template is PDF file only.
0
URL of the custom background image for the message template. Only valid for postcard backs and the interior background of notecards and giftcards.
"https://example.com/background.png"
URL of the QR code image for the message template
"https://www.thanks.io"
List of email addresses to be CC'd on when a QR code is scanned
"2018-08-08T02:56:59.000000Z"
"2025-02-12T05:13:15.000000Z"
Type of the message template
postcard, postcard6x11, letter, windowlessletter, notecard, giftcard, magnacard "notecard"
Brand code of the gift card
"amazonus"
Image URL of the gift card brand
"https://cdn.thanks.io/giftcards/amazonus.png"
Amount of the gift card in cents
5000
URL of the gated landing page (also known as a gating URL). Recipients must visit this page before they can redeem the gift card, letting you gate redemption behind an action such as booking a demo or completing a form. Only valid for giftcards.
"5J5N-QAD3-6LLL-LSZZ"
Was this page helpful?