Record a measured build
curl --request POST \
--url https://api.apsio.io/v1/projects/{projectId}/checks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"app_id": "<string>",
"release": "<string>",
"binary_bytes": 123,
"install_bytes": 123,
"build": "<string>",
"commit_sha": "9b311d2",
"branch": "<string>",
"warn_percent": 123,
"base_branch": "<string>",
"baseline_release": "<string>",
"baseline_build": "<string>"
}
'import requests
url = "https://api.apsio.io/v1/projects/{projectId}/checks"
payload = {
"app_id": "<string>",
"release": "<string>",
"binary_bytes": 123,
"install_bytes": 123,
"build": "<string>",
"commit_sha": "9b311d2",
"branch": "<string>",
"warn_percent": 123,
"base_branch": "<string>",
"baseline_release": "<string>",
"baseline_build": "<string>"
}
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({
app_id: '<string>',
release: '<string>',
binary_bytes: 123,
install_bytes: 123,
build: '<string>',
commit_sha: '9b311d2',
branch: '<string>',
warn_percent: 123,
base_branch: '<string>',
baseline_release: '<string>',
baseline_build: '<string>'
})
};
fetch('https://api.apsio.io/v1/projects/{projectId}/checks', 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/projects/{projectId}/checks",
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([
'app_id' => '<string>',
'release' => '<string>',
'binary_bytes' => 123,
'install_bytes' => 123,
'build' => '<string>',
'commit_sha' => '9b311d2',
'branch' => '<string>',
'warn_percent' => 123,
'base_branch' => '<string>',
'baseline_release' => '<string>',
'baseline_build' => '<string>'
]),
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.apsio.io/v1/projects/{projectId}/checks"
payload := strings.NewReader("{\n \"app_id\": \"<string>\",\n \"release\": \"<string>\",\n \"binary_bytes\": 123,\n \"install_bytes\": 123,\n \"build\": \"<string>\",\n \"commit_sha\": \"9b311d2\",\n \"branch\": \"<string>\",\n \"warn_percent\": 123,\n \"base_branch\": \"<string>\",\n \"baseline_release\": \"<string>\",\n \"baseline_build\": \"<string>\"\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.apsio.io/v1/projects/{projectId}/checks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"app_id\": \"<string>\",\n \"release\": \"<string>\",\n \"binary_bytes\": 123,\n \"install_bytes\": 123,\n \"build\": \"<string>\",\n \"commit_sha\": \"9b311d2\",\n \"branch\": \"<string>\",\n \"warn_percent\": 123,\n \"base_branch\": \"<string>\",\n \"baseline_release\": \"<string>\",\n \"baseline_build\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/projects/{projectId}/checks")
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 \"app_id\": \"<string>\",\n \"release\": \"<string>\",\n \"binary_bytes\": 123,\n \"install_bytes\": 123,\n \"build\": \"<string>\",\n \"commit_sha\": \"9b311d2\",\n \"branch\": \"<string>\",\n \"warn_percent\": 123,\n \"base_branch\": \"<string>\",\n \"baseline_release\": \"<string>\",\n \"baseline_build\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"release": "4.12.0",
"build": "<string>",
"commit_sha": "<string>",
"branch": "<string>",
"binary_bytes": 123,
"install_bytes": 123,
"created_at": "<string>",
"app_id": "<string>",
"format": "ipa",
"warn_percent": 123,
"baseline": {
"id": "<string>",
"release": "4.12.0",
"build": "<string>",
"commit_sha": "<string>",
"branch": "<string>",
"binary_bytes": 123,
"install_bytes": 123,
"created_at": "<string>"
},
"change": {
"binary_bytes": 123,
"binary_percent": 123,
"install_bytes": 123,
"install_percent": 123,
"warning": true
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}API reference
Record a measured build
What apsio check sends from CI: a build’s sizes, measured there. The answer compares it with its baseline, always of the same app and format: baseline_release (and baseline_build) when given, else the last run recorded, on base_branch or branch when that has one, never of the same commit. Needs a project token with the checks:write scope, which holds no other scope and reads nothing. Runs are kept 400 days. The check warns and never blocks.
POST
/
projects
/
{projectId}
/
checks
Record a measured build
curl --request POST \
--url https://api.apsio.io/v1/projects/{projectId}/checks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"app_id": "<string>",
"release": "<string>",
"binary_bytes": 123,
"install_bytes": 123,
"build": "<string>",
"commit_sha": "9b311d2",
"branch": "<string>",
"warn_percent": 123,
"base_branch": "<string>",
"baseline_release": "<string>",
"baseline_build": "<string>"
}
'import requests
url = "https://api.apsio.io/v1/projects/{projectId}/checks"
payload = {
"app_id": "<string>",
"release": "<string>",
"binary_bytes": 123,
"install_bytes": 123,
"build": "<string>",
"commit_sha": "9b311d2",
"branch": "<string>",
"warn_percent": 123,
"base_branch": "<string>",
"baseline_release": "<string>",
"baseline_build": "<string>"
}
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({
app_id: '<string>',
release: '<string>',
binary_bytes: 123,
install_bytes: 123,
build: '<string>',
commit_sha: '9b311d2',
branch: '<string>',
warn_percent: 123,
base_branch: '<string>',
baseline_release: '<string>',
baseline_build: '<string>'
})
};
fetch('https://api.apsio.io/v1/projects/{projectId}/checks', 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/projects/{projectId}/checks",
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([
'app_id' => '<string>',
'release' => '<string>',
'binary_bytes' => 123,
'install_bytes' => 123,
'build' => '<string>',
'commit_sha' => '9b311d2',
'branch' => '<string>',
'warn_percent' => 123,
'base_branch' => '<string>',
'baseline_release' => '<string>',
'baseline_build' => '<string>'
]),
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.apsio.io/v1/projects/{projectId}/checks"
payload := strings.NewReader("{\n \"app_id\": \"<string>\",\n \"release\": \"<string>\",\n \"binary_bytes\": 123,\n \"install_bytes\": 123,\n \"build\": \"<string>\",\n \"commit_sha\": \"9b311d2\",\n \"branch\": \"<string>\",\n \"warn_percent\": 123,\n \"base_branch\": \"<string>\",\n \"baseline_release\": \"<string>\",\n \"baseline_build\": \"<string>\"\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.apsio.io/v1/projects/{projectId}/checks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"app_id\": \"<string>\",\n \"release\": \"<string>\",\n \"binary_bytes\": 123,\n \"install_bytes\": 123,\n \"build\": \"<string>\",\n \"commit_sha\": \"9b311d2\",\n \"branch\": \"<string>\",\n \"warn_percent\": 123,\n \"base_branch\": \"<string>\",\n \"baseline_release\": \"<string>\",\n \"baseline_build\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/projects/{projectId}/checks")
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 \"app_id\": \"<string>\",\n \"release\": \"<string>\",\n \"binary_bytes\": 123,\n \"install_bytes\": 123,\n \"build\": \"<string>\",\n \"commit_sha\": \"9b311d2\",\n \"branch\": \"<string>\",\n \"warn_percent\": 123,\n \"base_branch\": \"<string>\",\n \"baseline_release\": \"<string>\",\n \"baseline_build\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"release": "4.12.0",
"build": "<string>",
"commit_sha": "<string>",
"branch": "<string>",
"binary_bytes": 123,
"install_bytes": 123,
"created_at": "<string>",
"app_id": "<string>",
"format": "ipa",
"warn_percent": 123,
"baseline": {
"id": "<string>",
"release": "4.12.0",
"build": "<string>",
"commit_sha": "<string>",
"branch": "<string>",
"binary_bytes": 123,
"install_bytes": 123,
"created_at": "<string>"
},
"change": {
"binary_bytes": 123,
"binary_percent": 123,
"install_bytes": 123,
"install_percent": 123,
"warning": true
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization"
}
}Authorizations
Path Parameters
Body
application/json
Response
Recorded, with its comparison.
The earlier run of the same format it is compared with; null when there is none.