const url = 'https://api.thanks.io/api/v2/sub-accounts/';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}, body: undefined};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
{
"data": [
{
"summary": "Example Sub Account",
"value": {
"id": 1,
"user_id": 2,
"title": "My New Sub Account",
"return_name": "John Smith",
"return_address": "123 Smith Street 11",
"return_address2": "Apt 1",
"return_city": "Denver",
"return_state": "CO",
"return_postal_code": "12345",
"message_background_url": null,
"postcard6x9_background_url": null,
"notecard_background_url": null,
"windowedletter_background_url": null,
"windowlessletter_background_url": null,
"branding_fields": {
"accentColor": "#5f01d1",
"symbol": "",
"logo": "https://s3.amazonaws.com/content-staging.thanks.io/templates/dynamic-images/5dcb82c0-f258-11ef-9c99-e542d768ea52.png",
"disclaimer": null,
"headshot": null,
"name": "John Gray",
"email": "[email protected]",
"phone": "1234567890",
"company": null,
"domain": null,
"set": true,
"first_name": "John"
},
"created_at": "2020-02-14 20:50:02",
"updated_at": "2025-07-16 19:03:31"
}
}
]
}
List all available sub-accounts.
const url = 'https://api.thanks.io/api/v2/sub-accounts/';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}, body: undefined};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
{
"data": [
{
"summary": "Example Sub Account",
"value": {
"id": 1,
"user_id": 2,
"title": "My New Sub Account",
"return_name": "John Smith",
"return_address": "123 Smith Street 11",
"return_address2": "Apt 1",
"return_city": "Denver",
"return_state": "CO",
"return_postal_code": "12345",
"message_background_url": null,
"postcard6x9_background_url": null,
"notecard_background_url": null,
"windowedletter_background_url": null,
"windowlessletter_background_url": null,
"branding_fields": {
"accentColor": "#5f01d1",
"symbol": "",
"logo": "https://s3.amazonaws.com/content-staging.thanks.io/templates/dynamic-images/5dcb82c0-f258-11ef-9c99-e542d768ea52.png",
"disclaimer": null,
"headshot": null,
"name": "John Gray",
"email": "[email protected]",
"phone": "1234567890",
"company": null,
"domain": null,
"set": true,
"first_name": "John"
},
"created_at": "2020-02-14 20:50:02",
"updated_at": "2025-07-16 19:03:31"
}
}
]
}
Bearer token authentication using your thanks.io API key
OK
The response is of type object
.
Was this page helpful?