Go to content
stayclean
Documentation navigation
API docsSmartlocker

API reference

Smartlocker

Codes · Door

7 endpointsREST / JSON

Overview

Use the paths and methods below. Replace example identifiers and YOUR_API_TOKEN with your own authorized values; examples are never executed by this page.

GET/api/v1/properties/{id}/smartlocker/codes

List smartlocker codes for a property

Returns all configured codes with their synchronization status.

Parameters

ParameterTypeLocationRequiredDetails
idstringPathYesRequired path parameter.

Limited to 10 requests per minute, 100 per hour and 500 per day.

Path parameters: {id} (property UUID).

Request limits:10 / minute100 / hour500 / day

Request example · GET

cURL

curl --request 'GET' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes", {
    "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/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes');
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/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes", data=data, headers=headers, method="GET")
with urlopen(request) as response:
    result = json.load(response)

Response example

{
    "property_id": "uuid",
    "definitions": [
        {
            "identifier": "vendor",
            "label": "Code prestataire",
            "description": "Code utilisé par l’équipe de nettoyage."
        }
    ],
    "codes": [
        {
            "identifier": "vendor",
            "label": "Code prestataire",
            "description": "Code utilisé par l’équipe de nettoyage.",
            "code": 123456,
            "code_formatted": "123456",
            "configured": true,
            "synced": true
        }
    ]
}
POST/api/v1/properties/{id}/smartlocker/codes

Create a smartlocker code

Adds a new code for a given identifier and syncs it with the lock.

Parameters

ParameterTypeLocationRequiredDetails
idstringPathYesRequired path parameter.
identifierstringBodyYesConfigured code identifier for the property.vendor
modestringBodyNoCode generation mode: random or manual.manual
codestringBodyNoRequired in manual mode: 4 to 10 digits between 1 and 7, sent as a string.123456
labelstringBodyNoOptional label for the access code.Cleaning access

Limited to 10 requests per minute, 100 per hour and 500 per day.

Path parameters: {id} (property UUID).

Expected payload: identifier (string), mode ("random"|"manual"), code (string, required when mode = manual), label (optional string).

Request limits:10 / minute100 / hour500 / day

Request example · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "identifier": "vendor",
    "mode": "manual",
    "code": "123456",
    "label": "Code ménage"
}'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes", {
    "method": "POST",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json"
    },
    "body": "{\n    \"identifier\": \"vendor\",\n    \"mode\": \"manual\",\n    \"code\": \"123456\",\n    \"label\": \"Code ménage\"\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/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes');
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 => '{
    "identifier": "vendor",
    "mode": "manual",
    "code": "123456",
    "label": "Code ménage"
}',
]);
$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    \"identifier\": \"vendor\",\n    \"mode\": \"manual\",\n    \"code\": \"123456\",\n    \"label\": \"Code ménage\"\n}")
data = json.dumps(payload).encode('utf-8')
request = Request("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

Response example

{
    "success": true,
    "entry": {
        "identifier": "vendor",
        "label": "Code ménage",
        "code": 123456,
        "configured": true,
        "synced": true
    },
    "codes": []
}
DELETE/api/v1/properties/{id}/smartlocker/codes/{identifier}

Delete a smartlocker code

Removes a code from the property and deletes it from the smartlock.

Parameters

ParameterTypeLocationRequiredDetails
idstringPathYesRequired path parameter.
identifierstringPathYesRequired path parameter.

Limited to 10 requests per minute, 100 per hour and 500 per day.

Path parameters: {id} (property UUID), {identifier} (code identifier).

Request limits:10 / minute100 / hour500 / day

Request example · DELETE

cURL

curl --request 'DELETE' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id", {
    "method": "DELETE",
    "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/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    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/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id", data=data, headers=headers, method="DELETE")
with urlopen(request) as response:
    result = json.load(response)

Response example

{
    "success": true,
    "codes": []
}
PUTPATCH/api/v1/properties/{id}/smartlocker/codes/{identifier}

Update a smartlocker code

Updates the label or value of an existing code and syncs the lock.

Parameters

ParameterTypeLocationRequiredDetails
idstringPathYesRequired path parameter.
identifierstringPathYesRequired path parameter.
modestringBodyNoCode generation mode: random or manual.manual
codestringBodyNoRequired in manual mode: 4 to 10 digits between 1 and 7, sent as a string.123456
labelstringBodyNoOptional label for the access code.Cleaning access

Limited to 10 requests per minute, 100 per hour and 500 per day.

