Developer guide

Send one request for each new subscriber, from your website, your app or a tool like Zapier. Create an API key in the dashboard under Settings, then Integrations.

Add a contact

POST https://api.sharpsent.com/v1/contacts

Send the key in the Authorization header as a Bearer token. Keep it secret: anyone who has it can add contacts to your account. The request body is JSON.

What to send

  • email: Required. The subscriber's address.
  • name: Optional. Their name.
  • consent_text: Required. The exact words the person saw when they signed up.

With curl

curl -X POST https://api.sharpsent.com/v1/contacts \
  -H "Authorization: Bearer ss_live_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "asha@example.com",
    "name": "Asha",
    "consent_text": "I agree to receive emails from Acme Sweets about offers and news."
  }'

With Zapier

Use Webhooks by Zapier, choose POST, and set the URL to https://api.sharpsent.com/v1/contacts. Add the header Authorization: Bearer followed by your key, and send email, name and consent_text as data.

We keep the consent text, with the time and the IP address, as the proof that the person agreed. By default the person also gets a confirmation email and is subscribed only when they confirm (double opt-in). You can change this per key in the dashboard.

What comes back

  • 201: The person was subscribed straight away (double opt-in is off for this key).
  • 202: A confirmation email was sent. They are subscribed when they confirm.
  • 200: They were already subscribed, or they unsubscribed before and are not added again.
  • 400: Something in the request is wrong. The reply names the field.
  • 401: The key is missing, wrong or revoked.
  • 409: Your account has no verified sending domain yet, or you have reached your contacts limit.
  • 429: Too many requests (60 a minute per key) or too many confirmation emails. Wait and try again.

Stuck? Write to support@sharpsent.com.