转到内容
stayclean
文档导航
API docsInterventions

API 参考

Interventions

Interventions

8 个端点REST / JSON

概览

使用以下路径和方法。请将示例标识符和 YOUR_API_TOKEN 替换为您有权使用的值;本页不会执行任何示例。

基础 URL

https://api.stayclean.io

身份验证

Authorization: Basic YOUR_API_TOKEN

GET/api/v1/interventions

列出作业

返回所有清洁作业。

参数

参数类型位置必填详情
pageinteger查询否页码(默认 1)。1
limitinteger查询否每页结果数(上限 100)。25
sortstring查询否按作业日期排序(asc 或 desc,默认 desc)。desc

需要 API 身份验证。

请求限制:60 / 分钟1200 / 小时4800 / 天

请求示例 · GET

cURL

curl --request 'GET' 'https://api.stayclean.io/api/v1/interventions?page=1&limit=25&sort=desc' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/interventions?page=1&limit=25&sort=desc", {
    "method": "GET",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json"
    }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/interventions?page=1&limit=25&sort=desc');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
),
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = None
request = Request("https://api.stayclean.io/api/v1/interventions?page=1&limit=25&sort=desc", data=data, headers=headers, method="GET")
with urlopen(request) as response:
    result = json.load(response)

响应示例

{
    "metadata": {
        "page": 1,
        "limit": 25,
        "total_items": 120,
        "total_pages": 5,
        "sort": "desc"
    },
    "nodes": [
        {
            "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
            "status": "pending",
            "scheduled_at": "2024-06-01T08:00:00+10:00",
            "property": {
                "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
                "name": "Villa Moana"
            },
            "is_started": false,
            "booking": {
                "id": "e9d3a5c2-04bf-4a76-9f79-8db3bfc69f8e",
                "guest": "Jane Doe"
            },
            "invoice": {
                "id": "f6a9c1f2-5d7b-4a2d-b1b2-0a7c0d61bcd1"
            },
            "live": {
                "status": "pending",
                "is_done": false,
                "is_validated": false,
                "started_at": null,
                "ended_at": null,
                "is_paid": false
            },
            "accounting": {
                "amount": null,
                "paid_at": null
            }
        }
    ]
}
POST/api/v1/interventions

Create and pay for an intervention

Schedule and pay for a cleaning in one call. For a manual cleaning, send the property, date and time. For a guest reservation, send booking_id: property settings automatically determine the cleaning window and protocol.

参数

参数类型位置必填详情
localestring查询否Label language: fr, en or es. Defaults to the company language. Customer-authored text is preserved.fr
property_idstring请求体否Required for a manual cleaning: UUID of an authorized, operational property. Do not combine with booking_id.b112986e-62a5-4f32-a801-dd3386117124
datestring请求体否Required for a manual cleaning: local YYYY-MM-DD date in the company timezone. The scheduling safety window is enforced server-side.2027-06-15
timestring请求体否Required for a manual cleaning: local HH:mm time. Invalid dates and nonexistent local times are rejected.10:00
intensityinteger请求体否Intensity from 1 to 5; defaults to 3. Determines duration and pricing. At 1, linen installations are disabled.3
provider_modestring请求体否account_default (default), own_providers or stayclean_network, limited to the modes returned by options. own_providers restricts the search to your providers; stayclean_network also opens it to the network, subject to funding.account_default
bedding_installationboolean请求体否Install bed linen; defaults to false.false
bath_linen_installationboolean请求体否Install bath linen; defaults to false.false
reasonstring请求体否Optional cleaning reason, up to 2,000 characters.
specific_instructionsstring请求体否Optional team instructions, up to 10,000 characters.
booking_idstring请求体否Alternative to a manual cleaning: guest reservation UUID. Send only booking_id and request_id; property, date, time, duration and protocol come from the calendar settings. Cannot be combined with manual parameters.d0b382b3-f9a6-4598-82ab-28e690d937b1
request_idstring请求体是Unique UUID generated by your system. Reuse it with the same JSON after a disconnect (24-hour protection). After a payment decline, retry through /{id}/payments with a new UUID.8d950b58-a802-45b4-bbb9-f3f17079a433

