Introduction
Enterprise API suite for WhatsApp Business messaging, Direct Email Delivery, CRM Contact management, and real-time Webhooks.
Welcome to the SamparkPro API documentation. Integrate WhatsApp Business messaging, Direct Email Marketing, CRM contacts, deals, tasks, and real-time webhook automations into your applications.
Key Services
- WhatsApp Business: Text, media, templates, interactive messages & contact synchronization.
- Email Marketing: High-performance direct transactional & marketing email sending (raw HTML or approved templates), open tracking, suppression checks, and status tracking.
- CRM & Deals: Contacts, custom attributes, tags, deals pipelines, and tasks.
- Webhooks: Real-time event subscriptions with automated delivery retry.
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.
CRM
Manage customer relationships programmatically. This group of APIs allows you to create and track contacts, deals, tasks, and retrieve pipeline stages. All endpoints in this group may require an active CRM Pro subscription.
Contacts
List all Contacts
requires authentication
Get a paginated list of CRM contacts belonging to your account.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/crm/contacts?search=architecto&per_page=16" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/crm/contacts"
);
const params = {
"search": "architecto",
"per_page": "16",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
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://www.samparkpro.com/api/v1/crm/contacts';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'search' => 'architecto',
'per_page' => '16',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/crm/contacts'
params = {
'search': 'architecto',
'per_page': '16',
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"success": true,
"message": "Contacts retrieved successfully",
"data": [
{
"id": 1,
"name": "John Doe",
"phone": "+1234567890",
"country_code": "US",
"email": "john@example.com",
"source": "api",
"status": "active",
"lead_score": 50,
"company_id": null,
"custom_attributes": null,
"tags": [
{
"id": 5,
"name": "Hot Lead",
"color": "#dc3545"
}
]
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 15,
"total": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Contact
requires authentication
Retrieve detailed information for a specific contact.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/crm/contacts/architecto" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/crm/contacts/architecto"
);
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://www.samparkpro.com/api/v1/crm/contacts/architecto';
$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://www.samparkpro.com/api/v1/crm/contacts/architecto'
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": "Contact retrieved successfully",
"data": {
"id": 1,
"name": "John Doe",
"phone": "+1234567890",
"country_code": "US",
"email": "john@example.com",
"source": "api",
"status": "active",
"lead_score": 50,
"company_id": null,
"custom_attributes": null,
"tags": []
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create Contact
requires authentication
Create a new contact in your CRM. Validates plans limits and parses formatting automatically.
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/crm/contacts" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Jane Doe\",
\"country_code\": \"US\",
\"phone\": \"+1234567890\",
\"email\": \"jane@example.com\",
\"source\": \"api\",
\"tag_ids\": [
1,
2
],
\"tags\": [
\"Hot Lead\",
\"VIP Client\"
],
\"custom_attributes\": {
\"custom_field\": \"value\"
},
\"create_missing_attributes\": false,
\"company_id\": 3,
\"lead_score\": 75
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/crm/contacts"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Jane Doe",
"country_code": "US",
"phone": "+1234567890",
"email": "jane@example.com",
"source": "api",
"tag_ids": [
1,
2
],
"tags": [
"Hot Lead",
"VIP Client"
],
"custom_attributes": {
"custom_field": "value"
},
"create_missing_attributes": false,
"company_id": 3,
"lead_score": 75
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.samparkpro.com/api/v1/crm/contacts';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Jane Doe',
'country_code' => 'US',
'phone' => '+1234567890',
'email' => 'jane@example.com',
'source' => 'api',
'tag_ids' => [
1,
2,
],
'tags' => [
'Hot Lead',
'VIP Client',
],
'custom_attributes' => [
'custom_field' => 'value',
],
'create_missing_attributes' => false,
'company_id' => 3,
'lead_score' => 75,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/crm/contacts'
payload = {
"name": "Jane Doe",
"country_code": "US",
"phone": "+1234567890",
"email": "jane@example.com",
"source": "api",
"tag_ids": [
1,
2
],
"tags": [
"Hot Lead",
"VIP Client"
],
"custom_attributes": {
"custom_field": "value"
},
"create_missing_attributes": false,
"company_id": 3,
"lead_score": 75
}
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": "Contact created successfully",
"data": {
"id": 2,
"name": "Jane Doe",
"phone": "+1234567890",
"country_code": "US",
"email": "jane@example.com",
"source": "api",
"status": "active",
"lead_score": 75,
"company_id": 3
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update Contact
requires authentication
Update an existing contact's details.
Example request:
curl --request PUT \
"https://www.samparkpro.com/api/v1/crm/contacts/architecto" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Jane Smith\",
\"country_code\": \"US\",
\"phone\": \"+1234567890\",
\"email\": \"jane.smith@example.com\",
\"source\": \"q\",
\"company_id\": 3,
\"lead_score\": 90,
\"tag_ids\": [
1
],
\"tags\": [
\"Hot Lead\",
\"VIP Client\"
],
\"tag_action\": \"add\",
\"custom_attributes\": {
\"custom_field\": \"new value\"
},
\"create_missing_attributes\": false
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/crm/contacts/architecto"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Jane Smith",
"country_code": "US",
"phone": "+1234567890",
"email": "jane.smith@example.com",
"source": "q",
"company_id": 3,
"lead_score": 90,
"tag_ids": [
1
],
"tags": [
"Hot Lead",
"VIP Client"
],
"tag_action": "add",
"custom_attributes": {
"custom_field": "new value"
},
"create_missing_attributes": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.samparkpro.com/api/v1/crm/contacts/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Jane Smith',
'country_code' => 'US',
'phone' => '+1234567890',
'email' => 'jane.smith@example.com',
'source' => 'q',
'company_id' => 3,
'lead_score' => 90,
'tag_ids' => [
1,
],
'tags' => [
'Hot Lead',
'VIP Client',
],
'tag_action' => 'add',
'custom_attributes' => [
'custom_field' => 'new value',
],
'create_missing_attributes' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/crm/contacts/architecto'
payload = {
"name": "Jane Smith",
"country_code": "US",
"phone": "+1234567890",
"email": "jane.smith@example.com",
"source": "q",
"company_id": 3,
"lead_score": 90,
"tag_ids": [
1
],
"tags": [
"Hot Lead",
"VIP Client"
],
"tag_action": "add",
"custom_attributes": {
"custom_field": "new value"
},
"create_missing_attributes": 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()Example response (200):
{
"success": true,
"message": "Contact updated successfully",
"data": {
"id": 2,
"name": "Jane Smith",
"phone": "+1234567890",
"country_code": "US",
"email": "jane.smith@example.com",
"status": "active"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete Contact
requires authentication
Delete a contact from the CRM.
Example request:
curl --request DELETE \
"https://www.samparkpro.com/api/v1/crm/contacts/architecto" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/crm/contacts/architecto"
);
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://www.samparkpro.com/api/v1/crm/contacts/architecto';
$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://www.samparkpro.com/api/v1/crm/contacts/architecto'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200):
{
"success": true,
"message": "Contact deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Deals
List all Deals
requires authentication
Get a paginated list of CRM deals.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/crm/deals?stage_id=1&contact_id=5&company_id=3&status=active&per_page=16" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/crm/deals"
);
const params = {
"stage_id": "1",
"contact_id": "5",
"company_id": "3",
"status": "active",
"per_page": "16",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
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://www.samparkpro.com/api/v1/crm/deals';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'stage_id' => '1',
'contact_id' => '5',
'company_id' => '3',
'status' => 'active',
'per_page' => '16',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/crm/deals'
params = {
'stage_id': '1',
'contact_id': '5',
'company_id': '3',
'status': 'active',
'per_page': '16',
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"success": true,
"message": "Deals retrieved successfully",
"data": [
{
"id": 1,
"title": "Enterprise Deal",
"value": "15000.00",
"currency": "INR",
"status": "active",
"closing_date": "2026-07-15",
"stage_id": 2,
"contact_id": 5,
"company_id": 3,
"assigned_to": 1
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 15,
"total": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Deal
requires authentication
Retrieve detailed information for a specific deal.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/crm/deals/architecto" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/crm/deals/architecto"
);
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://www.samparkpro.com/api/v1/crm/deals/architecto';
$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://www.samparkpro.com/api/v1/crm/deals/architecto'
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": "Deal retrieved successfully",
"data": {
"id": 1,
"title": "Enterprise Deal",
"value": "15000.00",
"currency": "INR",
"status": "active",
"closing_date": "2026-07-15",
"stage_id": 2,
"contact_id": 5,
"company_id": 3,
"assigned_to": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create Deal
requires authentication
Create a new deal in the CRM pipeline.
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/crm/deals" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"Enterprise Deal\",
\"value\": 15000,
\"stage_id\": 1,
\"contact_id\": 5,
\"company_id\": 3,
\"closing_date\": \"2026-07-15\",
\"assigned_to\": 1
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/crm/deals"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "Enterprise Deal",
"value": 15000,
"stage_id": 1,
"contact_id": 5,
"company_id": 3,
"closing_date": "2026-07-15",
"assigned_to": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.samparkpro.com/api/v1/crm/deals';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'title' => 'Enterprise Deal',
'value' => 15000.0,
'stage_id' => 1,
'contact_id' => 5,
'company_id' => 3,
'closing_date' => '2026-07-15',
'assigned_to' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/crm/deals'
payload = {
"title": "Enterprise Deal",
"value": 15000,
"stage_id": 1,
"contact_id": 5,
"company_id": 3,
"closing_date": "2026-07-15",
"assigned_to": 1
}
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": "Deal created successfully",
"data": {
"id": 1,
"title": "Enterprise Deal",
"value": "15000.00",
"currency": "INR",
"status": "active",
"closing_date": "2026-07-15",
"stage_id": 2,
"contact_id": 5,
"company_id": 3,
"assigned_to": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update Deal
requires authentication
Update an existing deal's details.
Example request:
curl --request PUT \
"https://www.samparkpro.com/api/v1/crm/deals/architecto" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"Enterprise Deal Phase 2\",
\"value\": 20000,
\"stage_id\": 2,
\"contact_id\": 5,
\"company_id\": 3,
\"closing_date\": \"2026-08-30\",
\"assigned_to\": 1,
\"status\": \"won\"
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/crm/deals/architecto"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "Enterprise Deal Phase 2",
"value": 20000,
"stage_id": 2,
"contact_id": 5,
"company_id": 3,
"closing_date": "2026-08-30",
"assigned_to": 1,
"status": "won"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.samparkpro.com/api/v1/crm/deals/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'title' => 'Enterprise Deal Phase 2',
'value' => 20000.0,
'stage_id' => 2,
'contact_id' => 5,
'company_id' => 3,
'closing_date' => '2026-08-30',
'assigned_to' => 1,
'status' => 'won',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/crm/deals/architecto'
payload = {
"title": "Enterprise Deal Phase 2",
"value": 20000,
"stage_id": 2,
"contact_id": 5,
"company_id": 3,
"closing_date": "2026-08-30",
"assigned_to": 1,
"status": "won"
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"success": true,
"message": "Deal updated successfully",
"data": {
"id": 1,
"title": "Enterprise Deal Phase 2",
"value": "20000.00",
"currency": "INR",
"status": "won",
"closing_date": "2026-08-30"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete Deal
requires authentication
Delete a deal from the CRM pipeline.
Example request:
curl --request DELETE \
"https://www.samparkpro.com/api/v1/crm/deals/architecto" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/crm/deals/architecto"
);
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://www.samparkpro.com/api/v1/crm/deals/architecto';
$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://www.samparkpro.com/api/v1/crm/deals/architecto'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200):
{
"success": true,
"message": "Deal deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Stages
List all CRM Stages
requires authentication
Get all CRM stages configured in your account. Useful to get the correct stage ID for deal operations.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/crm/stages" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/crm/stages"
);
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://www.samparkpro.com/api/v1/crm/stages';
$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://www.samparkpro.com/api/v1/crm/stages'
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": "CRM stages retrieved successfully",
"data": [
{
"id": 1,
"name": "Lead",
"color": "#1abc9c",
"probability": 10,
"sort_order": 1,
"is_won": false,
"is_lost": false
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Tasks
List all Tasks
requires authentication
Get a paginated list of CRM tasks.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/crm/tasks?status=pending&priority=high&contact_id=5&deal_id=1&per_page=16" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/crm/tasks"
);
const params = {
"status": "pending",
"priority": "high",
"contact_id": "5",
"deal_id": "1",
"per_page": "16",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
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://www.samparkpro.com/api/v1/crm/tasks';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'status' => 'pending',
'priority' => 'high',
'contact_id' => '5',
'deal_id' => '1',
'per_page' => '16',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/crm/tasks'
params = {
'status': 'pending',
'priority': 'high',
'contact_id': '5',
'deal_id': '1',
'per_page': '16',
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"success": true,
"message": "Tasks retrieved successfully",
"data": [
{
"id": 1,
"title": "Call Client",
"description": "Follow up on enterprise proposal",
"task_type": "call",
"due_date": "2026-07-01",
"due_time": "14:30",
"status": "pending",
"priority": "high",
"contact_id": 5,
"deal_id": 1,
"assigned_to": 1
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 15,
"total": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Task
requires authentication
Retrieve detailed information for a specific task.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/crm/tasks/architecto" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/crm/tasks/architecto"
);
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://www.samparkpro.com/api/v1/crm/tasks/architecto';
$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://www.samparkpro.com/api/v1/crm/tasks/architecto'
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": "Task retrieved successfully",
"data": {
"id": 1,
"title": "Call Client",
"description": "Follow up on enterprise proposal",
"task_type": "call",
"due_date": "2026-07-01",
"due_time": "14:30",
"status": "pending",
"priority": "high",
"contact_id": 5,
"deal_id": 1,
"assigned_to": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create Task
requires authentication
Create a new task.
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/crm/tasks" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"Call Client\",
\"description\": \"Follow up on enterprise proposal\",
\"task_type\": \"call\",
\"due_date\": \"2026-07-01\",
\"due_time\": \"14:30\",
\"priority\": \"high\",
\"contact_id\": 5,
\"deal_id\": 1,
\"assigned_to\": 1
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/crm/tasks"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "Call Client",
"description": "Follow up on enterprise proposal",
"task_type": "call",
"due_date": "2026-07-01",
"due_time": "14:30",
"priority": "high",
"contact_id": 5,
"deal_id": 1,
"assigned_to": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.samparkpro.com/api/v1/crm/tasks';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'title' => 'Call Client',
'description' => 'Follow up on enterprise proposal',
'task_type' => 'call',
'due_date' => '2026-07-01',
'due_time' => '14:30',
'priority' => 'high',
'contact_id' => 5,
'deal_id' => 1,
'assigned_to' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/crm/tasks'
payload = {
"title": "Call Client",
"description": "Follow up on enterprise proposal",
"task_type": "call",
"due_date": "2026-07-01",
"due_time": "14:30",
"priority": "high",
"contact_id": 5,
"deal_id": 1,
"assigned_to": 1
}
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": "Task created successfully",
"data": {
"id": 1,
"title": "Call Client",
"description": "Follow up on enterprise proposal",
"task_type": "call",
"due_date": "2026-07-01",
"due_time": "14:30",
"status": "pending",
"priority": "high",
"contact_id": 5,
"deal_id": 1,
"assigned_to": 1
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update Task
requires authentication
Update an existing task's details or toggle its status.
Example request:
curl --request PUT \
"https://www.samparkpro.com/api/v1/crm/tasks/architecto" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"Call Client Update\",
\"description\": \"Follow up on enterprise proposal and pricing\",
\"task_type\": \"meeting\",
\"due_date\": \"2026-07-02\",
\"due_time\": \"15:00\",
\"priority\": \"high\",
\"status\": \"completed\",
\"contact_id\": 5,
\"deal_id\": 1,
\"assigned_to\": 1
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/crm/tasks/architecto"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "Call Client Update",
"description": "Follow up on enterprise proposal and pricing",
"task_type": "meeting",
"due_date": "2026-07-02",
"due_time": "15:00",
"priority": "high",
"status": "completed",
"contact_id": 5,
"deal_id": 1,
"assigned_to": 1
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.samparkpro.com/api/v1/crm/tasks/architecto';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'title' => 'Call Client Update',
'description' => 'Follow up on enterprise proposal and pricing',
'task_type' => 'meeting',
'due_date' => '2026-07-02',
'due_time' => '15:00',
'priority' => 'high',
'status' => 'completed',
'contact_id' => 5,
'deal_id' => 1,
'assigned_to' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/crm/tasks/architecto'
payload = {
"title": "Call Client Update",
"description": "Follow up on enterprise proposal and pricing",
"task_type": "meeting",
"due_date": "2026-07-02",
"due_time": "15:00",
"priority": "high",
"status": "completed",
"contact_id": 5,
"deal_id": 1,
"assigned_to": 1
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"success": true,
"message": "Task updated successfully",
"data": {
"id": 1,
"title": "Call Client Update",
"description": "Follow up on enterprise proposal and pricing",
"status": "completed"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete Task
requires authentication
Delete a task from the CRM.
Example request:
curl --request DELETE \
"https://www.samparkpro.com/api/v1/crm/tasks/architecto" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/crm/tasks/architecto"
);
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://www.samparkpro.com/api/v1/crm/tasks/architecto';
$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://www.samparkpro.com/api/v1/crm/tasks/architecto'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200):
{
"success": true,
"message": "Task deleted successfully"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Integrate with the WhatsApp Business API to retrieve accounts, manage templates, and send text/media messages. All endpoints in this group require an active WhatsApp API subscription.
Accounts
List all WhatsApp accounts
requires authentication
Get all WhatsApp Business Accounts connected to your vendor account.
Example request:
curl --request GET \
--get "https://www.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://www.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://www.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://www.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"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Templates
List approved templates
requires authentication
Get approved WhatsApp templates for your vendor account.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/whatsapp/templates?whatsapp_account_id=5&search=welcome" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"whatsapp_account_id\": 16,
\"search\": \"n\"
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/whatsapp/templates"
);
const params = {
"whatsapp_account_id": "5",
"search": "welcome",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"whatsapp_account_id": 16,
"search": "n"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.samparkpro.com/api/v1/whatsapp/templates';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'whatsapp_account_id' => '5',
'search' => 'welcome',
],
'json' => [
'whatsapp_account_id' => 16,
'search' => 'n',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/whatsapp/templates'
payload = {
"whatsapp_account_id": 16,
"search": "n"
}
params = {
'whatsapp_account_id': '5',
'search': 'welcome',
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()Example response (200):
{
"success": true,
"message": "Approved WhatsApp templates retrieved successfully",
"data": [
{
"id": 1,
"whatsapp_account_id": 5,
"template_id": "123456789",
"name": "welcome_message",
"language": "en",
"category": "UTILITY",
"status": "APPROVED",
"quality_score": "HIGH",
"body_text": "Hello 1, welcome to our service!",
"header_type": "TEXT",
"footer_text": "Thank you",
"components": [
{
"type": "BODY",
"text": "Hello 1, welcome to our service!"
}
]
}
]
}
Example response (400):
{
"success": false,
"message": "No active WhatsApp account found",
"code": 400
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Messages
Send text message
requires authentication
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/whatsapp/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://www.samparkpro.com/api/v1/whatsapp/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://www.samparkpro.com/api/v1/whatsapp/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://www.samparkpro.com/api/v1/whatsapp/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()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send image message
requires authentication
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/whatsapp/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\": \"architecto\",
\"image_url\": \"https:\\/\\/example.com\\/image.jpg\"
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/whatsapp/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": "architecto",
"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://www.samparkpro.com/api/v1/whatsapp/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' => 'architecto',
'image_url' => 'https://example.com/image.jpg',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/whatsapp/messages/image'
payload = {
"whatsapp_account_id": 5,
"to": "+1234567890",
"caption": "architecto",
"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()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send audio message
requires authentication
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/whatsapp/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://www.samparkpro.com/api/v1/whatsapp/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://www.samparkpro.com/api/v1/whatsapp/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://www.samparkpro.com/api/v1/whatsapp/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()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send video message
requires authentication
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/whatsapp/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\": \"architecto\",
\"video_url\": \"https:\\/\\/example.com\\/video.mp4\"
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/whatsapp/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": "architecto",
"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://www.samparkpro.com/api/v1/whatsapp/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' => 'architecto',
'video_url' => 'https://example.com/video.mp4',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/whatsapp/messages/video'
payload = {
"whatsapp_account_id": 5,
"to": "+1234567890",
"caption": "architecto",
"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()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send document message
requires authentication
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/whatsapp/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\": \"architecto\",
\"document_url\": \"https:\\/\\/example.com\\/doc.pdf\",
\"filename\": \"invoice.pdf\"
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/whatsapp/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": "architecto",
"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://www.samparkpro.com/api/v1/whatsapp/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' => 'architecto',
'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://www.samparkpro.com/api/v1/whatsapp/messages/document'
payload = {
"whatsapp_account_id": 5,
"to": "+1234567890",
"caption": "architecto",
"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()Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send template message
requires authentication
Send a pre-approved WhatsApp message template with dynamic parameters.
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/whatsapp/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\": [
\"architecto\"
]
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/whatsapp/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": [
"architecto"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.samparkpro.com/api/v1/whatsapp/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' => [
'architecto',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/whatsapp/messages/template'
payload = {
"whatsapp_account_id": 5,
"to": "+919876543210",
"template_name": "welcome_message",
"language": "en",
"components": [
"architecto"
]
}
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"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Email Marketing
APIs for sending direct transactional & marketing emails, checking delivery status, listing approved templates, and managing sender identities.
Messages
Send Email
requires authentication
Send a direct email to a recipient via AWS SES. Supports both Raw HTML/Text and Approved Template modes with dynamic placeholder variables (e.g. {{code}}, {{name}}, {{contact.attributes.company}}).
Emails are queued and sent asynchronously with high performance, automatic suppression verification, open tracking, and recipient timeline integration.
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/email/send" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"to_email\": \"customer@example.com\",
\"to_name\": \"Jane Doe\",
\"subject\": \"Welcome to SamparkPro!\",
\"body_html\": \"<p>Hello {{name}}, your verification code is <strong>{{code}}<\\/strong>.<\\/p>\",
\"body_text\": \"Hello Jane, your verification code is 123456.\",
\"template_id\": 3,
\"template_name\": \"welcome_onboarding\",
\"template_variables\": {
\"code\": \"849201\",
\"plan_name\": \"Pro Business\"
},
\"from_email\": \"notifications@yourdomain.com\",
\"from_name\": \"SamparkPro Team\",
\"reply_to\": \"support@yourdomain.com\",
\"track_opens\": true
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/email/send"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"to_email": "customer@example.com",
"to_name": "Jane Doe",
"subject": "Welcome to SamparkPro!",
"body_html": "<p>Hello {{name}}, your verification code is <strong>{{code}}<\/strong>.<\/p>",
"body_text": "Hello Jane, your verification code is 123456.",
"template_id": 3,
"template_name": "welcome_onboarding",
"template_variables": {
"code": "849201",
"plan_name": "Pro Business"
},
"from_email": "notifications@yourdomain.com",
"from_name": "SamparkPro Team",
"reply_to": "support@yourdomain.com",
"track_opens": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.samparkpro.com/api/v1/email/send';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'to_email' => 'customer@example.com',
'to_name' => 'Jane Doe',
'subject' => 'Welcome to SamparkPro!',
'body_html' => '<p>Hello {{name}}, your verification code is <strong>{{code}}</strong>.</p>',
'body_text' => 'Hello Jane, your verification code is 123456.',
'template_id' => 3,
'template_name' => 'welcome_onboarding',
'template_variables' => [
'code' => '849201',
'plan_name' => 'Pro Business',
],
'from_email' => 'notifications@yourdomain.com',
'from_name' => 'SamparkPro Team',
'reply_to' => 'support@yourdomain.com',
'track_opens' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/email/send'
payload = {
"to_email": "customer@example.com",
"to_name": "Jane Doe",
"subject": "Welcome to SamparkPro!",
"body_html": "<p>Hello {{name}}, your verification code is <strong>{{code}}<\/strong>.<\/p>",
"body_text": "Hello Jane, your verification code is 123456.",
"template_id": 3,
"template_name": "welcome_onboarding",
"template_variables": {
"code": "849201",
"plan_name": "Pro Business"
},
"from_email": "notifications@yourdomain.com",
"from_name": "SamparkPro Team",
"reply_to": "support@yourdomain.com",
"track_opens": 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()Example response (201):
{
"success": true,
"message": "Email queued for sending successfully.",
"data": {
"id": 142,
"status": "queued",
"to_email": "customer@example.com",
"subject": "Welcome to SamparkPro!",
"from_email": "notifications@yourdomain.com",
"from_name": "SamparkPro Team",
"created_at": "2026-08-31T14:15:00.000000Z"
}
}
Example response (400):
{
"success": false,
"message": "Recipient email address is suppressed (bounce, complaint, or manual block)."
}
Example response (403):
{
"success": false,
"message": "Monthly email sending limit has been reached."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Email Status
requires authentication
Retrieve the real-time delivery status, open/click counts, delivery events, and error details of a specific sent email.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/email/messages/142" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/email/messages/142"
);
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://www.samparkpro.com/api/v1/email/messages/142';
$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://www.samparkpro.com/api/v1/email/messages/142'
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": "Email details retrieved successfully.",
"data": {
"id": 142,
"message_id": "0100018f6f578abc-8b9a1234-ses",
"status": "delivered",
"direction": "outbound",
"from_email": "notifications@yourdomain.com",
"from_name": "SamparkPro Team",
"to_email": "customer@example.com",
"subject": "Welcome to SamparkPro!",
"contact_id": 45,
"email_template_id": 3,
"sent_at": "2026-08-31T14:15:05.000000Z",
"delivered_at": "2026-08-31T14:15:08.000000Z",
"opened_at": "2026-08-31T14:22:15.000000Z",
"clicked_at": null,
"bounced_at": null,
"failed_at": null,
"error_code": null,
"error_message": null,
"created_at": "2026-08-31T14:15:00.000000Z",
"events": [
{
"event_type": "sent",
"event_data": {
"ses_message_id": "0100018f6f578abc-8b9a1234-ses"
},
"occurred_at": "2026-08-31T14:15:05.000000Z"
},
{
"event_type": "delivered",
"event_data": {
"smtp_response": "250 2.0.0 OK"
},
"occurred_at": "2026-08-31T14:15:08.000000Z"
},
{
"event_type": "open",
"event_data": {
"ip": "192.0.2.1",
"user_agent": "Mozilla/5.0"
},
"occurred_at": "2026-08-31T14:22:15.000000Z"
}
]
}
}
Example response (404):
{
"success": false,
"message": "Email message not found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Templates
List Approved Templates
requires authentication
Retrieve all email templates approved for sending via API, including their placeholder variable schemas.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/email/templates" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/email/templates"
);
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://www.samparkpro.com/api/v1/email/templates';
$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://www.samparkpro.com/api/v1/email/templates'
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": "Email templates retrieved successfully.",
"data": [
{
"id": 1,
"name": "welcome_email",
"subject": "Welcome to our platform {{contact.name}}!",
"status": "approved",
"variables": [
"contact.name",
"login_url",
"support_email"
],
"approved_at": "2026-08-01T10:00:00.000000Z",
"created_at": "2026-07-28T09:30:00.000000Z"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Sender Identities
List Sender Identities
requires authentication
Retrieve all active and verified email sender identities configured for your account.
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/email/identities" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/email/identities"
);
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://www.samparkpro.com/api/v1/email/identities';
$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://www.samparkpro.com/api/v1/email/identities'
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": "Sender identities retrieved successfully.",
"data": [
{
"id": 1,
"from_name": "SamparkPro Support",
"from_email": "support@yourdomain.com",
"reply_to_email": "helpdesk@yourdomain.com",
"is_default": true,
"created_at": "2026-07-29T14:40:00.000000Z"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Webhooks
Manage webhook subscriptions for event notifications
List all webhooks
requires authentication
Example request:
curl --request GET \
--get "https://www.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://www.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://www.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://www.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": [
"whatsapp.message.received",
"whatsapp.message.sent"
],
"account_filters": {
"whatsapp": [
1
]
},
"url": "https://example.com/webhook",
"is_active": true,
"failure_count": 0,
"last_triggered_at": "2026-06-30T12:00:00Z",
"created_at": "2026-06-30T10:00:00Z"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Test webhook
requires authentication
Example request:
curl --request GET \
--get "https://www.samparkpro.com/api/v1/webhooks/16" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/webhooks/16"
);
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://www.samparkpro.com/api/v1/webhooks/16';
$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://www.samparkpro.com/api/v1/webhooks/16'
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",
"data": {
"status": "success",
"http_status": 200
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create webhook
requires authentication
Example request:
curl --request POST \
"https://www.samparkpro.com/api/v1/webhooks" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"event_types\": [
\"whatsapp.message.received\",
\"whatsapp.message.sent\"
],
\"url\": \"https:\\/\\/example.com\\/webhook\",
\"secret_key\": \"architecto\",
\"account_filters\": {
\"whatsapp\": [
1
]
}
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/webhooks"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"event_types": [
"whatsapp.message.received",
"whatsapp.message.sent"
],
"url": "https:\/\/example.com\/webhook",
"secret_key": "architecto",
"account_filters": {
"whatsapp": [
1
]
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.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' => [
'whatsapp.message.received',
'whatsapp.message.sent',
],
'url' => 'https://example.com/webhook',
'secret_key' => 'architecto',
'account_filters' => [
'whatsapp' => [
1,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/webhooks'
payload = {
"event_types": [
"whatsapp.message.received",
"whatsapp.message.sent"
],
"url": "https:\/\/example.com\/webhook",
"secret_key": "architecto",
"account_filters": {
"whatsapp": [
1
]
}
}
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": [
"whatsapp.message.received",
"whatsapp.message.sent"
],
"account_filters": {
"whatsapp": [
1
]
},
"url": "https://example.com/webhook",
"secret_key": "wh_secret_abc123...",
"is_active": true
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update webhook
requires authentication
Example request:
curl --request PUT \
"https://www.samparkpro.com/api/v1/webhooks/16" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"event_types\": [
\"whatsapp.message.received\"
],
\"url\": \"https:\\/\\/example.com\\/webhook\",
\"account_filters\": {
\"whatsapp\": [
1
]
},
\"is_active\": true
}"
const url = new URL(
"https://www.samparkpro.com/api/v1/webhooks/16"
);
const headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"event_types": [
"whatsapp.message.received"
],
"url": "https:\/\/example.com\/webhook",
"account_filters": {
"whatsapp": [
1
]
},
"is_active": true
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$url = 'https://www.samparkpro.com/api/v1/webhooks/16';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'event_types' => [
'whatsapp.message.received',
],
'url' => 'https://example.com/webhook',
'account_filters' => [
'whatsapp' => [
1,
],
],
'is_active' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://www.samparkpro.com/api/v1/webhooks/16'
payload = {
"event_types": [
"whatsapp.message.received"
],
"url": "https:\/\/example.com\/webhook",
"account_filters": {
"whatsapp": [
1
]
},
"is_active": true
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"success": true,
"message": "Webhook updated successfully",
"data": {
"id": 1,
"event_types": [
"whatsapp.message.received"
],
"account_filters": {
"whatsapp": [
1
]
},
"url": "https://example.com/webhook",
"is_active": true
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete webhook
requires authentication
Example request:
curl --request DELETE \
"https://www.samparkpro.com/api/v1/webhooks/16" \
--header "Authorization: Bearer YOUR_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://www.samparkpro.com/api/v1/webhooks/16"
);
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://www.samparkpro.com/api/v1/webhooks/16';
$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://www.samparkpro.com/api/v1/webhooks/16'
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200):
{
"success": true,
"message": "Webhook deleted successfully",
"data": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.