Deploys endpoint
Query deployment statistics
POST
/
api
/
v2
/
deploys
/
stats
Query deployment statistics
curl --request POST \
--url https://appsignal.com/api/v2/deploys/stats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"site_id": "6591f2705fa150d75339e232",
"revision": "abc-123",
"namespace": "web"
}
'import requests
url = "https://appsignal.com/api/v2/deploys/stats"
payload = {
"site_id": "6591f2705fa150d75339e232",
"revision": "abc-123",
"namespace": "web"
}
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({site_id: '6591f2705fa150d75339e232', revision: 'abc-123', namespace: 'web'})
};
fetch('https://appsignal.com/api/v2/deploys/stats', 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://appsignal.com/api/v2/deploys/stats",
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([
'site_id' => '6591f2705fa150d75339e232',
'revision' => 'abc-123',
'namespace' => 'web'
]),
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://appsignal.com/api/v2/deploys/stats"
payload := strings.NewReader("{\n \"site_id\": \"6591f2705fa150d75339e232\",\n \"revision\": \"abc-123\",\n \"namespace\": \"web\"\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://appsignal.com/api/v2/deploys/stats")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"site_id\": \"6591f2705fa150d75339e232\",\n \"revision\": \"abc-123\",\n \"namespace\": \"web\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/deploys/stats")
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 \"site_id\": \"6591f2705fa150d75339e232\",\n \"revision\": \"abc-123\",\n \"namespace\": \"web\"\n}"
response = http.request(request)
puts response.read_body{
"throughput": 1001,
"mean": 1.95,
"error_rate": 1.05
}{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}For authentication and error responses, see the Public API (V2) overview.
Authorizations
bearer_authtoken_query
Authorization: Bearer <token>
Body
application/json
Query for the aggregated metrics of one deployment revision, over all retained data.
Response
Statistics for the revision, zero when nothing was recorded.
Aggregated metrics for one deployment. Without recorded samples, throughput is the
error count, error_rate 100 (0 without errors) and mean 0.
Was this page helpful?
⌘I
Query deployment statistics
curl --request POST \
--url https://appsignal.com/api/v2/deploys/stats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"site_id": "6591f2705fa150d75339e232",
"revision": "abc-123",
"namespace": "web"
}
'import requests
url = "https://appsignal.com/api/v2/deploys/stats"
payload = {
"site_id": "6591f2705fa150d75339e232",
"revision": "abc-123",
"namespace": "web"
}
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({site_id: '6591f2705fa150d75339e232', revision: 'abc-123', namespace: 'web'})
};
fetch('https://appsignal.com/api/v2/deploys/stats', 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://appsignal.com/api/v2/deploys/stats",
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([
'site_id' => '6591f2705fa150d75339e232',
'revision' => 'abc-123',
'namespace' => 'web'
]),
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://appsignal.com/api/v2/deploys/stats"
payload := strings.NewReader("{\n \"site_id\": \"6591f2705fa150d75339e232\",\n \"revision\": \"abc-123\",\n \"namespace\": \"web\"\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://appsignal.com/api/v2/deploys/stats")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"site_id\": \"6591f2705fa150d75339e232\",\n \"revision\": \"abc-123\",\n \"namespace\": \"web\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/deploys/stats")
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 \"site_id\": \"6591f2705fa150d75339e232\",\n \"revision\": \"abc-123\",\n \"namespace\": \"web\"\n}"
response = http.request(request)
puts response.read_body{
"throughput": 1001,
"mean": 1.95,
"error_rate": 1.05
}{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}