> Toden documentation. For the full index fetch /llms.txt. Every page is available as Markdown by appending .md to its URL. Identity verification uses /api/kyc, Risk Intelligence uses /api/v1; they are separate contracts with different error shapes. Never invent an endpoint, field or enum value: read the API reference page for the operation first.

# Bulk create monitoring subscriptions

POST https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk
Content-Type: application/json

Reference: https://docs.toden.co/api-reference/risk-intelligence/monitoring/post-bulkcreatemonitoringsubscriptions

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://sandbox-api.toden.co/api/v1` (Sandbox, default)
- `https://api.toden.co/api/v1` (Production)

## Request

### Headers

- `X-Request-Id` (string, optional)
- `Idempotency-Key` (string, required)

### Body (application/json)

This endpoint expects a MonitoringBulkEnrollmentCreate.

- `policyId` (string, required)
- `subjects` (list of Subject, required)

## Response

### 200

Success

- `job` (MonitoringEnrollmentJob, required)

### 201

Success

- `job` (MonitoringEnrollmentJob, required)

## Errors

### 400 Bad Request Error

HTTP 400

- `error` (ErrorEnvelopeError, required)

### 401 Unauthorized Error

HTTP 401

- `error` (ErrorEnvelopeError, required)

### 402 Payment Required Error

HTTP 402

- `error` (ErrorEnvelopeError, required)

### 403 Forbidden Error

HTTP 403

- `error` (ErrorEnvelopeError, required)

### 404 Not Found Error

HTTP 404

- `error` (ErrorEnvelopeError, required)

### 409 Conflict Error

HTTP 409

- `error` (ErrorEnvelopeError, required)

### 413 Content Too Large Error

HTTP 400

- `error` (ErrorEnvelopeError, required)

### 422 Unprocessable Entity Error

HTTP 400

- `error` (ErrorEnvelopeError, required)

### 429 Too Many Requests Error

HTTP 429

- `error` (ErrorEnvelopeError, required)

### 500 Internal Server Error

HTTP 500

- `error` (ErrorEnvelopeError, required)

### 502 Bad Gateway Error

HTTP 503

- `error` (ErrorEnvelopeError, required)

### 503 Service Unavailable Error

HTTP 503

- `error` (ErrorEnvelopeError, required)

## Types

### Subject

- `type` (enum, required)
  - Allowed values: `individual`, `business`, `wallet`, `bank_account`, `device`, `email`, `phone`, `ip`
- `id` (string, required)

### MonitoringEnrollmentJob

- `id` (string, required)
- `policyId` (string, required)
- `status` (enum, required)
  - Allowed values: `processing`, `completed`, `failed`, `partial`
- `total` (integer, required)
- `succeeded` (integer, required)
- `failed` (integer, required)
- `items` (list of MonitoringEnrollmentJobItem, required)
- `createdAt` (datetime, required)
- `completedAt` (datetime, required, nullable)

### ErrorEnvelopeError

- `type` (enum, required)
  - Allowed values: `AUTHENTICATION_ERROR`, `PERMISSION_ERROR`, `VALIDATION_ERROR`, `NOT_FOUND`, `CONFLICT`, `IDEMPOTENCY_CONFLICT`, `INSUFFICIENT_CREDIT`, `RATE_LIMITED`, `SERVICE_UNAVAILABLE`, `INTERNAL_ERROR`
- `code` (string, required)
- `message` (string, required)
- `request_id` (string, required, nullable)
- `details` (any, optional)

### MonitoringEnrollmentJobItem

- `subject` (Subject, required)
- `status` (enum, required)
  - Allowed values: `pending`, `succeeded`, `failed`
- `subscriptionId` (string, required, nullable)
- `errorCode` (string, required, nullable)
- `processedAt` (datetime, required, nullable)

## Examples

### Example 1

**Request**

```json
{
  "policyId": "string",
  "subjects": [
    {
      "type": "individual",
      "id": "string"
    }
  ]
}
```

**Response**