No prior call required. Payment is attempted immediately using the wallet then the default payment method under the account’s accounting rules. For a reservation, send only {"booking_id":"UUID","request_id":"UUID"}; an active default method is required in production. 201 confirms creation and payment; 422 PAYMENT_FAILED retains the intervention and returns its id for retry through /{id}/payments. Reuse request_id with the same JSON after a disconnect to avoid another cleaning or debit. 409 means an operation in progress or a UUID reused with different JSON.

请求限制:5 / 分钟60 / 小时250 / 天

请求示例 · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/interventions?locale=fr' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "property_id": "b112986e-62a5-4f32-a801-dd3386117124",
    "date": "2027-06-15",
    "time": "10:00",
    "intensity": 3,
    "provider_mode": "account_default",
    "bedding_installation": true,
    "request_id": "8d950b58-a802-45b4-bbb9-f3f17079a433"
}'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/interventions?locale=fr", {
    "method": "POST",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json"
    },
    "body": "{\n    \"property_id\": \"b112986e-62a5-4f32-a801-dd3386117124\",\n    \"date\": \"2027-06-15\",\n    \"time\": \"10:00\",\n    \"intensity\": 3,\n    \"provider_mode\": \"account_default\",\n    \"bedding_installation\": true,\n    \"request_id\": \"8d950b58-a802-45b4-bbb9-f3f17079a433\"\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/interventions?locale=fr');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
  2 => 'Content-Type: application/json',
),
    CURLOPT_POSTFIELDS => '{
    "property_id": "b112986e-62a5-4f32-a801-dd3386117124",
    "date": "2027-06-15",
    "time": "10:00",
    "intensity": 3,
    "provider_mode": "account_default",
    "bedding_installation": true,
    "request_id": "8d950b58-a802-45b4-bbb9-f3f17079a433"
}',
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
}
payload = json.loads("{\n    \"property_id\": \"b112986e-62a5-4f32-a801-dd3386117124\",\n    \"date\": \"2027-06-15\",\n    \"time\": \"10:00\",\n    \"intensity\": 3,\n    \"provider_mode\": \"account_default\",\n    \"bedding_installation\": true,\n    \"request_id\": \"8d950b58-a802-45b4-bbb9-f3f17079a433\"\n}")
data = json.dumps(payload).encode('utf-8')
request = Request("https://api.stayclean.io/api/v1/interventions?locale=fr", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

响应示例

{
    "success": true,
    "metadata": {
        "locale": "en",
        "generated_at": "2027-06-15T09:00:00+02:00",
        "refresh_after_ms": 9000
    },
    "intervention": {
        "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
        "type": "manual",
        "status": "pending_assignment",
        "is_sandbox": false,
        "booking": null
    },
    "progress": {
        "stage": "awaiting_assignment",
        "label": "Finding your cleaning team",
        "data": {
            "assignment": {
                "confirmed": false,
                "active_claimant_count": 0
            }
        }
    },
    "details": {
        "payment": {
            "status": "confirmed",
            "amount": "5.00",
            "currency": "EUR"
        },
        "schedule": {
            "planned_start": "2027-06-15T10:00:00+02:00",
            "timezone": "Europe/Paris"
        }
    },
    "links": {
        "status": "https://api.stayclean.io/api/v1/interventions/6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456/status"
    }
}
GET/api/v1/interventions/options

Get creation options

Get available properties and their constraints to build your cleaning booking form.

参数

参数类型位置必填详情
localestring查询否Label language: fr, en or es. Defaults to the company language. Customer-authored text is preserved.fr
property_idstring查询否Limit options to this property UUID.

Optional call: create an intervention directly when you already know its parameters. Company token required; only authorized account properties are returned. Demo and production environments are separated.

请求限制:15 / 分钟300 / 小时1500 / 天

请求示例 · GET

cURL

curl --request 'GET' 'https://api.stayclean.io/api/v1/interventions/options?locale=fr' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/interventions/options?locale=fr", {
    "method": "GET",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json"
    }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/interventions/options?locale=fr');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
),
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = None
request = Request("https://api.stayclean.io/api/v1/interventions/options?locale=fr", data=data, headers=headers, method="GET")
with urlopen(request) as response:
    result = json.load(response)

