MENU navbar-image

Introduction

Powerful WhatsApp Business API for sending messages, managing contacts, and automating conversations.

Welcome to the SamparkPro WhatsApp API documentation. This API allows you to integrate WhatsApp Business messaging into your applications.

Features

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer YOUR_API_TOKEN".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can generate API tokens by logging into your vendor dashboard at /console/api-tokens. Include the token in the Authorization header as a Bearer token.

WhatsApp Accounts

Manage and list WhatsApp Business Accounts

List all WhatsApp accounts

requires authentication

Get all WhatsApp Business Accounts connected to your vendor account.

Example request:
curl --request GET \
    --get "https://samparkpro.com/api/v1/whatsapp-accounts" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://samparkpro.com/api/v1/whatsapp-accounts"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/whatsapp-accounts';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/whatsapp-accounts'
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "message": "WhatsApp accounts retrieved successfully",
    "data": [
        {
            "id": 1,
            "display_phone_number": "+1234567890",
            "verified_name": "My Business",
            "nickname": "US Sales Number",
            "is_primary": true,
            "status": "active",
            "account_mode": "live"
        }
    ]
}
 

Request      

GET api/v1/whatsapp-accounts

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

WhatsApp Messages

API endpoints for sending WhatsApp messages

Send text message

requires authentication

