Skip to main content
Get started in three steps. Set up the BRIQ SMS API and send your first message.

Step 1: Set up your local environment

Log into your BRIQ dashboard and navigate to Settings → API Keys → Generate New Key to get your API key. Store it securely in environment variables:
export BRIQ_API_KEY="your_api_key_here"
Never hardcode your API key in source code. Use environment variables for security.
Ensure you have an HTTP client installed (e.g., axios for Node.js, requests for Python, or PHP cURL). Configure the BRIQ API base URL:
Base URL: https://karibu.briq.tz

Step 2: Integrate the API

Install the required HTTP client for your language:
  • Node.js: npm install axios
  • Python: pip install requests
  • PHP: Ensure the cURL extension is enabled (php -m | grep curl)
Create a simple BRIQ client. For example, in Node.js:
const axios = require('axios');
class BriqClient {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.baseURL = 'https://briq.tz';
    this.headers = { 'X-API-Key': apiKey, 'Content-Type': 'application/json' };
  }
  async sendSMS(content, recipients, senderId = 'BRIQ') {
    const response = await axios.post(`${this.baseURL}/v1/message/send-instant`, {
      content, recipients, sender_id: senderId
    }, { headers: this.headers });
    return response.data;
  }
}
Explore similar examples for Python and PHP in the BRIQ documentation.
Use your client to send a test SMS:
const briq = new BriqClient(process.env.BRIQ_API_KEY);
briq.sendSMS('Hello from BRIQ!', ['255788344348'])
  .then(result => console.log('Success:', result))
  .catch(error => console.error('Error:', error));
Or with cURL:
curl -X POST https://karibu.briq.tz/v1/message/send-instant \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{"content": "BRIQ API test message", "recipients": ["255788344348"], "sender_id": "BRIQ"}'
Check the response to confirm the message was sent successfully.

Step 3: Go live

  1. Save your code and environment variables (e.g., in a .env file):
    BRIQ_API_KEY=your_production_api_key
    BRIQ_BASE_URL=https://karibu.briq.tz
    BRIQ_DEFAULT_SENDER=YOURCOMPANY
    
  2. Deploy your application to your production environment.
  3. Monitor message delivery using the BRIQ dashboard or set up a webhook to receive delivery status updates:
    curl -X PATCH https://karibu.briq.tz/v1/workspace/update/ws_your_workspace_id \
      -H "Content-Type: application/json" \
      -H "X-API-Key: your_api_key_here" \
      -d '{"settings": {"webhook_url": "https://yourapp.com/webhooks/briq"}}'
    

Next steps

Now that your BRIQ SMS API is integrated, explore these key features:
Need help? Visit the BRIQ documentation or contact support@briq.tz.
I