响应示例

{
    "success": true,
    "timezone": "Europe/Paris",
    "properties": [
        {
            "id": "b112986e-62a5-4f32-a801-dd3386117124",
            "name": "Villa Moana",
            "provider_modes": [
                "account_default",
                "own_providers",
                "stayclean_network"
            ],
            "scheduling": {
                "minimum_schedule_at": "2027-06-15T09:30:00+02:00",
                "window_minutes": 30,
                "window_type": "elapsed"
            }
        }
    ]
}
POST/api/v1/interventions/simulate

Simulate an intervention

Preview the cleaning date, duration and price using the same parameters as creation.

参数

参数类型位置必填详情
localestring查询否Label language: fr, en or es. Defaults to the company language. Customer-authored text is preserved.fr
property_idstring请求体否Required for a manual cleaning: UUID of an authorized, operational property. Do not combine with booking_id.b112986e-62a5-4f32-a801-dd3386117124
datestring请求体否Required for a manual cleaning: local YYYY-MM-DD date in the company timezone. The scheduling safety window is enforced server-side.2027-06-15
timestring请求体否Required for a manual cleaning: local HH:mm time. Invalid dates and nonexistent local times are rejected.10:00
intensityinteger请求体否Intensity from 1 to 5; defaults to 3. Determines duration and pricing. At 1, linen installations are disabled.3
provider_modestring请求体否account_default (default), own_providers or stayclean_network, limited to the modes returned by options. own_providers restricts the search to your providers; stayclean_network also opens it to the network, subject to funding.account_default
bedding_installationboolean请求体否Install bed linen; defaults to false.false
bath_linen_installationboolean请求体否Install bath linen; defaults to false.false
reasonstring请求体否Optional cleaning reason, up to 2,000 characters.
specific_instructionsstring请求体否Optional team instructions, up to 10,000 characters.
booking_idstring请求体否Alternative to a manual cleaning: guest reservation UUID. Send only booking_id and request_id; property, date, time, duration and protocol come from the calendar settings. Cannot be combined with manual parameters.d0b382b3-f9a6-4598-82ab-28e690d937b1

Optional simulation with no intervention, invoice or debit. Amounts are decimal strings in the stated currency, not minor units; they are recalculated on creation. 422 BOOKING_WINDOW_EXPIRED provides the earliest allowed date. 404 hides inaccessible properties or reservations.

请求限制:10 / 分钟120 / 小时500 / 天

