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
- Send text, media, template, and interactive messages
- Manage contacts and conversations
- Receive real-time webhooks for incoming messages
- Full message status tracking
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": "danger"
}
]
}
],
"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\",
\"tags\": [
1,
2
],
\"custom_attributes\": {
\"custom_field\": \"value\"
},
\"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",
"tags": [
1,
2
],
"custom_attributes": {
"custom_field": "value"
},
"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',
'tags' => [
1,
2,
],
'custom_attributes' => [
'custom_field' => 'value',
],
'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",
"tags": [
1,
2
],
"custom_attributes": {
"custom_field": "value"
},
"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\",
\"company_id\": 3,
\"lead_score\": 90,
\"tags\": [
1
],
\"custom_attributes\": {
\"custom_field\": \"new value\"
}
}"
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",
"company_id": 3,
"lead_score": 90,
"tags": [
1
],
"custom_attributes": {
"custom_field": "new value"
}
};
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',
'company_id' => 3,
'lead_score' => 90,
'tags' => [
1,
],
'custom_attributes' => [
'custom_field' => 'new value',
],
],
]
);
$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",
"company_id": 3,
"lead_score": 90,
"tags": [
1
],
"custom_attributes": {
"custom_field": "new value"
}
}
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.
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.
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.