create entity
curl --request POST \
--url https://api.example.com/api/v1/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tenantId": 123,
"expirationDate": 123,
"planId": 123,
"startDate": 123,
"notifyBeforeExpireDays": [
123
]
}
'import requests
url = "https://api.example.com/api/v1/subscription"
payload = {
"tenantId": 123,
"expirationDate": 123,
"planId": 123,
"startDate": 123,
"notifyBeforeExpireDays": [123]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tenantId: 123,
expirationDate: 123,
planId: 123,
startDate: 123,
notifyBeforeExpireDays: [123]
})
};
fetch('https://api.example.com/api/v1/subscription', 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.example.com/api/v1/subscription",
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([
'tenantId' => 123,
'expirationDate' => 123,
'planId' => 123,
'startDate' => 123,
'notifyBeforeExpireDays' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.example.com/api/v1/subscription"
payload := strings.NewReader("{\n \"tenantId\": 123,\n \"expirationDate\": 123,\n \"planId\": 123,\n \"startDate\": 123,\n \"notifyBeforeExpireDays\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/api/v1/subscription")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tenantId\": 123,\n \"expirationDate\": 123,\n \"planId\": 123,\n \"startDate\": 123,\n \"notifyBeforeExpireDays\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenantId\": 123,\n \"expirationDate\": 123,\n \"planId\": 123,\n \"startDate\": 123,\n \"notifyBeforeExpireDays\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"tenantId": 123,
"startDate": 123,
"expirationDate": 123,
"plan": {
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"name": "<string>",
"maxUsers": 123,
"maxContracts": 123,
"maxProjects": 123,
"maxTriggers": 123,
"maxDetectors": 123,
"maxWallets": 123,
"maxActions": 123,
"maxApiKeys": 123,
"detectorRateLimit": 123,
"detectorRateLimitDuration": 123
},
"notifyBeforeExpireDays": [
123
]
}Subscription Route
create entity
POST
/
api
/
v1
/
subscription
create entity
curl --request POST \
--url https://api.example.com/api/v1/subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tenantId": 123,
"expirationDate": 123,
"planId": 123,
"startDate": 123,
"notifyBeforeExpireDays": [
123
]
}
'import requests
url = "https://api.example.com/api/v1/subscription"
payload = {
"tenantId": 123,
"expirationDate": 123,
"planId": 123,
"startDate": 123,
"notifyBeforeExpireDays": [123]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tenantId: 123,
expirationDate: 123,
planId: 123,
startDate: 123,
notifyBeforeExpireDays: [123]
})
};
fetch('https://api.example.com/api/v1/subscription', 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.example.com/api/v1/subscription",
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([
'tenantId' => 123,
'expirationDate' => 123,
'planId' => 123,
'startDate' => 123,
'notifyBeforeExpireDays' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.example.com/api/v1/subscription"
payload := strings.NewReader("{\n \"tenantId\": 123,\n \"expirationDate\": 123,\n \"planId\": 123,\n \"startDate\": 123,\n \"notifyBeforeExpireDays\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/api/v1/subscription")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tenantId\": 123,\n \"expirationDate\": 123,\n \"planId\": 123,\n \"startDate\": 123,\n \"notifyBeforeExpireDays\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenantId\": 123,\n \"expirationDate\": 123,\n \"planId\": 123,\n \"startDate\": 123,\n \"notifyBeforeExpireDays\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"tenantId": 123,
"startDate": 123,
"expirationDate": 123,
"plan": {
"id": 1,
"createdAt": 123,
"updatedAt": 123,
"name": "<string>",
"maxUsers": 123,
"maxContracts": 123,
"maxProjects": 123,
"maxTriggers": 123,
"maxDetectors": 123,
"maxWallets": 123,
"maxActions": 123,
"maxApiKeys": 123,
"detectorRateLimit": 123,
"detectorRateLimitDuration": 123
},
"notifyBeforeExpireDays": [
123
]
}Authorizations
Authentication
Body
application/json
ID of the tenant
The expiration date of the subscription.
The plan id associated with the subscription.
The start date of the subscription. Default now()
A set of values, each specifies how many days before the subscription expiration the user will receive an email notification.
Response
200 - application/json
OK
Unique identifier of the entity
Example:
1
Time when entity was created
Time when entity was updated
Status of the entity. Default: 'ACTIVE'
Available options:
ACTIVE, DISABLED, DELETED ID of the tenant
The start date of the subscription. Default now()
The expiration date of the subscription.
The plan details associated with the subscription.
Show child attributes
Show child attributes
A set of values, each specifies how many days before the subscription expiration the user will receive an email notification.
⌘I