REST API & Webhook
Zadix をあらゆるツールに接続
Zadix はスコープ付き REST API とアウトバウンド Webhook システムを公開しています。API キーを使用して ERP、Zapier、カスタムスクリプトからのサーバー間クエリと書き込みを行います。Webhook を使用してサービスイベントがライフサイクルを進行する際にリアルタイムのプッシュ通知を受信できます — ポーリングは不要です。
Overview
2つの接続方法
両方ともダッシュボードのサイドバーにある連携ページから設定できます。連携の作成と管理ができるのは会社のオーナーと管理者のみです。
API Keys
長期的なスコープ付きベアラートークンでサーバー間リクエストを認証します。データの取得、レコードの作成、コンプライアンスステータスのプログラムによるクエリが可能です。
Webhook
サービスイベントのステータス変更時に JSON ペイロードを受信する HTTPS エンドポイントを登録します。署名によりなりすまし配信を防止します。
https://api.zadixflow.comGetting Started
guide_integrations_content.auth_title
guide_integrations_content.auth_intro
Authorization: Bearer zfx_live_your_key_here
A missing or invalid key returns 401 Unauthorized. A valid key requesting an endpoint outside its scopes returns 403 Forbidden with a message identifying the missing scope.
{
"data": null,
"meta": { "requestId": "req_7mKpQ3" },
"errors": [{ "code": "UNAUTHORIZED", "message": "Invalid or revoked API key" }]
}Getting Started
guide_integrations_content.api_keys_title
guide_integrations_content.api_keys_intro
Getting Started
guide_integrations_content.scopes_title
guide_integrations_content.scopes_intro
service_events:readList and retrieve service events, audit logs
service_events:writeCreate, update, and confirm service events
equipment:readList and retrieve equipment assets, history, compliance status
equipment:writeCreate and update equipment assets
jobs:readList and retrieve field jobs
jobs:writeCreate, update, and complete jobs
compliance:readCompliance dashboard, flags, overdue equipment, active rules
reports:readGenerate and download PDF exports, annual reports, refrigerant balance
POST /service-events/:id/finalize is intentionally excluded from API key access. Finalization is a legally significant act under EU 2024/573 and must be performed by an authenticated human.Getting Started
guide_integrations_content.requests_title
guide_integrations_content.requests_intro
curl https://api.zadixflow.com/service-events \ -H "Authorization: Bearer zfx_live_your_key_here" \ -H "Accept: application/json"
import axios from 'axios'
const api = axios.create({
baseURL: 'https://api.zadixflow.com',
headers: { Authorization: `Bearer ${process.env.ZADIX_API_KEY}` },
})
const { data } = await api.get('/service-events', {
params: { page: 1, limit: 20, status: 'validated' },
})
console.log(data.data) // array of service events
console.log(data.meta) // { page, limit, total, requestId }{
"data": { ... }, // null on error; object or array on success
"meta": {
"page": 1, // present on paginated responses
"limit": 20,
"total": 143,
"requestId": "req_7mKpQ3"
},
"errors": [] // non-empty array on failure
}Getting Started
guide_integrations_content.errors_title
guide_integrations_content.errors_intro
| Status | Name | When it occurs |
|---|---|---|
| 400 | Bad Request | Malformed JSON or invalid field values in the request body |
| 401 | Unauthorized | Missing, invalid, or revoked API key |
| 403 | Forbidden | Valid key but insufficient scope for this endpoint |
| 404 | Not Found | Resource does not exist or belongs to a different company |
| 422 | Unprocessable Entity | Validation failed — response includes per-field error details |
| 429 | Too Many Requests | Rate limit exceeded — back off and retry after 60 seconds |
| 500 | Internal Server Error | Unexpected server error — contact support with the requestId |
{
"data": null,
"meta": { "requestId": "req_xPq2R1" },
"errors": [
{ "code": "VALIDATION_ERROR", "field": "refrigerant_type", "message": "refrigerant_type is required" },
{ "code": "VALIDATION_ERROR", "field": "quantity_added_kg", "message": "must be a positive number" }
]
}Getting Started
guide_integrations_content.pagination_title
guide_integrations_content.pagination_intro
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number, 1-indexed |
limit | integer | 20 | Items per page. Maximum: 100 |
curl "https://api.zadixflow.com/service-events?page=2&limit=50" \ -H "Authorization: Bearer zfx_live_your_key_here"
{
"data": [ ... ],
"meta": {
"page": 2,
"limit": 50,
"total": 143, // total items across all pages
"requestId": "req_5nXpA7"
},
"errors": []
}
// total pages = Math.ceil(143 / 50) = 3Getting Started
guide_integrations_content.rate_limits_title
guide_integrations_content.rate_limits_intro
| Limit | Window | Scope |
|---|---|---|
| 20 requests | 60 seconds | Per API key |
{
"data": null,
"meta": { "requestId": "req_aB3cD4" },
"errors": [{ "code": "RATE_LIMITED", "message": "Too many requests. Retry after 60 seconds." }]
}POST /service-events with a complete payload is more efficient than multiple sequential PATCH calls.API Reference
guide_integrations_content.se_title
guide_integrations_content.se_intro
/service-eventsList service events (paginated, filterable)service_events:read/service-eventsCreate a new service eventservice_events:write/service-events/:idGet a single service event with full detailservice_events:read/service-events/:idUpdate fields on a draft or confirmed eventservice_events:write/service-events/:id/confirmMark AI-extracted data as confirmedservice_events:writeサービスイベント一覧
curl "https://api.zadixflow.com/service-events?page=1&limit=20&status=validated" \ -H "Authorization: Bearer zfx_live_your_key_here"
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"lifecycle_status": "validated",
"compliance_status": "valid",
"action_type": "refill",
"refrigerant_type": "R-410A",
"quantity_added_kg": 1.5,
"event_timestamp": "2026-04-03T14:23:00.000Z",
"equipment_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"technician_id": "c3d4e5f6-a7b8-9012-cdef-012345678902",
"job_id": "d4e5f6a7-b8c9-0123-defa-012345678903",
"company_id": "e5f6a7b8-c9d0-1234-efab-012345678904",
"created_at": "2026-04-03T14:20:00.000Z"
}
],
"meta": { "page": 1, "limit": 20, "total": 143, "requestId": "req_7mKpQ3" },
"errors": []
}サービスイベントの作成
curl -X POST https://api.zadixflow.com/service-events \
-H "Authorization: Bearer zfx_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"job_id": "d4e5f6a7-b8c9-0123-defa-012345678903",
"equipment_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"action_type": "refill",
"refrigerant_type": "R-410A",
"quantity_added_kg": 1.5,
"refrigerant_source": "virgin",
"technician_fgas_cert": "EU-IT-2024-00789",
"event_timestamp": "2026-04-03T14:23:00.000Z"
}'GET /service-events のクエリフィルター
| Filter | Accepted values | Example |
|---|---|---|
status | draft · ai_extracted · confirmed · validated · finalized | ?status=finalized |
compliance_status | valid · incomplete · risky · non_compliant | ?compliance_status=non_compliant |
action_type | refill · recovery · leak_check · installation · decommission | ?action_type=refill |
equipment_id | UUID | ?equipment_id=b2c3d4e5-... |
technician_id | UUID | ?technician_id=c3d4e5f6-... |
date_from / date_to | ISO 8601 date | ?date_from=2026-01-01 |
API Reference
guide_integrations_content.eq_title
guide_integrations_content.eq_intro
/equipmentList all equipment assetsequipment:read/equipmentRegister a new equipment assetequipment:write/equipment/:idGet equipment with full compliance historyequipment:read/equipment/:idUpdate equipment detailsequipment:writecurl https://api.zadixflow.com/equipment/b2c3d4e5-f6a7-8901-bcde-f12345678901 \ -H "Authorization: Bearer zfx_live_your_key_here"
{
"data": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "Rooftop Unit #3",
"serial_number": "RTU-2024-0033",
"refrigerant_type": "R-410A",
"refrigerant_capacity_kg": 12.5,
"gwp": 2088,
"co2_equivalent_tonnes": 26.1,
"location": "Building A, Roof",
"compliance_status": "valid",
"next_leak_check_due": "2026-10-01",
"installation_date": "2024-03-15",
"company_id": "e5f6a7b8-c9d0-1234-efab-012345678904"
},
"meta": { "requestId": "req_bC4dE5" },
"errors": []
}co2_equivalent_tonnes and the date of the last leak check service event. Equipment above 500 t CO₂e requires a check every 3 months; 50–500 t every 6 months; 5–50 t every 12 months.API Reference
guide_integrations_content.jobs_title
guide_integrations_content.jobs_intro
/jobsList all jobsjobs:read/jobsCreate a new jobjobs:write/jobs/:idGet job with linked technicians and equipmentjobs:read/jobs/:idUpdate job details or statusjobs:writecurl -X POST https://api.zadixflow.com/jobs \
-H "Authorization: Bearer zfx_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"title": "Quarterly maintenance — Building A",
"scheduled_date": "2026-04-10",
"technician_ids": ["c3d4e5f6-a7b8-9012-cdef-012345678902"],
"equipment_ids": [
"b2c3d4e5-f6a7-8901-bcde-f12345678901",
"c3d4e5f6-a7b8-9012-cdef-012345678902"
]
}'API Reference
guide_integrations_content.compliance_title
guide_integrations_content.compliance_intro
/compliance/dashboardSummary stats: flag counts, compliance rate, risk scorecompliance:read/compliance/overdueEquipment with overdue leak checks (paginated)compliance:read/compliance/flagsActive compliance violation flags (paginated)compliance:read/compliance/rulesConfigured F-Gas checks and their severitycompliance:read{
"data": {
"total_events": 247,
"flagged_events": 4,
"compliance_rate": 0.984,
"overdue_equipment_count": 2,
"open_flags": { "error": 1, "warning": 3 },
"risk_score": "low"
},
"meta": { "requestId": "req_cD5eF6" },
"errors": []
}API Reference
guide_integrations_content.reports_title
guide_integrations_content.reports_intro
/reports/service-events/:id/generateTrigger async PDF report generationreports:read/reports/service-events/:id/exportsList all generated PDF exports for an eventreports:read/reports/exports/:pdfId/downloadGet a pre-signed S3 URL (1 hour) to download the PDFreports:read{
"data": {
"download_url": "https://s3.eu-west-1.amazonaws.com/zadix-reports/...",
"expires_at": "2026-04-03T15:23:00.000Z",
"filename": "service-event-a1b2c3d4-report.pdf",
"generated_at": "2026-04-03T14:21:30.000Z"
},
"meta": { "requestId": "req_dE6fG7" },
"errors": []
}Webhooks
guide_integrations_content.webhooks_setup_title
guide_integrations_content.webhooks_setup_intro
Toggle any endpoint on or off without deleting it. The delivery log per endpoint shows every attempted delivery — HTTP status code, attempt count, response time — with a manual retry button for failed deliveries.
Webhooks
guide_integrations_content.webhook_events_title
guide_integrations_content.webhook_events_intro
サービスイベントのライフサイクル — 各 ↓ 遷移時に Webhook が発火
service_event.createdA technician creates a new field service event.
Full service event object at creation state — lifecycle_status: draft.
service_event.confirmedThe technician reviews and confirms AI-extracted data is accurate.
Service event with lifecycle_status: confirmed and extracted field values.
service_event.validatedOffice staff validates the event against all compliance rules.
Service event with compliance_status set and any compliance flags attached.
service_event.finalizedOwner permanently seals the record — no further edits are possible.
Includes record_hash (SHA-256) for tamper-proof audit trail verification.
Webhooks
guide_integrations_content.payload_title
guide_integrations_content.payload_intro
{
"id": "evt_a1b2c3d4e5f6a7b8c9d0",
"event": "service_event.finalized",
"created_at": "2026-04-03T14:23:00.000Z",
"company_id": "e5f6a7b8-c9d0-1234-efab-012345678904",
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"lifecycle_status": "finalized",
"compliance_status": "valid",
"action_type": "refill",
"refrigerant_type": "R-410A",
"quantity_added_kg": 1.5,
"event_timestamp": "2026-04-03T14:00:00.000Z",
"technician_id": "c3d4e5f6-a7b8-9012-cdef-012345678902",
"equipment_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"record_hash": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0...",
"finalized_at": "2026-04-03T14:23:00.000Z"
}
}すべての配信で送信されるリクエストヘッダー
| Header | Example value | Description |
|---|---|---|
x-zadix-signature | sha256=9f86d081... | HMAC-SHA256 of the raw request body bytes, signed with your endpoint secret |
x-zadix-event | service_event.finalized | The event type that triggered this delivery |
x-zadix-delivery | evt_a1b2c3d4e5f6... | Unique delivery ID — use for idempotency and support lookups |
Content-Type | application/json | Always JSON |
Webhooks
guide_integrations_content.signatures_title
guide_integrations_content.signatures_intro
Node.js / Express
const crypto = require('crypto');
function verifySignature(secret, rawBody, signatureHeader) {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(rawBody) // rawBody is a Buffer from express.raw()
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signatureHeader),
Buffer.from(expected),
);
}
// Use express.raw() so req.body is the raw Buffer, not parsed JSON
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
const sig = req.headers['x-zadix-signature'];
if (!sig || !verifySignature(process.env.WEBHOOK_SECRET, req.body, sig)) {
return res.status(401).send('Invalid signature');
}
const event = JSON.parse(req.body);
// Use event.id to deduplicate retries
console.log(event.event, event.data.id);
res.status(200).send('ok');
});Python / Flask
import hmac, hashlib, os
from flask import Flask, request
app = Flask(__name__)
def verify_signature(secret: str, raw_body: bytes, signature_header: str) -> bool:
expected = 'sha256=' + hmac.new(
secret.encode(), raw_body, hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature_header)
@app.route('/webhook', methods=['POST'])
def webhook():
sig = request.headers.get('x-zadix-signature', '')
# request.data is the raw body bytes — do not use request.json here
if not verify_signature(os.environ['WEBHOOK_SECRET'], request.data, sig):
return 'Invalid signature', 401
event = request.json
print(event['event'], event['data']['id'])
return 'ok', 200PHP
<?php
function verifySignature(string $secret, string $rawBody, string $sigHeader): bool {
$expected = 'sha256=' . hash_hmac('sha256', $rawBody, $secret);
return hash_equals($expected, $sigHeader); // timing-safe comparison
}
$rawBody = file_get_contents('php://input'); // raw bytes before json_decode
$sig = $_SERVER['HTTP_X_ZADIX_SIGNATURE'] ?? '';
if (!verifySignature(getenv('WEBHOOK_SECRET'), $rawBody, $sig)) {
http_response_code(401);
exit('Invalid signature');
}
$event = json_decode($rawBody, true);
error_log($event['event'] . ' ' . $event['data']['id']);
http_response_code(200);crypto.timingSafeEqual (Node.js), hmac.compare_digest (Python), or hash_equals (PHP). A naive === string comparison leaks timing information that can be exploited to forge signatures.Webhooks
guide_integrations_content.retries_title
guide_integrations_content.retries_intro
Retry schedule
A 2xx response on any attempt marks the delivery as successful and stops all further retries.
Failed deliveries remain visible in the delivery log per endpoint in the dashboard. You can manually trigger a retry for any failed delivery at any time — failed deliveries do not expire.
id field (e.g. evt_a1b2c3d4e5f6) in the payload to deduplicate — if you have already processed a delivery with that ID, return 200 without reprocessing.