26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Update key

PATCH  /api/v1/billing/intercoms/{intercom}/keys/{key}

Updates an intercom MIFARE key. During an update, the old key is removed from the device and a new key is created through vendorFactory. The key value, apartment association, and name can be changed. The apartment can be specified by intercom_flat_id or by its number flat.

JSON
{
    "key": "000000DDEEFF11",
    "flat": 43,
    "title": "New key"
}

Method parameters

int intercom  required , Intercom ID (in the URL)


string key, New key value. Format depends on the vendor. If omitted, the existing value is retained.


int intercom_flat_id, Intercom apartment ID. Cannot be provided together with `flat`.


int flat, Apartment number. Cannot be provided together with `intercom_flat_id`.


string title, Key name (maximum 255 characters).

200  OK

Key successfully updated

JSON
{
    "data": {
        "id": 2,
        "key": "000000DDEEFF11",
        "type": "mifare",
        "title": "New key",
        "intercom_id": 10,
        "intercom_flat_id": 7,
        "created_at": "2026-01-15T12:00:00.000000Z",
        "updated_at": "2026-01-15T12:00:00.000000Z"
    }
}

404  Not Found

Intercom or key not found

422  Unprocessable Entity

Validation error or failure to update the key on the device. If adding the new key fails, the old key is restored on the device.

JSON
{
    "message": "Validation failed",
    "errors": {
        "key": [
            "This key already exists"
        ],
        "error": [
            "Failed to add the key to the intercom"
        ]
    }
}
cURL
Bash
curl -k --request PATCH \
	--url 'https://your-domain/api/v1/billing/intercoms/{intercom}/keys/{key}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "intercom": 0,
    "key": "string",
    "intercom_flat_id": 0,
    "flat": 0,
    "title": "string"
}'
PHP
PHP
$data = array (
  'intercom' => 0,
  'key' => 'string',
  'intercom_flat_id' => 0,
  'flat' => 0,
  'title' => 'string',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'PATCH',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/billing/intercoms/{intercom}/keys/{key}', false, $context);