Path parameters: {id} (property UUID), {identifier} (code identifier).

Expected payload: mode ("random"|"manual"), code (string, required when mode = manual), label (optional string).

Request limits:10 / minute100 / hour500 / day

Request example · PUT

cURL

curl --request 'PUT' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "mode": "manual",
    "code": "654321",
    "label": "Code ménage (soir)"
}'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id", {
    "method": "PUT",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json"
    },
    "body": "{\n    \"mode\": \"manual\",\n    \"code\": \"654321\",\n    \"label\": \"Code ménage (soir)\"\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/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array (
  0 => 'Authorization: Basic YOUR_API_TOKEN',
  1 => 'Accept: application/json',
  2 => 'Content-Type: application/json',
),
    CURLOPT_POSTFIELDS => '{
    "mode": "manual",
    "code": "654321",
    "label": "Code ménage (soir)"
}',
]);
$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    \"mode\": \"manual\",\n    \"code\": \"654321\",\n    \"label\": \"Code ménage (soir)\"\n}")
data = json.dumps(payload).encode('utf-8')
request = Request("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id", data=data, headers=headers, method="PUT")
with urlopen(request) as response:
    result = json.load(response)

Response example

{
    "success": true,
    "entry": {
        "identifier": "vendor",
        "label": "Code ménage (soir)",
        "code": 654321,
        "configured": true,
        "synced": true
    },
    "codes": []
}
POST/api/v1/properties/{id}/smartlocker/codes/{identifier}/reset

Reset a smartlocker code

Generates a new code for the targeted identifier and updates the lock.

Parameters

ParameterTypeLocationRequiredDetails
idstringPathYesRequired path parameter.
identifierstringPathYesRequired path parameter.
modestringBodyNoCode generation mode: random or manual.manual
codestringBodyNoRequired in manual mode: 4 to 10 digits between 1 and 7, sent as a string.123456
labelstringBodyNoOptional label for the access code.Cleaning access

Limited to 10 requests per minute, 100 per hour and 500 per day.

Path parameters: {id} (property UUID), {identifier} (code identifier).

Expected payload: mode ("random"|"manual"), code (string, required when mode = manual), label (optional string).

Request limits:10 / minute100 / hour500 / day

Request example · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id/reset' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "mode": "random"
}'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id/reset", {
    "method": "POST",
    "headers": {
        "Authorization": "Basic YOUR_API_TOKEN",
        "Accept": "application/json",
        "Content-Type": "application/json"
    },
    "body": "{\n    \"mode\": \"random\"\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/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id/reset');
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 => '{
    "mode": "random"
}',
]);
$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    \"mode\": \"random\"\n}")
data = json.dumps(payload).encode('utf-8')
request = Request("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/codes/code-id/reset", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

Response example

{
    "success": true,
    "entry": {
        "identifier": "vendor",
        "code": 765432,
        "configured": true,
        "synced": true
    },
    "codes": []
}
POST/api/v1/properties/{id}/smartlocker/door/close

Lock a property door

Triggers the lock action on the property’s connected smartlock.

Parameters

ParameterTypeLocationRequiredDetails
idstringPathYesRequired path parameter.

Limited to 10 requests per minute, 100 per hour and 500 per day.

Path parameters: {id} (property UUID).

Request limits:10 / minute100 / hour500 / day

Request example · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/close' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/close", {
    "method": "POST",
    "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/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/close');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    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/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/close", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

Response example

{
    "success": true,
    "door_open": true,
    "door_busy": true
}
POST/api/v1/properties/{id}/smartlocker/door/open

Unlock a property door

Triggers the unlock action on the property’s connected smartlock.

Parameters

ParameterTypeLocationRequiredDetails
idstringPathYesRequired path parameter.

Limited to 10 requests per minute, 100 per hour and 500 per day.

Path parameters: {id} (property UUID).

Request limits:10 / minute100 / hour500 / day

Request example · POST

cURL

curl --request 'POST' 'https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/open' \
  --header 'Authorization: Basic YOUR_API_TOKEN' \
  --header 'Accept: application/json'

JavaScript

const response = await fetch("https://api.stayclean.io/api/v1/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/open", {
    "method": "POST",
    "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/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/open');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    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/properties/00000000-0000-4000-8000-000000000000/smartlocker/door/open", data=data, headers=headers, method="POST")
with urlopen(request) as response:
    result = json.load(response)

Response example

{
    "success": true,
    "door_open": false,
    "door_busy": true
}