请求示例 · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/interventions/simulate?locale=fr' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "property_id": "b112986e-62a5-4f32-a801-dd3386117124",
    "date": "2027-06-15",
    "time": "10:00",
    "intensity": 3,
    "provider_mode": "account_default",
    "bedding_installation": true
}'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/interventions/simulate?locale=fr", {
    "method": "POST",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json"
    },
    "body": "{\n    \"property_id\": \"b112986e-62a5-4f32-a801-dd3386117124\",\n    \"date\": \"2027-06-15\",\n    \"time\": \"10:00\",\n    \"intensity\": 3,\n    \"provider_mode\": \"account_default\",\n    \"bedding_installation\": true\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/interventions/simulate?locale=fr');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
  2 => 'Content-Type: application/json',
),
    CURLOPT_POSTFIELDS => '{
    "property_id": "b112986e-62a5-4f32-a801-dd3386117124",
    "date": "2027-06-15",
    "time": "10:00",
    "intensity": 3,
    "provider_mode": "account_default",
    "bedding_installation": true
}',
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
}
payload = json.loads("{\n    \"property_id\": \"b112986e-62a5-4f32-a801-dd3386117124\",\n    \"date\": \"2027-06-15\",\n    \"time\": \"10:00\",\n    \"intensity\": 3,\n    \"provider_mode\": \"account_default\",\n    \"bedding_installation\": true\n}")
data = json.dumps(payload).encode('utf-8')
request = Request("https://api.stayclean.io/api/v1/interventions/simulate?locale=fr", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

响应示例

{
    "success": true,
    "simulated": true,
    "pricing": {
        "duration_minutes": 120,
        "currency": "EUR",
        "service_amount": "100.00",
        "service_fee": "5.00",
        "initial_amount_due": "105.00",
        "billing_model": "network_prepayment"
    },
    "schedule": {
        "start_at": "2027-06-15T10:00:00+02:00",
        "end_at": "2027-06-15T12:00:00+02:00",
        "timezone": "Europe/Paris"
    }
}
GET/api/v1/interventions/{id}

Get intervention details

Sync your tools with a complete view of the intervention: property, stay, protocol, team, progress, payment and upcoming report.

参数

参数类型位置必填详情
idstring路径是UUID of the cleaning intervention to track or manage.6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456
localestring查询否Label language: fr, en or es. Defaults to the company language. Customer-authored text is preserved.fr
purgestring查询否When present, rebuilds the intervention view after access checks, without purging its report or immutable identity.1

ISO 8601 dates; decimal amounts in the stated currency; null means unknown/not applicable. Identity is cached permanently; state is cached for 5 s until service completion, confirmed departure, completed review and settled accounting, then permanently without access codes or WiFi passwords. Unconfirmed external returns keep the short cache; see metadata.cache.finalization_pending. Respect metadata.refresh_after_ms. report.id reuses the intervention ID; report.status is not_ready, preparing, available, subscription_required or not_applicable. Its URLs return 404 until available; expected_at stays null without a reliable forecast. Access is checked on every call; out-of-scope resources return 404 (except SUPER_ADMIN). Errors are JSON; respect Retry-After.

请求限制:60 / 分钟1200 / 小时4800 / 天

请求示例 · GET

cURL

curl --request 'GET' 'https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000?locale=fr&purge=1' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000?locale=fr&purge=1", {
    "method": "GET",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json"
    }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000?locale=fr&purge=1');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
),
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = None
request = Request("https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000?locale=fr&purge=1", data=data, headers=headers, method="GET")
with urlopen(request) as response:
    result = json.load(response)

响应示例

