Send Message
Send Message
POST
https://api.ocamba.com/v1/hood/messages/send
Sends a transactional message to a resolved profile using a message template and an integration. The template channel (email, sms, or push) determines how the message is built and delivered.
Note
Provide exactly one of
to.profile_id, to.email, or to.phone.
The recipient is resolved to a profile before the message is sent.
The template must exist and its type must be email, sms, or push.
The integration must be active and its type must match the template channel.
The resolved profile must have an active subscription on the template channel.
A 202 Accepted response means the send was accepted and queued by the
delivery service. It does not confirm that the message was delivered.
Tip
Pass
X-Request-Id to correlate the Hood request with delivery-service
processing. If omitted, a UUID is generated automatically.
Use variables to supply key-value pairs substituted into the template
content at send time.Rate limits:
- Burst: 10/s
- Steady: 150/m
Header parameters
parametersRequest schema
bodyResponse schemas
›
202
application/json
›
400
application/json
›
404
application/json
›
409
application/json
›
422
application/json
›
500
application/json
curl -X POST \
"https://api.ocamba.com/v1/hood/messages/send" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"to": {
"profile_id": "1759319234567890987"
},
"template_id": "1001",
"integration_id": "1000",
"variables": {
"code": "SAVE10"
}
}'const url = 'https://api.ocamba.com/v1/hood/messages/send';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"to": {
"profile_id": "1759319234567890987"
},
"template_id": "1001",
"integration_id": "1000",
"variables": {
"code": "SAVE10"
}
}
)
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}$ch = curl_init("https://api.ocamba.com/v1/hood/messages/send");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"to" => [
"profile_id" => "1759319234567890987"
],
"template_id" => "1001",
"integration_id" => "1000",
"variables" => [
"code" => "SAVE10"
]
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);curl -X POST \
"https://api.ocamba.com/v1/hood/messages/send" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"to": {
"email": "[email protected]"
},
"template_id": "1001",
"integration_id": "1000"
}'const url = 'https://api.ocamba.com/v1/hood/messages/send';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"to": {
"email": "[email protected]"
},
"template_id": "1001",
"integration_id": "1000"
}
)
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}$ch = curl_init("https://api.ocamba.com/v1/hood/messages/send");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"to" => [
"email" => "[email protected]"
],
"template_id" => "1001",
"integration_id" => "1000"
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);curl -X POST \
"https://api.ocamba.com/v1/hood/messages/send" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"to": {
"phone": "+38164111222"
},
"template_id": "1002",
"integration_id": "1004"
}'const url = 'https://api.ocamba.com/v1/hood/messages/send';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"to": {
"phone": "+38164111222"
},
"template_id": "1002",
"integration_id": "1004"
}
)
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}$ch = curl_init("https://api.ocamba.com/v1/hood/messages/send");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"to" => [
"phone" => "+38164111222"
],
"template_id" => "1002",
"integration_id" => "1004"
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);Responses
202 Accepted
{
"request_id": "pns-1",
"status": "accepted"
}
400 Bad Request
{
"code": 400,
"title": "Bad request.",
"message": "Bad user input",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
404 Not Found
{
"code": 404,
"title": "Not found.",
"message": "profile not found",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
409 Conflict
{
"code": 409,
"title": "Conflict.",
"message": "ambiguous profile match",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
422 Unknown
{
"code": 422,
"title": "Unprocessable entity.",
"message": "email template requires an active email subscription on the profile",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
500 Internal Server Error
{
"code": 500,
"title": "Internal server error.",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses