@extends('business::layouts.app') @section('title', 'API — BizWap') @push('styles') @endpush @section('content')

API Access

Manage your API token and explore the available endpoints.

{{-- ── One-time token display ── --}} @if(session('plain_token')) @endif {{-- ── Token Management ── --}}
API Token
@if($activeToken)
Status
Active
Issued
{{ $activeToken->created_at->format('d M Y, H:i') }}
@if($activeToken->last_used_at)
Last used
{{ $activeToken->last_used_at->diffForHumans() }}
@else
Last used
Never
@endif

Regenerating will immediately deactivate the current token. Update any integrations before proceeding.

@csrf
@else

No active token yet. Generate one to start using the BizWap API.

@csrf
@endif
{{-- ── Your Business UUID ── --}}
Your Business UUID

Include this in every API request as business_uuid.

{{ auth('business')->user()->uuid }}
{{-- ── Endpoint Documentation ── --}}
Send Template Message
POST {{ url('api/v1/messages') }}

Queues a WhatsApp template message to one or more phone numbers. Each number is processed independently on our servers.

{{-- Request Headers --}}
Request Headers
Header Value Notes
Authorization required Bearer <your-token> Your API token generated above.
Content-Type required application/json Request body must be JSON.
Accept application/json Ensures error responses are returned as JSON.
{{-- Request Body --}}
Request Body
Field Type Description
business_uuid required string (UUID) Your unique business identifier. Used to verify token ownership.
template_name required string The name of an approved template on your account (e.g. order_confirmation).
phone_numbers required array of strings Recipient phone numbers in international format without + (e.g. 919876543210). Min 1 number.
{{-- Example cURL --}}
Example Request
curl -X POST {{ url('api/v1/messages') }} \ -H "Authorization: Bearer <your-token>" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{ "business_uuid": "{{ auth('business')->user()->uuid }}", "template_name": "order_confirmation", "phone_numbers": ["919876543210", "919876543211"] }'
{{-- Responses --}}
Responses
Status Meaning
202 Accepted Messages queued successfully. Delivery is asynchronous.
401 Unauthorized Missing or invalid token, or business_uuid does not match the token.
422 Unprocessable Entity Validation failed. Check errors in the response body for field-level details.
202 Response Body
{ "message": "Queued.", "count": 2, "template": "order_confirmation" }
@endsection @push('scripts') @endpush