{
    "success": true,
    "metadata": {
        "schema_version": "2.0",
        "locale": "en",
        "generated_at": "2026-11-10T10:30:00+00:00",
        "refresh_after_ms": 7000,
        "cache": {
            "identity": {
                "ttl_seconds": null
            },
            "state": {
                "policy": "short_lived",
                "ttl_seconds": 5
            },
            "finalized": false,
            "finalized_at": null,
            "finalization_pending": [
                "service_not_completed",
                "departure_unconfirmed",
                "review_pending",
                "invoice_pending"
            ]
        }
    },
    "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
    "created_at": "2026-11-01T10:00:00+00:00",
    "type": "reservation",
    "origin": "manual",
    "status": "in_progress",
    "is_sandbox": false,
    "property": {
        "id": "a86a0c48-a518-47dd-a962-5392044b408b",
        "name": "Villa Moana",
        "thumbnail_url": null,
        "location": {
            "address": "12 Rue des Jardins",
            "address_line_2": "Building A",
            "postal_code": "75001",
            "city": "Paris",
            "country_code": null,
            "latitude": 48.8566,
            "longitude": 2.3522
        },
        "capacity": {
            "guests": 4,
            "bedrooms": 2,
            "bathrooms": 1
        },
        "area": {
            "indoor_square_meters": 80,
            "outdoor_square_meters": null
        },
        "access": {
            "available": true,
            "door": {
                "prefix": "#",
                "code": "1234",
                "suffix": "*"
            },
            "gate_code": "5678",
            "building_code": null,
            "residence_code": null,
            "parking_instructions": null
        },
        "wifi": {
            "ssid": "Villa Guest",
            "password": "example-password",
            "security_protocol": "wpa"
        }
    },
    "reservation": {
        "id": "cab87066-21a9-4eb9-84fd-ff75456f8a0d",
        "reference": "STAY-2027-001",
        "guest": {
            "first_name": "Jamie",
            "last_name": "River"
        },
        "guest_count": 3,
        "arrival": {
            "date": "2026-11-03",
            "local_time": "15:00"
        },
        "departure": {
            "date": "2026-11-10",
            "local_time": "10:00"
        }
    },
    "service": {
        "provider_mode": "own_providers",
        "intensity": 3,
        "reason": null,
        "specific_instructions": null,
        "pricing": {
            "quoted_service_amount": "100.00",
            "quoted_total_amount": "105.00",
            "currency": "EUR",
            "initial_service_fee_amount": "5.00"
        },
        "linen": {
            "bedding_installation": false,
            "bath_linen_installation": false,
            "sofa_bed_installation": false
        },
        "tasks": [
            {
                "id": "d386ebfd-59a6-406f-8c00-f2d6f495ebb0",
                "position": 0,
                "name": "Préparer la chambre",
                "description": "Suivre le protocole du logement.",
                "room": {
                    "type": "bedroom",
                    "name": "Chambre"
                },
                "planned_duration_minutes": 45,
                "status": "completed",
                "completed_at": "2026-11-10T10:20:00+00:00",
                "proof_required": true
            },
            {
                "id": "1f816f03-e5a9-4f53-957a-0c8e40ef0d8f",
                "position": 1,
                "name": "Nettoyer la cuisine",
                "description": "Suivre le protocole du logement.",
                "room": {
                    "type": "kitchen",
                    "name": "Cuisine"
                },
                "planned_duration_minutes": 75,
                "status": "pending",
                "completed_at": null,
                "proof_required": true
            }
        ]
    },
    "schedule": {
        "planned_start": "2026-11-10T10:30:00+01:00",
        "planned_end": "2026-11-10T12:30:00+01:00",
        "timezone": "Europe/Paris",
        "seconds_until_start": -3600,
        "initial_start": null,
        "initial_end": null,
        "planned_duration_seconds": 7200,
        "is_rescheduled": false
    },
    "execution": {
        "stage": "cleaning",
        "label": "Your cleaning is in progress.",
        "actuals": {
            "departed_at": null,
            "arrived_at": null,
            "entry_started_at": null,
            "entry_completed_at": null,
            "cleaning_started_at": "2026-11-10T10:00:00+00:00",
            "cleaning_completed_at": null,
            "exit_started_at": null,
            "exit_completed_at": null,
            "secured_at": null,
            "keys_returned_at": null,
            "left_at": null
        },
        "timing": {
            "start_delay_seconds": 1800,
            "end_overrun_seconds": null,
            "current_overrun_seconds": 0,
            "on_site_seconds": 1800
        },
        "progress": {
            "total": 2,
            "completed": 1,
            "confirmed_percent": 50,
            "elapsed_seconds": 1800,
            "planned_duration_seconds": 7200,
            "extra_on_site_seconds": 0
        }
    },
    "provider": {
        "profile": {
            "first_name": "Alex",
            "rating": null,
            "distance_km": null,
            "transports": [
                {
                    "type": "car"
                }
            ],
            "equipment": [],
            "equipment_known": false
        },
        "assignment": {
            "agents": [
                {
                    "id": "ccf10004-ab87-4990-b500-e09d7f2540b6",
                    "first_name": "Alex"
                }
            ],
            "confirmed": true,
            "awaiting_provider_approval": false,
            "has_claims": false,
            "active_claimant_count": 0,
            "estimated_agents": null
        },
        "search": null,
        "tracking": null
    },
    "quality_control": {
        "can_preview": true,
        "before": {
            "total": 1,
            "received": 1,
            "missing": 0,
            "items": [
                {
                    "id": "c7fd2c71-2478-4a0a-adf3-d4c2e82dbb07",
                    "room": "Chambre",
                    "label": "Lit",
                    "type": "photo",
                    "received": true,
                    "received_at": null,
                    "url": "https://cdn.example.test/interventions/bed-before.jpg"
                }
            ]
        },
        "after": {
            "total": 1,
            "received": 1,
            "missing": 0,
            "items": [
                {
                    "id": "c7fd2c71-2478-4a0a-adf3-d4c2e82dbb07",
                    "room": "Chambre",
                    "label": "Lit",
                    "type": "photo",
                    "received": true,
                    "received_at": null,
                    "url": "https://cdn.example.test/interventions/bed-after.jpg"
                }
            ]
        }
    },
    "post_service": {
        "departed_at": null,
        "closure_estimated_at": null,
        "keys_return_estimated_at": null,
        "returns": [],
        "laundry": {
            "required": false,
            "scheduled": false,
            "deposited_at": null,
            "destination": null
        }
    },
    "payment": {
        "status": "confirmed",
        "amount": "5.00",
        "currency": "EUR",
        "source": "none",
        "method": null
    },
    "accounting": {
        "billing_model": "client_provider",
        "collected_amount": "5.00",
        "currency": "EUR",
        "attempt_count": 0,
        "last_attempted_at": null,
        "last_succeeded_at": null,
        "has_payment_issue": false,
        "initial_service_fee_amount": "5.00",
        "initial_service_fee_collected_at": "2026-11-09T10:30:00+00:00",
        "network_service_fee_amount": null,
        "network_held_amount": "0.00",
        "network_refunded_amount": "0.00",
        "network_settled_at": null,
        "last_attempt": null
    },
    "invoice": {
        "id": "174956ea-96f6-400b-82eb-fa66ee72e7f6",
        "number": null,
        "status": "draft",
        "amount": "100.00",
        "currency": "EUR",
        "issued_at": null,
        "due_at": null
    },
    "links": {
        "self": "https://api.stayclean.io/api/v1/interventions/6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456?locale=en",
        "status": "https://api.stayclean.io/api/v1/interventions/6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456/status?locale=en",
        "payments": null,
        "update": null,
        "web": "https://app.stayclean.io/business/interventions/v2/6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456/phase?phase=cleaning",
        "report": null
    },
    "report": {
        "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
        "intervention_id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
        "status": "not_ready",
        "available": false,
        "intervention_completed_at": null,
        "ready_at": null,
        "expected_at": null,
        "links": {
            "details": "https://api.stayclean.io/api/v1/reports/6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456?locale=en",
            "summary": "https://api.stayclean.io/api/v1/reports/6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456/summary?locale=en",
            "media": "https://api.stayclean.io/api/v1/reports/6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456/media?locale=en",
            "public_embed": null
        }
    }
}
PATCH/api/v1/interventions/{id}

