curl --request POST \
--url https://api.baselayer.com/portfolio/items/{item_id}/notification_policies \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "email",
"name": "<string>",
"cadence": "daily",
"enabled": true,
"attributes": [
"officers"
],
"recipients": [
"user@example.com",
"admin@example.com"
]
}
'import requests
url = "https://api.baselayer.com/portfolio/items/{item_id}/notification_policies"
payload = {
"type": "email",
"name": "<string>",
"cadence": "daily",
"enabled": True,
"attributes": ["officers"],
"recipients": ["user@example.com", "admin@example.com"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'email',
name: '<string>',
cadence: 'daily',
enabled: true,
attributes: ['officers'],
recipients: ['user@example.com', 'admin@example.com']
})
};
fetch('https://api.baselayer.com/portfolio/items/{item_id}/notification_policies', 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://api.baselayer.com/portfolio/items/{item_id}/notification_policies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'email',
'name' => '<string>',
'cadence' => 'daily',
'enabled' => true,
'attributes' => [
'officers'
],
'recipients' => [
'user@example.com',
'admin@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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://api.baselayer.com/portfolio/items/{item_id}/notification_policies"
payload := strings.NewReader("{\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"cadence\": \"daily\",\n \"enabled\": true,\n \"attributes\": [\n \"officers\"\n ],\n \"recipients\": [\n \"user@example.com\",\n \"admin@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.post("https://api.baselayer.com/portfolio/items/{item_id}/notification_policies")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"cadence\": \"daily\",\n \"enabled\": true,\n \"attributes\": [\n \"officers\"\n ],\n \"recipients\": [\n \"user@example.com\",\n \"admin@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baselayer.com/portfolio/items/{item_id}/notification_policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"cadence\": \"daily\",\n \"enabled\": true,\n \"attributes\": [\n \"officers\"\n ],\n \"recipients\": [\n \"user@example.com\",\n \"admin@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "email",
"name": "<string>",
"enabled": true,
"cadence": "daily",
"created_at": "2023-11-07T05:31:56Z",
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_run_at": "2023-11-07T05:31:56Z",
"next_run_on": "2023-12-25",
"attributes": [
"officers"
],
"recipients": [
"user@example.com",
"admin@example.com"
],
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create Portfolio Item Notification Policy
Create a notification policy for a portfolio item.
curl --request POST \
--url https://api.baselayer.com/portfolio/items/{item_id}/notification_policies \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "email",
"name": "<string>",
"cadence": "daily",
"enabled": true,
"attributes": [
"officers"
],
"recipients": [
"user@example.com",
"admin@example.com"
]
}
'import requests
url = "https://api.baselayer.com/portfolio/items/{item_id}/notification_policies"
payload = {
"type": "email",
"name": "<string>",
"cadence": "daily",
"enabled": True,
"attributes": ["officers"],
"recipients": ["user@example.com", "admin@example.com"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'email',
name: '<string>',
cadence: 'daily',
enabled: true,
attributes: ['officers'],
recipients: ['user@example.com', 'admin@example.com']
})
};
fetch('https://api.baselayer.com/portfolio/items/{item_id}/notification_policies', 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://api.baselayer.com/portfolio/items/{item_id}/notification_policies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'email',
'name' => '<string>',
'cadence' => 'daily',
'enabled' => true,
'attributes' => [
'officers'
],
'recipients' => [
'user@example.com',
'admin@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <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://api.baselayer.com/portfolio/items/{item_id}/notification_policies"
payload := strings.NewReader("{\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"cadence\": \"daily\",\n \"enabled\": true,\n \"attributes\": [\n \"officers\"\n ],\n \"recipients\": [\n \"user@example.com\",\n \"admin@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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.post("https://api.baselayer.com/portfolio/items/{item_id}/notification_policies")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"cadence\": \"daily\",\n \"enabled\": true,\n \"attributes\": [\n \"officers\"\n ],\n \"recipients\": [\n \"user@example.com\",\n \"admin@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baselayer.com/portfolio/items/{item_id}/notification_policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"cadence\": \"daily\",\n \"enabled\": true,\n \"attributes\": [\n \"officers\"\n ],\n \"recipients\": [\n \"user@example.com\",\n \"admin@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "email",
"name": "<string>",
"enabled": true,
"cadence": "daily",
"created_at": "2023-11-07T05:31:56Z",
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_run_at": "2023-11-07T05:31:56Z",
"next_run_on": "2023-12-25",
"attributes": [
"officers"
],
"recipients": [
"user@example.com",
"admin@example.com"
],
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Body
Request model for creating a notification policy.
The type of notification policy (email, slack, webhook).
"email"
"slack"
"webhook"
The name of the notification policy.
The notification cadence (daily, weekly, monthly, yearly).
daily, weekly, biweekly, monthly, quarterly, biannually, annually "daily"
"weekly"
"monthly"
"yearly"
Whether the notification policy should be enabled.
List of attributes to notify on (officers, alternative_names).
registration_health, new_registrations, addresses, officers, alternative_names, kyb_score, risk_score, identity_network, pep, ofac, liens, litigations, bankruptcies, website_analysis ["officers"]
["alternative_names"]
List of email recipients for email notification policies.
["user@example.com", "admin@example.com"]
Response
Response
Represents a notification policy response.
The unique identifier of the notification policy.
The type of notification policy (email, slack, webhook).
"email"
"slack"
"webhook"
The name of the notification policy.
Whether the notification policy is enabled.
The notification cadence (daily, weekly, monthly, yearly).
daily, weekly, biweekly, monthly, quarterly, biannually, annually "daily"
"weekly"
"monthly"
"yearly"
When the notification policy was created.
The unique identifier of the portfolio group (if applicable).
The unique identifier of the portfolio item (if applicable).
When the notification policy was last executed.
When the notification policy is scheduled to run next.
List of attributes to notify on (officers, alternative_names).
registration_health, new_registrations, addresses, officers, alternative_names, kyb_score, risk_score, identity_network, pep, ofac, liens, litigations, bankruptcies, website_analysis ["officers"]
["alternative_names"]
List of email recipients for email notification policies.
["user@example.com", "admin@example.com"]
When the notification policy was last updated.