curl --request PUT \
--url https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers \
--header 'Content-Type: application/json' \
--cookie apsio_session= \
--data '
{
"layers": [
{
"name": "<string>",
"id": "<string>",
"when": {
"app_version": [
"<string>"
],
"os_name": [
"<string>"
],
"os_version_min": "<string>",
"os_version_max": "<string>",
"device_model": [
"<string>"
],
"installs": [
"<string>"
],
"users": [
"<string>"
]
},
"rollout": {
"percent": 50,
"holdback_percent": 25
},
"expires_at": "2023-11-07T05:31:56Z",
"changes": {
"capture": {},
"replay": {},
"masking": {}
},
"guardrails": {
"crash_free_drop_points": 99,
"ingest_increase_pct": 123,
"min_sessions": 500025
}
}
]
}
'import requests
url = "https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers"
payload = { "layers": [
{
"name": "<string>",
"id": "<string>",
"when": {
"app_version": ["<string>"],
"os_name": ["<string>"],
"os_version_min": "<string>",
"os_version_max": "<string>",
"device_model": ["<string>"],
"installs": ["<string>"],
"users": ["<string>"]
},
"rollout": {
"percent": 50,
"holdback_percent": 25
},
"expires_at": "2023-11-07T05:31:56Z",
"changes": {
"capture": {},
"replay": {},
"masking": {}
},
"guardrails": {
"crash_free_drop_points": 99,
"ingest_increase_pct": 123,
"min_sessions": 500025
}
}
] }
headers = {
"cookie": "apsio_session=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'apsio_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
layers: [
{
name: '<string>',
id: '<string>',
when: {
app_version: ['<string>'],
os_name: ['<string>'],
os_version_min: '<string>',
os_version_max: '<string>',
device_model: ['<string>'],
installs: ['<string>'],
users: ['<string>']
},
rollout: {percent: 50, holdback_percent: 25},
expires_at: '2023-11-07T05:31:56Z',
changes: {capture: {}, replay: {}, masking: {}},
guardrails: {crash_free_drop_points: 99, ingest_increase_pct: 123, min_sessions: 500025}
}
]
})
};
fetch('https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers', 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.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'layers' => [
[
'name' => '<string>',
'id' => '<string>',
'when' => [
'app_version' => [
'<string>'
],
'os_name' => [
'<string>'
],
'os_version_min' => '<string>',
'os_version_max' => '<string>',
'device_model' => [
'<string>'
],
'installs' => [
'<string>'
],
'users' => [
'<string>'
]
],
'rollout' => [
'percent' => 50,
'holdback_percent' => 25
],
'expires_at' => '2023-11-07T05:31:56Z',
'changes' => [
'capture' => [
],
'replay' => [
],
'masking' => [
]
],
'guardrails' => [
'crash_free_drop_points' => 99,
'ingest_increase_pct' => 123,
'min_sessions' => 500025
]
]
]
]),
CURLOPT_COOKIE => "apsio_session=",
CURLOPT_HTTPHEADER => [
"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.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers"
payload := strings.NewReader("{\n \"layers\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"when\": {\n \"app_version\": [\n \"<string>\"\n ],\n \"os_name\": [\n \"<string>\"\n ],\n \"os_version_min\": \"<string>\",\n \"os_version_max\": \"<string>\",\n \"device_model\": [\n \"<string>\"\n ],\n \"installs\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n },\n \"rollout\": {\n \"percent\": 50,\n \"holdback_percent\": 25\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"changes\": {\n \"capture\": {},\n \"replay\": {},\n \"masking\": {}\n },\n \"guardrails\": {\n \"crash_free_drop_points\": 99,\n \"ingest_increase_pct\": 123,\n \"min_sessions\": 500025\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("cookie", "apsio_session=")
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.put("https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers")
.header("cookie", "apsio_session=")
.header("Content-Type", "application/json")
.body("{\n \"layers\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"when\": {\n \"app_version\": [\n \"<string>\"\n ],\n \"os_name\": [\n \"<string>\"\n ],\n \"os_version_min\": \"<string>\",\n \"os_version_max\": \"<string>\",\n \"device_model\": [\n \"<string>\"\n ],\n \"installs\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n },\n \"rollout\": {\n \"percent\": 50,\n \"holdback_percent\": 25\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"changes\": {\n \"capture\": {},\n \"replay\": {},\n \"masking\": {}\n },\n \"guardrails\": {\n \"crash_free_drop_points\": 99,\n \"ingest_increase_pct\": 123,\n \"min_sessions\": 500025\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["cookie"] = 'apsio_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"layers\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"when\": {\n \"app_version\": [\n \"<string>\"\n ],\n \"os_name\": [\n \"<string>\"\n ],\n \"os_version_min\": \"<string>\",\n \"os_version_max\": \"<string>\",\n \"device_model\": [\n \"<string>\"\n ],\n \"installs\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n },\n \"rollout\": {\n \"percent\": 50,\n \"holdback_percent\": 25\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"changes\": {\n \"capture\": {},\n \"replay\": {},\n \"masking\": {}\n },\n \"guardrails\": {\n \"crash_free_drop_points\": 99,\n \"ingest_increase_pct\": 123,\n \"min_sessions\": 500025\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"layers": [
{
"id": "<string>",
"name": "<string>",
"when": {
"app_version": [
"<string>"
],
"os_name": [
"<string>"
],
"os_version_min": "<string>",
"os_version_max": "<string>",
"device_model": [
"<string>"
]
},
"hints": {
"installs": [
"<string>"
],
"users": [
"<string>"
]
},
"rollout": {
"percent": 50,
"holdback_percent": 25
},
"expires_at": "<string>",
"changes": {
"capture": {},
"instrumentation": {
"families": {
"summary": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"errors": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"logs": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"spans": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"network": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"metrics": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"replay": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"resources": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
}
}
},
"replay": {},
"masking": {}
},
"guardrails": {
"crash_free_drop_points": 99,
"ingest_increase_pct": 123,
"min_sessions": 500025
},
"state": "active",
"stopped_reason": "<string>",
"stopped_at": "<string>",
"updated_by": "<string>",
"updated_at": "<string>"
}
]
}Set an app's policy layers
Replaces the app’s active layers, whole and in order, and publishes them into its policy: devices take them at their next fetch (spec 12.4). An entry without an id is a new layer; one with an active layer’s id edits it. An id of a layer no longer active is 409 layer_stopped (it was stopped, rolled back or removed since the caller read it); an id the app never had is 400. An active layer left out is removed and kept in the history. At most 50. Owners and admins; audited as instrumentation.layers_update.
curl --request PUT \
--url https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers \
--header 'Content-Type: application/json' \
--cookie apsio_session= \
--data '
{
"layers": [
{
"name": "<string>",
"id": "<string>",
"when": {
"app_version": [
"<string>"
],
"os_name": [
"<string>"
],
"os_version_min": "<string>",
"os_version_max": "<string>",
"device_model": [
"<string>"
],
"installs": [
"<string>"
],
"users": [
"<string>"
]
},
"rollout": {
"percent": 50,
"holdback_percent": 25
},
"expires_at": "2023-11-07T05:31:56Z",
"changes": {
"capture": {},
"replay": {},
"masking": {}
},
"guardrails": {
"crash_free_drop_points": 99,
"ingest_increase_pct": 123,
"min_sessions": 500025
}
}
]
}
'import requests
url = "https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers"
payload = { "layers": [
{
"name": "<string>",
"id": "<string>",
"when": {
"app_version": ["<string>"],
"os_name": ["<string>"],
"os_version_min": "<string>",
"os_version_max": "<string>",
"device_model": ["<string>"],
"installs": ["<string>"],
"users": ["<string>"]
},
"rollout": {
"percent": 50,
"holdback_percent": 25
},
"expires_at": "2023-11-07T05:31:56Z",
"changes": {
"capture": {},
"replay": {},
"masking": {}
},
"guardrails": {
"crash_free_drop_points": 99,
"ingest_increase_pct": 123,
"min_sessions": 500025
}
}
] }
headers = {
"cookie": "apsio_session=",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {cookie: 'apsio_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
layers: [
{
name: '<string>',
id: '<string>',
when: {
app_version: ['<string>'],
os_name: ['<string>'],
os_version_min: '<string>',
os_version_max: '<string>',
device_model: ['<string>'],
installs: ['<string>'],
users: ['<string>']
},
rollout: {percent: 50, holdback_percent: 25},
expires_at: '2023-11-07T05:31:56Z',
changes: {capture: {}, replay: {}, masking: {}},
guardrails: {crash_free_drop_points: 99, ingest_increase_pct: 123, min_sessions: 500025}
}
]
})
};
fetch('https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers', 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.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'layers' => [
[
'name' => '<string>',
'id' => '<string>',
'when' => [
'app_version' => [
'<string>'
],
'os_name' => [
'<string>'
],
'os_version_min' => '<string>',
'os_version_max' => '<string>',
'device_model' => [
'<string>'
],
'installs' => [
'<string>'
],
'users' => [
'<string>'
]
],
'rollout' => [
'percent' => 50,
'holdback_percent' => 25
],
'expires_at' => '2023-11-07T05:31:56Z',
'changes' => [
'capture' => [
],
'replay' => [
],
'masking' => [
]
],
'guardrails' => [
'crash_free_drop_points' => 99,
'ingest_increase_pct' => 123,
'min_sessions' => 500025
]
]
]
]),
CURLOPT_COOKIE => "apsio_session=",
CURLOPT_HTTPHEADER => [
"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.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers"
payload := strings.NewReader("{\n \"layers\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"when\": {\n \"app_version\": [\n \"<string>\"\n ],\n \"os_name\": [\n \"<string>\"\n ],\n \"os_version_min\": \"<string>\",\n \"os_version_max\": \"<string>\",\n \"device_model\": [\n \"<string>\"\n ],\n \"installs\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n },\n \"rollout\": {\n \"percent\": 50,\n \"holdback_percent\": 25\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"changes\": {\n \"capture\": {},\n \"replay\": {},\n \"masking\": {}\n },\n \"guardrails\": {\n \"crash_free_drop_points\": 99,\n \"ingest_increase_pct\": 123,\n \"min_sessions\": 500025\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("cookie", "apsio_session=")
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.put("https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers")
.header("cookie", "apsio_session=")
.header("Content-Type", "application/json")
.body("{\n \"layers\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"when\": {\n \"app_version\": [\n \"<string>\"\n ],\n \"os_name\": [\n \"<string>\"\n ],\n \"os_version_min\": \"<string>\",\n \"os_version_max\": \"<string>\",\n \"device_model\": [\n \"<string>\"\n ],\n \"installs\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n },\n \"rollout\": {\n \"percent\": 50,\n \"holdback_percent\": 25\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"changes\": {\n \"capture\": {},\n \"replay\": {},\n \"masking\": {}\n },\n \"guardrails\": {\n \"crash_free_drop_points\": 99,\n \"ingest_increase_pct\": 123,\n \"min_sessions\": 500025\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/orgs/{orgId}/projects/{projectId}/apps/{appId}/layers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["cookie"] = 'apsio_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"layers\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"when\": {\n \"app_version\": [\n \"<string>\"\n ],\n \"os_name\": [\n \"<string>\"\n ],\n \"os_version_min\": \"<string>\",\n \"os_version_max\": \"<string>\",\n \"device_model\": [\n \"<string>\"\n ],\n \"installs\": [\n \"<string>\"\n ],\n \"users\": [\n \"<string>\"\n ]\n },\n \"rollout\": {\n \"percent\": 50,\n \"holdback_percent\": 25\n },\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"changes\": {\n \"capture\": {},\n \"replay\": {},\n \"masking\": {}\n },\n \"guardrails\": {\n \"crash_free_drop_points\": 99,\n \"ingest_increase_pct\": 123,\n \"min_sessions\": 500025\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"layers": [
{
"id": "<string>",
"name": "<string>",
"when": {
"app_version": [
"<string>"
],
"os_name": [
"<string>"
],
"os_version_min": "<string>",
"os_version_max": "<string>",
"device_model": [
"<string>"
]
},
"hints": {
"installs": [
"<string>"
],
"users": [
"<string>"
]
},
"rollout": {
"percent": 50,
"holdback_percent": 25
},
"expires_at": "<string>",
"changes": {
"capture": {},
"instrumentation": {
"families": {
"summary": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"errors": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"logs": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"spans": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"network": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"metrics": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"replay": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
},
"resources": {
"mode": "always",
"rate": 0.5,
"triggers": [
"<string>"
],
"window_minutes": 30,
"retention_hours": 84,
"cap_bytes": 10518528
}
}
},
"replay": {},
"masking": {}
},
"guardrails": {
"crash_free_drop_points": 99,
"ingest_increase_pct": 123,
"min_sessions": 500025
},
"state": "active",
"stopped_reason": "<string>",
"stopped_at": "<string>",
"updated_by": "<string>",
"updated_at": "<string>"
}
]
}Authorizations
The console session, set by /v1/auth/callback (__Host-apsio_session when host-only).
Path Parameters
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"0192f3a4-0000-7000-8000-00000000a001"
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"0192f3a4-0000-7000-8000-00000000a001"
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"0192f3a4-0000-7000-8000-00000000a001"
Body
50Show child attributes
Show child attributes
Response
The layers, as published
Show child attributes
Show child attributes