Update provider search mode

Open the search to StayClean providers or return to your own providers before a team is assigned.

参数

参数类型位置必填详情
idstring路径是UUID of the cleaning intervention to track or manage.6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456
localestring查询否Label language: fr, en or es. Defaults to the company language. Customer-authored text is preserved.fr
request_idstring请求体是Unique UUID generated by your system. Reuse it with the same JSON after a disconnect (24-hour protection). After a payment decline, retry through /{id}/payments with a new UUID.8d950b58-a802-45b4-bbb9-f3f17079a433
provider_modestring请求体是stayclean_network to open the network; own_providers to return to your own providers.stayclean_network

Available to owners, administrators and managers before assignment and after initial payment. The server calculates the price and funds the required reserve using the default method. Returning to private search releases the available reserve to the wallet through existing accounting. 403 for insufficient permissions; 409 when a team is already assigned; 422 when network lead time is insufficient or funding fails.

请求限制:5 / 分钟60 / 小时250 / 天

请求示例 · PATCH

cURL

curl --request 'PATCH' 'https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000?locale=fr' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "request_id": "931063be-594e-48af-9625-4315eb78c2be",
    "provider_mode": "stayclean_network"
}'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000?locale=fr", {
    "method": "PATCH",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json"
    },
    "body": "{\n    \"request_id\": \"931063be-594e-48af-9625-4315eb78c2be\",\n    \"provider_mode\": \"stayclean_network\"\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000?locale=fr');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
  2 => 'Content-Type: application/json',
),
    CURLOPT_POSTFIELDS => '{
    "request_id": "931063be-594e-48af-9625-4315eb78c2be",
    "provider_mode": "stayclean_network"
}',
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
}
payload = json.loads("{\n    \"request_id\": \"931063be-594e-48af-9625-4315eb78c2be\",\n    \"provider_mode\": \"stayclean_network\"\n}")
data = json.dumps(payload).encode('utf-8')
request = Request("https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000?locale=fr", data=data, headers=headers, method="PATCH")
with urlopen(request) as response:
    result = json.load(response)