```json
{
  "job": {
    "id": "string",
    "policyId": "string",
    "status": "processing",
    "total": 1,
    "succeeded": 1,
    "failed": 1,
    "items": [
      {
        "subject": {
          "type": "individual",
          "id": "string"
        },
        "status": "pending",
        "subscriptionId": "string",
        "errorCode": "string",
        "processedAt": "2024-01-15T09:30:00Z"
      }
    ],
    "createdAt": "2024-01-15T09:30:00Z",
    "completedAt": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk"

payload = {
    "policyId": "string",
    "subjects": [
        {
            "type": "individual",
            "id": "string"
        }
    ]
}
headers = {
    "Idempotency-Key": "Idempotency-Key",
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': 'Idempotency-Key',
    Authorization: 'Bearer <apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"policyId":"string","subjects":[{"type":"individual","id":"string"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk"

	payload := strings.NewReader("{\n  \"policyId\": \"string\",\n  \"subjects\": [\n    {\n      \"type\": \"individual\",\n      \"id\": \"string\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "Idempotency-Key")
	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = 'Idempotency-Key'
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"policyId\": \"string\",\n  \"subjects\": [\n    {\n      \"type\": \"individual\",\n      \"id\": \"string\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk")
  .header("Idempotency-Key", "Idempotency-Key")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"policyId\": \"string\",\n  \"subjects\": [\n    {\n      \"type\": \"individual\",\n      \"id\": \"string\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk', [
  'body' => '{
  "policyId": "string",
  "subjects": [
    {
      "type": "individual",
      "id": "string"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'Idempotency-Key',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "Idempotency-Key");
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"policyId\": \"string\",\n  \"subjects\": [\n    {\n      \"type\": \"individual\",\n      \"id\": \"string\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Idempotency-Key": "Idempotency-Key",
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "policyId": "string",
  "subjects": [
    [
      "type": "individual",
      "id": "string"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example 2

**Request**

```json
{
  "policyId": "string",
  "subjects": [
    {
      "type": "individual",
      "id": "string"
    }
  ]
}
```

**Response**

```json
{
  "job": {
    "id": "string",
    "policyId": "string",
    "status": "processing",
    "total": 1,
    "succeeded": 1,
    "failed": 1,
    "items": [
      {
        "subject": {
          "type": "individual",
          "id": "string"
        },
        "status": "pending",
        "subscriptionId": "string",
        "errorCode": "string",
        "processedAt": "2024-01-15T09:30:00Z"
      }
    ],
    "createdAt": "2024-01-15T09:30:00Z",
    "completedAt": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk"

payload = {
    "policyId": "string",
    "subjects": [
        {
            "type": "individual",
            "id": "string"
        }
    ]
}
headers = {
    "Idempotency-Key": "Idempotency-Key",
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': 'Idempotency-Key',
    Authorization: 'Bearer <apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"policyId":"string","subjects":[{"type":"individual","id":"string"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk"

	payload := strings.NewReader("{\n  \"policyId\": \"string\",\n  \"subjects\": [\n    {\n      \"type\": \"individual\",\n      \"id\": \"string\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "Idempotency-Key")
	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = 'Idempotency-Key'
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"policyId\": \"string\",\n  \"subjects\": [\n    {\n      \"type\": \"individual\",\n      \"id\": \"string\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk")
  .header("Idempotency-Key", "Idempotency-Key")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"policyId\": \"string\",\n  \"subjects\": [\n    {\n      \"type\": \"individual\",\n      \"id\": \"string\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk', [
  'body' => '{
  "policyId": "string",
  "subjects": [
    {
      "type": "individual",
      "id": "string"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'Idempotency-Key',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "Idempotency-Key");
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"policyId\": \"string\",\n  \"subjects\": [\n    {\n      \"type\": \"individual\",\n      \"id\": \"string\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Idempotency-Key": "Idempotency-Key",
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "policyId": "string",
  "subjects": [
    [
      "type": "individual",
      "id": "string"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox-api.toden.co/api/v1/monitoring/subscriptions/bulk")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```