Get started
From an API key to your first message, step by step.
This guide takes you from nothing to a message on a customer's phone and an event in your own system. It takes about ten minutes.
Requirements
- A Goomzo account. Only the organization's owner and admins can create API keys.
- SMS on your account. See SMS bundles.
- A phone you can receive SMS on, to test with.
Step 1: Create an API key
- Open Settings → API keys and select New API key.
- Name it after your system, such as Shop, and choose the Messaging bundle of permissions.
- Save, and copy the secret. Goomzo shows it only once.
Keep the secret in an environment variable, never in your code:
export GOOMZO_TOKEN=gzk_...Step 2: Add a customer
curl https://api.goomzo.africa/v1/customers \
-H "Authorization: Bearer $GOOMZO_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "ifExists": "update", "customers": [{ "name": "Amina Juma", "phone": "+255712345678" }] }'Use your own phone number, so you receive the message in step 4.
Step 3: Create a template
curl https://api.goomzo.africa/v1/templates \
-H "Authorization: Bearer $GOOMZO_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "auth_1", "channel": "sms", "category": "authentication",
"content": { "text": "Hi {{name|there}}, your code is {{secret.code}}." } }'{{secret.code}} is a value you pass when you send. Goomzo delivers it, but keeps it masked as ••••••.
Step 4: Send your first message
curl https://api.goomzo.africa/v1/messages \
-H "Authorization: Bearer $GOOMZO_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: first-message-1" \
-d '{ "messages": [{ "to": "+255712345678", "template": "auth_1", "variables": { "code": "482913" } }] }'Your phone receives "Hi Amina, your code is 482913." The answer shows the message with "status": "sending".
Step 5: Set up a webhook
- Open Settings → Webhooks and select New endpoint.
- Enter your HTTPS URL, and choose
message.deliveredandmessage.failed. - Select Send test event to check your receiver.
Send another message: your URL receives message.delivered once it reaches the phone.
Step 6: Finish
You've authenticated, added a customer, created a template, sent a message and received its delivery. These are the building blocks of every Goomzo integration.
Learn more
- Send messages: SMS and WhatsApp, one at a time or up to 100 together.
- Send templates: your own values, and private ones.
- WhatsApp templates: write templates for Meta to review.
- Webhooks: every event, and how to check signatures.
- Safe retries: retry without sending twice.
Last updated