Add/Update Vendor Approval
Add or update a vendor approval entry for a WhatsApp or SMS variant. Use this to record approval status from the vendor portal, including the vendor template ID and name.
curl -X PATCH "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/?mode=live" \
--header 'Authorization: ServiceToken <token>' \
--header 'Content-Type: application/json' \
--data '{
"approval_status": "approved",
"vendor_slug": "twilio-whatsapp",
"vendor_uid": "waba_id-123221",
"vendor_template_name": "tpl_v12",
"vendor_template_id": "1232",
"vendor_locale_code": "en",
"vendor_template_category": "UTILITY"
}'import requests
url = "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/"
payload = {
"approval_status": "approved",
"vendor_slug": "twilio-whatsapp",
"vendor_uid": "waba_id-123221",
"vendor_template_name": "tpl_v12",
"vendor_template_id": "1232",
"vendor_locale_code": "en",
"vendor_template_category": "UTILITY",
"provider_template_id": "<string>",
"comment": "<string>"
}
headers = {
"ServiceToken <token>": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'ServiceToken <token>': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
approval_status: 'approved',
vendor_slug: 'twilio-whatsapp',
vendor_uid: 'waba_id-123221',
vendor_template_name: 'tpl_v12',
vendor_template_id: '1232',
vendor_locale_code: 'en',
vendor_template_category: 'UTILITY',
provider_template_id: '<string>',
comment: '<string>'
})
};
fetch('https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'approval_status' => 'approved',
'vendor_slug' => 'twilio-whatsapp',
'vendor_uid' => 'waba_id-123221',
'vendor_template_name' => 'tpl_v12',
'vendor_template_id' => '1232',
'vendor_locale_code' => 'en',
'vendor_template_category' => 'UTILITY',
'provider_template_id' => '<string>',
'comment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ServiceToken <token>: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/"
payload := strings.NewReader("{\n \"approval_status\": \"approved\",\n \"vendor_slug\": \"twilio-whatsapp\",\n \"vendor_uid\": \"waba_id-123221\",\n \"vendor_template_name\": \"tpl_v12\",\n \"vendor_template_id\": \"1232\",\n \"vendor_locale_code\": \"en\",\n \"vendor_template_category\": \"UTILITY\",\n \"provider_template_id\": \"<string>\",\n \"comment\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("ServiceToken <token>", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/")
.header("ServiceToken <token>", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"approval_status\": \"approved\",\n \"vendor_slug\": \"twilio-whatsapp\",\n \"vendor_uid\": \"waba_id-123221\",\n \"vendor_template_name\": \"tpl_v12\",\n \"vendor_template_id\": \"1232\",\n \"vendor_locale_code\": \"en\",\n \"vendor_template_category\": \"UTILITY\",\n \"provider_template_id\": \"<string>\",\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["ServiceToken <token>"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"approval_status\": \"approved\",\n \"vendor_slug\": \"twilio-whatsapp\",\n \"vendor_uid\": \"waba_id-123221\",\n \"vendor_template_name\": \"tpl_v12\",\n \"vendor_template_id\": \"1232\",\n \"vendor_locale_code\": \"en\",\n \"vendor_template_category\": \"UTILITY\",\n \"provider_template_id\": \"<string>\",\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"code": 400,
"error_code": "error",
"type": "ValidationError",
"message": "[\"one of more variants about to be committed have issues.\\n[1] email:default errors: {'body.raw.html': ['missing']}\\n[2] slack:default errors: {'body_text': ['missing']}\"]",
"detail": [
"one of more variants about to be committed have issues.\n[1] email:default errors: {'body.raw.html': ['missing']}\n[2] slack:default errors: {'body_text': ['missing']}"
]
}{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "workspace 'demo' not found",
"detail": "workspace 'demo' not found"
}Authorizations
You can get Service Token from SuprSend dashboard -> Account Settings -> Service Tokens section.
Path Parameters
whatsapp, sms Query Parameters
live Body
Current approval status.
pending, sent_for_approval, approved, rejected "approved"
Slug of the vendor (e.g., twilio-whatsapp, gupshup-whatsapp, msg91-sms).
"twilio-whatsapp"
Unique vendor identifier (e.g., WABA ID for WhatsApp).
"waba_id-123221"
(Required if approved) Template name as registered at the vendor portal.
"tpl_v12"
(Required if approved) Template ID from the vendor portal.
"1232"
(Optional) Locale code at the vendor end.
"en"
(Optional) Template category at the vendor end.
UTILITY, MARKETING, AUTHENTICATION "UTILITY"
(Optional, SMS only for msg91-sms) Provider-level template ID.
(Required if rejected) Reason for rejection.
Response
Vendor approval entry updated
The response is of type object.
Was this page helpful?
curl -X PATCH "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/?mode=live" \
--header 'Authorization: ServiceToken <token>' \
--header 'Content-Type: application/json' \
--data '{
"approval_status": "approved",
"vendor_slug": "twilio-whatsapp",
"vendor_uid": "waba_id-123221",
"vendor_template_name": "tpl_v12",
"vendor_template_id": "1232",
"vendor_locale_code": "en",
"vendor_template_category": "UTILITY"
}'import requests
url = "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/"
payload = {
"approval_status": "approved",
"vendor_slug": "twilio-whatsapp",
"vendor_uid": "waba_id-123221",
"vendor_template_name": "tpl_v12",
"vendor_template_id": "1232",
"vendor_locale_code": "en",
"vendor_template_category": "UTILITY",
"provider_template_id": "<string>",
"comment": "<string>"
}
headers = {
"ServiceToken <token>": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'ServiceToken <token>': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
approval_status: 'approved',
vendor_slug: 'twilio-whatsapp',
vendor_uid: 'waba_id-123221',
vendor_template_name: 'tpl_v12',
vendor_template_id: '1232',
vendor_locale_code: 'en',
vendor_template_category: 'UTILITY',
provider_template_id: '<string>',
comment: '<string>'
})
};
fetch('https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'approval_status' => 'approved',
'vendor_slug' => 'twilio-whatsapp',
'vendor_uid' => 'waba_id-123221',
'vendor_template_name' => 'tpl_v12',
'vendor_template_id' => '1232',
'vendor_locale_code' => 'en',
'vendor_template_category' => 'UTILITY',
'provider_template_id' => '<string>',
'comment' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"ServiceToken <token>: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/"
payload := strings.NewReader("{\n \"approval_status\": \"approved\",\n \"vendor_slug\": \"twilio-whatsapp\",\n \"vendor_uid\": \"waba_id-123221\",\n \"vendor_template_name\": \"tpl_v12\",\n \"vendor_template_id\": \"1232\",\n \"vendor_locale_code\": \"en\",\n \"vendor_template_category\": \"UTILITY\",\n \"provider_template_id\": \"<string>\",\n \"comment\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("ServiceToken <token>", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/")
.header("ServiceToken <token>", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"approval_status\": \"approved\",\n \"vendor_slug\": \"twilio-whatsapp\",\n \"vendor_uid\": \"waba_id-123221\",\n \"vendor_template_name\": \"tpl_v12\",\n \"vendor_template_id\": \"1232\",\n \"vendor_locale_code\": \"en\",\n \"vendor_template_category\": \"UTILITY\",\n \"provider_template_id\": \"<string>\",\n \"comment\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://management-api.suprsend.com/v2/{workspace}/template/{template_slug}/channel/{channel}/variant/{variant_id}/vendor_approval/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["ServiceToken <token>"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"approval_status\": \"approved\",\n \"vendor_slug\": \"twilio-whatsapp\",\n \"vendor_uid\": \"waba_id-123221\",\n \"vendor_template_name\": \"tpl_v12\",\n \"vendor_template_id\": \"1232\",\n \"vendor_locale_code\": \"en\",\n \"vendor_template_category\": \"UTILITY\",\n \"provider_template_id\": \"<string>\",\n \"comment\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"code": 400,
"error_code": "error",
"type": "ValidationError",
"message": "[\"one of more variants about to be committed have issues.\\n[1] email:default errors: {'body.raw.html': ['missing']}\\n[2] slack:default errors: {'body_text': ['missing']}\"]",
"detail": [
"one of more variants about to be committed have issues.\n[1] email:default errors: {'body.raw.html': ['missing']}\n[2] slack:default errors: {'body_text': ['missing']}"
]
}{
"code": 401,
"error_code": "authentication_failed",
"type": "AuthenticationFailed",
"message": "Invalid service token.",
"detail": "Invalid service token."
}{
"code": 404,
"error_code": "not_found",
"type": "NotFound",
"message": "workspace 'demo' not found",
"detail": "workspace 'demo' not found"
}