响应示例

{
    "success": true,
    "metadata": {
        "locale": "en",
        "generated_at": "2027-06-15T09:00:00+02:00",
        "refresh_after_ms": 9000
    },
    "intervention": {
        "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
        "type": "manual",
        "status": "pending_assignment",
        "is_sandbox": false,
        "booking": null
    },
    "progress": {
        "stage": "awaiting_assignment",
        "label": "Finding your cleaning team",
        "data": {
            "assignment": {
                "confirmed": false,
                "active_claimant_count": 0
            }
        }
    },
    "details": {
        "payment": {
            "status": "confirmed",
            "amount": "5.00",
            "currency": "EUR"
        },
        "schedule": {
            "planned_start": "2027-06-15T10:00:00+02:00",
            "timezone": "Europe/Paris"
        }
    },
    "links": {
        "status": "https://api.stayclean.io/api/v1/interventions/6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456/status"
    }
}
POST/api/v1/interventions/{id}/payments

Retry a payment

Retry payment for an existing intervention after correcting the payment method, without creating another cleaning.

参数

参数类型位置必填详情
idstring路径是UUID of the cleaning intervention to track or manage.6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456
localestring查询否Label language: fr, en or es. Defaults to the company language. Customer-authored text is preserved.fr
request_idstring请求体是Unique UUID generated by your system. Reuse it with the same JSON after a disconnect (24-hour protection). After a payment decline, retry through /{id}/payments with a new UUID.8d950b58-a802-45b4-bbb9-f3f17079a433
payment_method_idstring请求体否UUID of an active company payment method returned by scheduling options. Otherwise, the default method is used when the wallet balance is insufficient.

The default method is used when payment_method_id is omitted. Send a new request_id for a new attempt after a definitive decline; replay the same UUID after a disconnect. Settled payments never create another debit. 422 PAYMENT_FAILED includes the reason and refreshed status; 422 BOOKING_WINDOW_EXPIRED means the schedule is no longer allowed. Amounts are determined by the server.

请求限制:5 / 分钟60 / 小时250 / 天