Example request:
curl --request POST \
    "https://samparkpro.com/api/v1/messages/text" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"whatsapp_account_id\": 5,
    \"to\": \"+1234567890\",
    \"message\": \"Hello from SamparkPro!\",
    \"preview_url\": true
}"
const url = new URL(
    "https://samparkpro.com/api/v1/messages/text"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "whatsapp_account_id": 5,
    "to": "+1234567890",
    "message": "Hello from SamparkPro!",
    "preview_url": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/messages/text';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'whatsapp_account_id' => 5,
            'to' => '+1234567890',
            'message' => 'Hello from SamparkPro!',
            'preview_url' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/messages/text'
payload = {
    "whatsapp_account_id": 5,
    "to": "+1234567890",
    "message": "Hello from SamparkPro!",
    "preview_url": true
}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/v1/messages/text

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

whatsapp_account_id   integer  optional    

Optional WhatsApp account ID to send from. Uses primary account if not provided. Example: 5

to   string     

Recipient phone number with country code. Example: +1234567890

message   string     

Message text (max 4096 chars). Example: Hello from SamparkPro!

preview_url   boolean  optional    

Optional Enable URL preview. Example: true

Send image message

requires authentication

Example request:
curl --request POST \
    "https://samparkpro.com/api/v1/messages/image" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"whatsapp_account_id\": 5,
    \"to\": \"+1234567890\",
    \"caption\": \"consequatur\",
    \"image_url\": \"https:\\/\\/example.com\\/image.jpg\"
}"
const url = new URL(
    "https://samparkpro.com/api/v1/messages/image"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "whatsapp_account_id": 5,
    "to": "+1234567890",
    "caption": "consequatur",
    "image_url": "https:\/\/example.com\/image.jpg"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/messages/image';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'whatsapp_account_id' => 5,
            'to' => '+1234567890',
            'caption' => 'consequatur',
            'image_url' => 'https://example.com/image.jpg',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/messages/image'
payload = {
    "whatsapp_account_id": 5,
    "to": "+1234567890",
    "caption": "consequatur",
    "image_url": "https:\/\/example.com\/image.jpg"
}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/v1/messages/image

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

whatsapp_account_id   integer  optional    

Optional WhatsApp account ID to send from. Example: 5

to   string     

Recipient phone number. Example: +1234567890

caption   string  optional    

Optional Image caption. Example: consequatur

image_url   string     

Image URL. Example: https://example.com/image.jpg

Send audio message

requires authentication

Example request:
curl --request POST \
    "https://samparkpro.com/api/v1/messages/audio" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"whatsapp_account_id\": 5,
    \"to\": \"+1234567890\",
    \"caption\": \"Check out this image!\",
    \"audio_url\": \"https:\\/\\/example.com\\/audio.mp3\"
}"
const url = new URL(
    "https://samparkpro.com/api/v1/messages/audio"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "whatsapp_account_id": 5,
    "to": "+1234567890",
    "caption": "Check out this image!",
    "audio_url": "https:\/\/example.com\/audio.mp3"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/messages/audio';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'whatsapp_account_id' => 5,
            'to' => '+1234567890',
            'caption' => 'Check out this image!',
            'audio_url' => 'https://example.com/audio.mp3',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/messages/audio'
payload = {
    "whatsapp_account_id": 5,
    "to": "+1234567890",
    "caption": "Check out this image!",
    "audio_url": "https:\/\/example.com\/audio.mp3"
}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/v1/messages/audio

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

whatsapp_account_id   integer  optional    

Optional WhatsApp account ID to send from. Example: 5

to   string     

Recipient phone number. Example: +1234567890

caption   string  optional    

Optional caption for the media (max 1024 characters). Must not be greater than 1024 characters. Example: Check out this image!

audio_url   string     

Audio URL. Example: https://example.com/audio.mp3

Send video message

requires authentication

Example request:
curl --request POST \
    "https://samparkpro.com/api/v1/messages/video" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"whatsapp_account_id\": 5,
    \"to\": \"+1234567890\",
    \"caption\": \"consequatur\",
    \"video_url\": \"https:\\/\\/example.com\\/video.mp4\"
}"
const url = new URL(
    "https://samparkpro.com/api/v1/messages/video"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "whatsapp_account_id": 5,
    "to": "+1234567890",
    "caption": "consequatur",
    "video_url": "https:\/\/example.com\/video.mp4"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/messages/video';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'whatsapp_account_id' => 5,
            'to' => '+1234567890',
            'caption' => 'consequatur',
            'video_url' => 'https://example.com/video.mp4',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/messages/video'
payload = {
    "whatsapp_account_id": 5,
    "to": "+1234567890",
    "caption": "consequatur",
    "video_url": "https:\/\/example.com\/video.mp4"
}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/v1/messages/video

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

whatsapp_account_id   integer  optional    

Optional WhatsApp account ID to send from. Example: 5

to   string     

Recipient phone number. Example: +1234567890

caption   string  optional    

Optional Video caption. Example: consequatur

video_url   string     

Video URL. Example: https://example.com/video.mp4

Send document message

requires authentication

Example request:
curl --request POST \
    "https://samparkpro.com/api/v1/messages/document" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"whatsapp_account_id\": 5,
    \"to\": \"+1234567890\",
    \"caption\": \"consequatur\",
    \"document_url\": \"https:\\/\\/example.com\\/doc.pdf\",
    \"filename\": \"invoice.pdf\"
}"
const url = new URL(
    "https://samparkpro.com/api/v1/messages/document"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "whatsapp_account_id": 5,
    "to": "+1234567890",
    "caption": "consequatur",
    "document_url": "https:\/\/example.com\/doc.pdf",
    "filename": "invoice.pdf"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/messages/document';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'whatsapp_account_id' => 5,
            'to' => '+1234567890',
            'caption' => 'consequatur',
            'document_url' => 'https://example.com/doc.pdf',
            'filename' => 'invoice.pdf',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/messages/document'
payload = {
    "whatsapp_account_id": 5,
    "to": "+1234567890",
    "caption": "consequatur",
    "document_url": "https:\/\/example.com\/doc.pdf",
    "filename": "invoice.pdf"
}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/v1/messages/document

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

whatsapp_account_id   integer  optional    

Optional WhatsApp account ID to send from. Example: 5

to   string     

Recipient phone number. Example: +1234567890

caption   string  optional    

Optional Document caption. Example: consequatur

document_url   string     

Document URL. Example: https://example.com/doc.pdf

filename   string  optional    

Optional Document filename. Example: invoice.pdf

Send template message

requires authentication

Send a pre-approved WhatsApp message template with dynamic parameters.

Example request:
curl --request POST \
    "https://samparkpro.com/api/v1/messages/template" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"whatsapp_account_id\": 5,
    \"to\": \"+919876543210\",
    \"template_name\": \"welcome_message\",
    \"language\": \"en\",
    \"components\": [
        \"consequatur\"
    ]
}"
const url = new URL(
    "https://samparkpro.com/api/v1/messages/template"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "whatsapp_account_id": 5,
    "to": "+919876543210",
    "template_name": "welcome_message",
    "language": "en",
    "components": [
        "consequatur"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/messages/template';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'whatsapp_account_id' => 5,
            'to' => '+919876543210',
            'template_name' => 'welcome_message',
            'language' => 'en',
            'components' => [
                'consequatur',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/messages/template'
payload = {
    "whatsapp_account_id": 5,
    "to": "+919876543210",
    "template_name": "welcome_message",
    "language": "en",
    "components": [
        "consequatur"
    ]
}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "success": true,
    "message": "Template sent successfully",
    "data": {
        "id": 123,
        "type": "template",
        "template_name": "welcome_message",
        "status": "sent"
    }
}
 

Example response (400):


{
    "success": false,
    "message": "Failed to send template"
}
 

Request      

POST api/v1/messages/template

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

whatsapp_account_id   integer  optional    

Optional WhatsApp account ID to send from. Example: 5

to   string     

Recipient phone number in E.164 format. Example: +919876543210

template_name   string     

Approved template name. Example: welcome_message

language   string     

Template language code (ISO 639-1). Example: en

components   string[]  optional    

Optional Template components with dynamic values. See example below.

type   string     

Component type: header, body, or button. Example: body

parameters   string[]     

Array of parameter objects.

type   string     

Parameter type (text, currency, date_time, image, document, video). Example: text

text   string  optional    

Text value for text parameters. Example: John Doe

Webhooks

Manage webhook subscriptions for event notifications

List all webhooks

requires authentication

Example request:
curl --request GET \
    --get "https://samparkpro.com/api/v1/webhooks" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://samparkpro.com/api/v1/webhooks"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/webhooks';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/webhooks'
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "message": "Success",
    "data": [
        {
            "id": 1,
            "event_types": [
                "message.received",
                "message.sent"
            ],
            "url": "https://example.com/webhook",
            "is_active": true
        }
    ]
}
 

Request      

GET api/v1/webhooks

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

Test webhook

requires authentication

Example request:
curl --request GET \
    --get "https://samparkpro.com/api/v1/webhooks/17" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://samparkpro.com/api/v1/webhooks/17"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/webhooks/17';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/webhooks/17'
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "success": true,
    "message": "Test webhook sent"
}
 

