Zum Inhalt springen

API-Dokumentation

Mit der fastry API legst du Monitore an, markierst Deployments und liest deine Rankings – zum Beispiel aus deiner CI-Pipeline. Die API gibt es im Tarif Agency.

Anmeldung

Erstelle einen API-Key unter Einstellungen → API und wähle dort seine Rechte. Sende ihn bei jeder Anfrage mit:

Authorization: Bearer fry_…

Ohne gültigen API-Key antwortet die API mit 401, fehlt ein Recht mit 403. Fehler kommen als JSON mit dem Feld error.

Seitenweise abrufen

Listen liefern data und meta (page, per_page, total, total_pages). Mit ?page=2&per_page=50 holst du die nächste Seite; per_page ist standardmäßig 100, höchstens 200.

Beispiel: Deployment aus der CI melden

curl -X POST https://staging.fastry.com/api/v1/deployments \
  -H "Authorization: Bearer $FASTRY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://shop.example.com", "commit": "a1b2c3d"}'

Endpunkte

POST /api/v1/deployments Recht: Deployments melden

Mark deployment

Sets a marker on all monitors of the URL(s). A plain domain (without path) matches all monitors of this domain. About 2 minutes later fastry measures every monitor with performance tracking again (default; can be switched off per monitor or with `scan: false`; `scan: true` also measures switched-off monitors). Several deploys in quick succession result in one measurement; it doesn't count towards the scans per day. 404 if no URL matches a monitor.

Felder: author (string) branch (string) commit (string) commit_url (string) deployed_at (string) environment (string) message (string) scan (boolean) url (string) urls (array)

GET /api/v1/monitors Recht: Monitore lesen

List monitors

page
Page, from 1 (default 1)
per_page
Entries per page (default 100, at most 200)
POST /api/v1/monitors Recht: Monitore erstellen & ändern

Create monitor

Felder: monitor.basic_auth (object | null) monitor.check_type (string) monitor.expected_content_type (string) monitor.expected_status_codes (object) monitor.field_rules (array) monitor.follow_redirects (boolean) monitor.host (string) monitor.http_method (string) monitor.interval_seconds (integer) monitor.json_schema (object | null) monitor.keyword (string) monitor.keyword_case_sensitive (boolean) monitor.keyword_mode (string) monitor.max_response_ms (integer) monitor.name (string) monitor.packet_count (integer) monitor.packet_loss_threshold (integer) monitor.paused (boolean) monitor.port (integer) monitor.port_expect (string) monitor.psi_device (string) monitor.psi_enabled (boolean) monitor.request_body (string) monitor.request_content_type (string) monitor.request_headers (object | null) monitor.timeout_seconds (integer) monitor.udp_payload (string) monitor.udp_payload_template (string) monitor.url (string)

GET /api/v1/monitors/{id} Recht: Monitore lesen

Read a monitor

id
ID of the monitor
PATCH /api/v1/monitors/{id} Recht: Monitore erstellen & ändern

Change monitor

id
ID of the monitor

Felder: monitor.basic_auth (object | null) monitor.check_type (string) monitor.expected_content_type (string) monitor.expected_status_codes (object) monitor.field_rules (array) monitor.follow_redirects (boolean) monitor.host (string) monitor.http_method (string) monitor.interval_seconds (integer) monitor.json_schema (object | null) monitor.keyword (string) monitor.keyword_case_sensitive (boolean) monitor.keyword_mode (string) monitor.max_response_ms (integer) monitor.name (string) monitor.packet_count (integer) monitor.packet_loss_threshold (integer) monitor.paused (boolean) monitor.port (integer) monitor.port_expect (string) monitor.psi_device (string) monitor.psi_enabled (boolean) monitor.request_body (string) monitor.request_content_type (string) monitor.request_headers (object | null) monitor.timeout_seconds (integer) monitor.udp_payload (string) monitor.udp_payload_template (string) monitor.url (string)

PUT /api/v1/monitors/{id} Recht: Monitore erstellen & ändern

Change monitor (like PATCH)

id
ID of the monitor

Felder: monitor.basic_auth (object | null) monitor.check_type (string) monitor.expected_content_type (string) monitor.expected_status_codes (object) monitor.field_rules (array) monitor.follow_redirects (boolean) monitor.host (string) monitor.http_method (string) monitor.interval_seconds (integer) monitor.json_schema (object | null) monitor.keyword (string) monitor.keyword_case_sensitive (boolean) monitor.keyword_mode (string) monitor.max_response_ms (integer) monitor.name (string) monitor.packet_count (integer) monitor.packet_loss_threshold (integer) monitor.paused (boolean) monitor.port (integer) monitor.port_expect (string) monitor.psi_device (string) monitor.psi_enabled (boolean) monitor.request_body (string) monitor.request_content_type (string) monitor.request_headers (object | null) monitor.timeout_seconds (integer) monitor.udp_payload (string) monitor.udp_payload_template (string) monitor.url (string)

DELETE /api/v1/monitors/{id} Recht: Monitore erstellen & ändern

Delete monitor

id
ID of the monitor
POST /api/v1/monitors/{id}/check Recht: Monitore erstellen & ändern

Check immediately

id
ID of the monitor
GET /api/v1/rankings Recht: Rankings lesen

Read current rankings

page
Page, from 1 (default 1)
per_page
Entries per page (default 100, at most 200)

Maschinenlesbar als OpenAPI: /api/v1/openapi.json