请求示例 · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000/payments?locale=fr' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "request_id": "5b4243d1-6730-453e-9e58-223c894f0b8b"
}'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000/payments?locale=fr", {
    "method": "POST",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json"
    },
    "body": "{\n    \"request_id\": \"5b4243d1-6730-453e-9e58-223c894f0b8b\"\n}"
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000/payments?locale=fr');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
  2 => 'Content-Type: application/json',
),
    CURLOPT_POSTFIELDS => '{
    "request_id": "5b4243d1-6730-453e-9e58-223c894f0b8b"
}',
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json",
    "Content-Type": "application/json"
}
payload = json.loads("{\n    \"request_id\": \"5b4243d1-6730-453e-9e58-223c894f0b8b\"\n}")
data = json.dumps(payload).encode('utf-8')
request = Request("https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000/payments?locale=fr", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

响应示例

{
    "success": true,
    "metadata": {
        "locale": "en",
        "generated_at": "2027-06-15T09:00:00+02:00",
        "refresh_after_ms": 9000
    },
    "intervention": {
        "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
        "type": "manual",
        "status": "pending_assignment",
        "is_sandbox": false,
        "booking": null
    },
    "progress": {
        "stage": "awaiting_assignment",
        "label": "Finding your cleaning team",
        "data": {
            "assignment": {
                "confirmed": false,
                "active_claimant_count": 0
            }
        }
    },
    "details": {
        "payment": {
            "status": "confirmed",
            "amount": "5.00",
            "currency": "EUR"
        },
        "schedule": {
            "planned_start": "2027-06-15T10:00:00+02:00",
            "timezone": "Europe/Paris"
        }
    },
    "links": {
        "status": "https://api.stayclean.io/api/v1/interventions/6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456/status"
    },
    "operation": {
        "success": true,
        "attempt": 1,
        "error_code": null
    }
}
GET/api/v1/interventions/{id}/status

Get intervention status

Track payment, assignment, travel and cleaning with the relevant information at each stage.

参数

参数类型位置必填详情
idstring路径是UUID of the cleaning intervention to track or manage.6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456
localestring查询否Label language: fr, en or es. Defaults to the company language. Customer-authored text is preserved.fr

Fresh status with no response cache: respect metadata.refresh_after_ms and Retry-After on 429. intervention.status is awaiting_payment, pending_assignment, scheduled, in_progress, completed, canceled or declined; progress.stage identifies the detailed stage. details contains scheduling, payment, accounting, tasks and evidence allowed by your subscription. 404 for an inaccessible intervention; SUPER_ADMIN may read across companies.

请求限制:60 / 分钟3600 / 小时20000 / 天

请求示例 · GET

cURL

curl --request 'GET' 'https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000/status?locale=fr' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000/status?locale=fr", {
    "method": "GET",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json"
    }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();

PHP

<?php
$curl = curl_init('https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000/status?locale=fr');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
),
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
curl_close($curl);
$data = json_decode($response, true, 512, JSON_THROW_ON_ERROR);

PYTHON

import json
from urllib.request import Request, urlopen

headers = {
    "Authorization": "Basic YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = None
request = Request("https://api.stayclean.io/api/v1/interventions/00000000-0000-4000-8000-000000000000/status?locale=fr", data=data, headers=headers, method="GET")
with urlopen(request) as response:
    result = json.load(response)

响应示例

{
    "success": true,
    "metadata": {
        "locale": "en",
        "generated_at": "2027-06-15T09:00:00+02:00",
        "refresh_after_ms": 9000
    },
    "intervention": {
        "id": "6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456",
        "type": "manual",
        "status": "pending_assignment",
        "is_sandbox": false,
        "booking": null
    },
    "progress": {
        "stage": "awaiting_assignment",
        "label": "Finding your cleaning team",
        "data": {
            "assignment": {
                "confirmed": false,
                "active_claimant_count": 0
            }
        }
    },
    "details": {
        "payment": {
            "status": "confirmed",
            "amount": "5.00",
            "currency": "EUR"
        },
        "schedule": {
            "planned_start": "2027-06-15T10:00:00+02:00",
            "timezone": "Europe/Paris"
        }
    },
    "links": {
        "status": "https://api.stayclean.io/api/v1/interventions/6dfc7a2e-8f9a-4a0f-9bd0-3f5a7d123456/status"
    }
}