Create an unavailability
curl --request POST \
--url https://api.trlyr.com/physical-assets/{physicalAssetID}/unavailability \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Annual maintenance",
"end": "2023-11-12T00:00:00Z",
"start": "2023-11-11T00:00:00Z",
"type": "MAINTENANCE",
"volume": {
"energyCapacity": 1000,
"powerCapacity": {
"charge": 1000,
"discharge": 1000
}
}
}
'import requests
url = "https://api.trlyr.com/physical-assets/{physicalAssetID}/unavailability"
payload = {
"description": "Annual maintenance",
"end": "2023-11-12T00:00:00Z",
"start": "2023-11-11T00:00:00Z",
"type": "MAINTENANCE",
"volume": {
"energyCapacity": 1000,
"powerCapacity": {
"charge": 1000,
"discharge": 1000
}
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Annual maintenance',
end: '2023-11-12T00:00:00Z',
start: '2023-11-11T00:00:00Z',
type: 'MAINTENANCE',
volume: {energyCapacity: 1000, powerCapacity: {charge: 1000, discharge: 1000}}
})
};
fetch('https://api.trlyr.com/physical-assets/{physicalAssetID}/unavailability', 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.trlyr.com/physical-assets/{physicalAssetID}/unavailability",
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([
'description' => 'Annual maintenance',
'end' => '2023-11-12T00:00:00Z',
'start' => '2023-11-11T00:00:00Z',
'type' => 'MAINTENANCE',
'volume' => [
'energyCapacity' => 1000,
'powerCapacity' => [
'charge' => 1000,
'discharge' => 1000
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.trlyr.com/physical-assets/{physicalAssetID}/unavailability"
payload := strings.NewReader("{\n \"description\": \"Annual maintenance\",\n \"end\": \"2023-11-12T00:00:00Z\",\n \"start\": \"2023-11-11T00:00:00Z\",\n \"type\": \"MAINTENANCE\",\n \"volume\": {\n \"energyCapacity\": 1000,\n \"powerCapacity\": {\n \"charge\": 1000,\n \"discharge\": 1000\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.trlyr.com/physical-assets/{physicalAssetID}/unavailability")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Annual maintenance\",\n \"end\": \"2023-11-12T00:00:00Z\",\n \"start\": \"2023-11-11T00:00:00Z\",\n \"type\": \"MAINTENANCE\",\n \"volume\": {\n \"energyCapacity\": 1000,\n \"powerCapacity\": {\n \"charge\": 1000,\n \"discharge\": 1000\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trlyr.com/physical-assets/{physicalAssetID}/unavailability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Annual maintenance\",\n \"end\": \"2023-11-12T00:00:00Z\",\n \"start\": \"2023-11-11T00:00:00Z\",\n \"type\": \"MAINTENANCE\",\n \"volume\": {\n \"energyCapacity\": 1000,\n \"powerCapacity\": {\n \"charge\": 1000,\n \"discharge\": 1000\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"description": "<string>",
"eexNotificationIds": [
"<string>"
],
"end": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"physicalAssetID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start": "<string>",
"type": "<string>",
"volume": {
"energyCapacity": 123,
"powerCapacity": {
"charge": 123,
"discharge": 123
}
}
}physical-assets
Create an unavailability
POST
/
physical-assets
/
{physicalAssetID}
/
unavailability
Create an unavailability
curl --request POST \
--url https://api.trlyr.com/physical-assets/{physicalAssetID}/unavailability \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Annual maintenance",
"end": "2023-11-12T00:00:00Z",
"start": "2023-11-11T00:00:00Z",
"type": "MAINTENANCE",
"volume": {
"energyCapacity": 1000,
"powerCapacity": {
"charge": 1000,
"discharge": 1000
}
}
}
'import requests
url = "https://api.trlyr.com/physical-assets/{physicalAssetID}/unavailability"
payload = {
"description": "Annual maintenance",
"end": "2023-11-12T00:00:00Z",
"start": "2023-11-11T00:00:00Z",
"type": "MAINTENANCE",
"volume": {
"energyCapacity": 1000,
"powerCapacity": {
"charge": 1000,
"discharge": 1000
}
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Annual maintenance',
end: '2023-11-12T00:00:00Z',
start: '2023-11-11T00:00:00Z',
type: 'MAINTENANCE',
volume: {energyCapacity: 1000, powerCapacity: {charge: 1000, discharge: 1000}}
})
};
fetch('https://api.trlyr.com/physical-assets/{physicalAssetID}/unavailability', 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.trlyr.com/physical-assets/{physicalAssetID}/unavailability",
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([
'description' => 'Annual maintenance',
'end' => '2023-11-12T00:00:00Z',
'start' => '2023-11-11T00:00:00Z',
'type' => 'MAINTENANCE',
'volume' => [
'energyCapacity' => 1000,
'powerCapacity' => [
'charge' => 1000,
'discharge' => 1000
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.trlyr.com/physical-assets/{physicalAssetID}/unavailability"
payload := strings.NewReader("{\n \"description\": \"Annual maintenance\",\n \"end\": \"2023-11-12T00:00:00Z\",\n \"start\": \"2023-11-11T00:00:00Z\",\n \"type\": \"MAINTENANCE\",\n \"volume\": {\n \"energyCapacity\": 1000,\n \"powerCapacity\": {\n \"charge\": 1000,\n \"discharge\": 1000\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.trlyr.com/physical-assets/{physicalAssetID}/unavailability")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Annual maintenance\",\n \"end\": \"2023-11-12T00:00:00Z\",\n \"start\": \"2023-11-11T00:00:00Z\",\n \"type\": \"MAINTENANCE\",\n \"volume\": {\n \"energyCapacity\": 1000,\n \"powerCapacity\": {\n \"charge\": 1000,\n \"discharge\": 1000\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trlyr.com/physical-assets/{physicalAssetID}/unavailability")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Annual maintenance\",\n \"end\": \"2023-11-12T00:00:00Z\",\n \"start\": \"2023-11-11T00:00:00Z\",\n \"type\": \"MAINTENANCE\",\n \"volume\": {\n \"energyCapacity\": 1000,\n \"powerCapacity\": {\n \"charge\": 1000,\n \"discharge\": 1000\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"description": "<string>",
"eexNotificationIds": [
"<string>"
],
"end": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"physicalAssetID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start": "<string>",
"type": "<string>",
"volume": {
"energyCapacity": 123,
"powerCapacity": {
"charge": 123,
"discharge": 123
}
}
}Headers
Access token
Path Parameters
Physical asset ID
Body
application/json
Unavailability parameters
Unavailability parameters
Example:
"Annual maintenance"
Example:
"2023-11-12T00:00:00Z"
Example:
"2023-11-11T00:00:00Z"
Example:
"MAINTENANCE"
Example:
["550e8400-e29b-41d4-a716-446655440000"]
Response
Created
Last modified on August 21, 2026