get
https://www.locally.com/headless/api/1.0/sfl/email/send
Send an email containing a Save for Later link.
Request Parameters
🏷️ header · unmarked parameters are query params
| Parameter | Type | Required | Description |
|---|---|---|---|
Locally-Api-Token 🏷️ | string | Yes | Locally API token must be passed in the header to authenticate the API consumer. |
email | string | Yes | The email address to send the product details to. |
link | string | Yes | The link to the product details page. |
Example Request
curl --get 'https://www.locally.com/headless/api/1.0/sfl/email/send' \
--header 'Locally-Api-Token: {{API_TOKEN}}' \
--data-urlencode '[email protected]' \
--data-urlencode 'link=https://www.locally.com/product/12345/acme-trail-jacket'const link = encodeURIComponent('https://www.locally.com/product/12345/acme-trail-jacket');
const response = await fetch(
`https://www.locally.com/headless/api/1.0/sfl/email/[email protected]&link=${link}`,
{
headers: {
'Locally-Api-Token': '{{API_TOKEN}}'
}
}
);
const data = await response.json();import requests
response = requests.get(
"https://www.locally.com/headless/api/1.0/sfl/email/send",
headers={"Locally-Api-Token": "{{API_TOKEN}}"},
params={
"email": "[email protected]",
"link": "https://www.locally.com/product/12345/acme-trail-jacket",
},
)
data = response.json()The link value must be URL-encoded and must point to a locally.com URL. Links on other domains fail validation and no email is sent (see the Validation Failed response example).
Example Response
{
"success": true,
"data": {
"success": 1,
"session": {
"id": "abc999"
}
},
"msg": ""
}{
"success": true,
"data": {
"success": 0,
"error": "Invalid Domain URL",
"session": {
"id": "abc999"
}
},
"msg": ""
}Response Explanation
success—truemeans the request was processed and staystrueeven when the email is rejected — checkdata.successfor the send outcome; auth and server errors returnfalsewith anerror_code.data.success—1when the email was queued,0when the address or link failed validation; booleans insidedataserialize as1/0.data.error— Reason the email was rejected; present only whendata.successis0— one ofInvalid email address,Invalid URL,Invalid Domain URL(link not on locally.com),Multiple links detected, orUnauthorized Redirect URL.data.session.id— Session ID returned on every response. Pass it as theLocally-Api-Session-Idheader on later calls to persist location and cart state; expired or missing IDs are replaced with fresh ones.msg— Human-readable envelope message: an empty string on success, the error text whensuccessisfalse(which also adds anerror_codefield).
200Successful
400Bad Request
401Unauthorized
402Request Failed
403Forbidden
404Not Found
429Too Many Requests
500Server Error

