API Reference
The Spreeflo API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON request bodies, returns JSON responses, and uses standard HTTP response codes, authentication, and verbs.
Authentication
API requests are authenticated using Bearer token authentication where the token is an API key. You create API keys by:
- Sign into your Spreeflo account
- Navigate to Settings > API Keys
- Click 'Add Key'
Pass the API Key in the Authorization header as a Bearer token, e.g. Authorization: Bearer <API_KEY>. Below API references include code snippets for how to pass the API key in the Authorization header.
Contact Emails
Some of the below APIs uses MD5 hashed email addresses to uniquely identify contacts in an audience. Email addresses are personally identifiable information. Passing them in clear text through APIs risks leaking this information to the public and raising compliance issues in many jurisdictions. Hashing provides a way to reference the same contact consistently without sharing the actual email.
import crypto from 'crypto';
function md5Email(email) {
return crypto
.createHash("md5")
.update(email.trim().toLowerCase())
.digest("hex");