26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Create code (v2)

Create a code (v2)

POST  /api/v2/billing/intercoms/{intercom}/codes

Issues a temporary door access code. The platform generates the code digits and returns them immediately in the response; the code is delivered to the panel through a queue. Returns 422 if opening the door with a code is disabled for the intercom.

JSON
{
    "title": "Guest",
    "expired_at": "2026-11-06T00:00:00+03:00",
    "flat_id": 501
}

Method parameters

int intercom  required , Intercom ID (in the URL)


string title, Code name, up to 255 characters


string expired_at  required , Code expiration in ISO 8601 format with a time zone, for example `2026-11-06T00:00:00+03:00`


int flat_id, ID of the apartment on this intercom for which the code is issued

201  Created

Code created

JSON
{
    "id": 31,
    "title": "Guest",
    "code": "48213",
    "expired_at": "2026-11-05T21:00:00.000000Z",
    "is_expired": false,
    "flat_id": 501,
    "created_at": "2026-11-04T10:15:00.000000Z",
    "delivery": {
        "status": "pending",
        "error": null,
        "synced_at": null
    }
}

404  Not Found

Intercom or apartment not found

422  Unprocessable Entity

Returns a JSON error object.

For more information, see General information > Validation.

JSON
{
    "message": "No informative message is provided here",
    "errors": {
        "any_key": [
            "The reason for the error is described here"
        ]
    }
}
cURL
Bash
curl -k --request POST \
	--url 'https://your-domain/api/v2/billing/intercoms/{intercom}/codes' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "intercom": 0,
    "title": "string",
    "expired_at": "string",
    "flat_id": 0
}'
PHP
PHP
$data = array (
  'intercom' => 0,
  'title' => 'string',
  'expired_at' => 'string',
  'flat_id' => 0,
);
$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/v2/billing/intercoms/{intercom}/codes', false, $context);