26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Create key (v1)

With the release of request version v2, version v1 is being moved to legacy.
For new integrations, use the current v2.
Version v1 remains available to support existing integrations.

POST  /api/v1/billing/intercoms/{intercom}/keys

Creates a MIFARE key for an intercom. The key is automatically sent to the device through vendorFactory. The apartment can be specified either by intercom_flat_id or by its number flat. The key format depends on the intercom vendor.

JSON
{
    "key": "000000AABBCCDD",
    "intercom_flat_id": 5,
    "title": "Apartment 12 key"
}

Method parameters

int intercom  required , Intercom ID (in the URL)


string key  required , Key value. The format depends on the vendor: for Sputnik, a string of 2–16 characters; for others, HEX format `000000XXXXXXXX` (14 characters).


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 (optional, maximum 255 characters).

201  Created

Key successfully created

JSON
{
    "data": {
        "id": 1,
        "key": "000000AABBCCDD",
        "type": "mifare",
        "title": "Apartment 12 key",
        "intercom_id": 10,
        "intercom_flat_id": 5,
        "created_at": "2026-01-15T10:00:00.000000Z",
        "updated_at": "2026-01-15T10:00:00.000000Z"
    }
}

404  Not Found

Intercom not found

422  Unprocessable Entity

Validation error or failure to add the key to 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 POST \
	--url 'https://your-domain/api/v1/billing/intercoms/{intercom}/keys' \
	--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' => 'POST',
		'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', false, $context);