Request      

GET api/v1/webhooks/{id}

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the webhook. Example: 17

Create webhook

requires authentication

Example request:
curl --request POST \
    "https://samparkpro.com/api/v1/webhooks" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"event_types\": [
        \"message.received\",
        \"message.sent\"
    ],
    \"url\": \"https:\\/\\/example.com\\/webhook\",
    \"secret_key\": \"consequatur\",
    \"account_filters\": {
        \"whatsapp\": [
            17
        ]
    }
}"
const url = new URL(
    "https://samparkpro.com/api/v1/webhooks"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "event_types": [
        "message.received",
        "message.sent"
    ],
    "url": "https:\/\/example.com\/webhook",
    "secret_key": "consequatur",
    "account_filters": {
        "whatsapp": [
            17
        ]
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/webhooks';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'event_types' => [
                'message.received',
                'message.sent',
            ],
            'url' => 'https://example.com/webhook',
            'secret_key' => 'consequatur',
            'account_filters' => [
                'whatsapp' => [
                    17,
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/webhooks'
payload = {
    "event_types": [
        "message.received",
        "message.sent"
    ],
    "url": "https:\/\/example.com\/webhook",
    "secret_key": "consequatur",
    "account_filters": {
        "whatsapp": [
            17
        ]
    }
}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (201):


{
    "success": true,
    "message": "Webhook created successfully",
    "data": {
        "id": 1,
        "event_types": [
            "message.received",
            "message.sent"
        ],
        "url": "https://example.com/webhook",
        "secret_key": "wh_secret_abc123..."
    }
}
 

Request      

POST api/v1/webhooks

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

event_types   string[]     

Events to subscribe to.

url   string     

Webhook URL. Example: https://example.com/webhook

secret_key   string  optional    

Optional Secret for HMAC signature. Auto-generated if not provided. Example: consequatur

account_filters   object  optional    
whatsapp   integer[]  optional    

The id of an existing record in the whatsapp_accounts table.

Update webhook

requires authentication

Example request:
curl --request PUT \
    "https://samparkpro.com/api/v1/webhooks/17" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"event_types\": [
        \"consequatur\"
    ],
    \"url\": \"http:\\/\\/kunze.biz\\/iste-laborum-eius-est-dolor.html\",
    \"account_filters\": {
        \"whatsapp\": [
            17
        ]
    },
    \"is_active\": false
}"
const url = new URL(
    "https://samparkpro.com/api/v1/webhooks/17"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "event_types": [
        "consequatur"
    ],
    "url": "http:\/\/kunze.biz\/iste-laborum-eius-est-dolor.html",
    "account_filters": {
        "whatsapp": [
            17
        ]
    },
    "is_active": false
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/webhooks/17';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'event_types' => [
                'consequatur',
            ],
            'url' => 'http://kunze.biz/iste-laborum-eius-est-dolor.html',
            'account_filters' => [
                'whatsapp' => [
                    17,
                ],
            ],
            'is_active' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/webhooks/17'
payload = {
    "event_types": [
        "consequatur"
    ],
    "url": "http:\/\/kunze.biz\/iste-laborum-eius-est-dolor.html",
    "account_filters": {
        "whatsapp": [
            17
        ]
    },
    "is_active": false
}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Request      

PUT api/v1/webhooks/{id}

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the webhook. Example: 17

Body Parameters

event_types   string[]  optional    

Optional Events to subscribe to.

url   string  optional    

Optional New webhook URL. Example: http://kunze.biz/iste-laborum-eius-est-dolor.html

account_filters   object  optional    
whatsapp   integer[]  optional    

The id of an existing record in the whatsapp_accounts table.

is_active   boolean  optional    

Optional Enable/disable webhook. Example: false

Delete webhook

requires authentication

Example request:
curl --request DELETE \
    "https://samparkpro.com/api/v1/webhooks/17" \
    --header "Authorization: Bearer YOUR_API_TOKEN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://samparkpro.com/api/v1/webhooks/17"
);

const headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://samparkpro.com/api/v1/webhooks/17';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_API_TOKEN',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://samparkpro.com/api/v1/webhooks/17'
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Request      

DELETE api/v1/webhooks/{id}

Headers

Authorization        

Example: Bearer YOUR_API_TOKEN

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the webhook. Example: 17