---
title: POST /api/v1/instances
description: Create Instance
locale: ru
version: 0.2.0
canonical: https://enterium-developer-docs.pages.dev/developers/ru/api/instances/post-instances/
---

> Documentation index: https://enterium-developer-docs.pages.dev/developers/llms.txt — every page of this portal has a Markdown twin at <route>.md; the frozen API contract is at https://enterium-developer-docs.pages.dev/developers/api/openapi.json.

:::note
Сгенерировано из OpenAPI-контракта — не редактировать руками. Сводки операций и описания полей приводятся на английском (дословно из контракта). Интерактивный обозреватель с полными схемами: [https://entherium.duckdns.org:8443/reference](https://entherium.duckdns.org:8443/reference); замороженная спецификация этой сборки: [openapi.json](/developers/api/openapi.json). Группа: [instances](../).
:::

Create Instance

**Авторизация:** нужен `Authorization: Bearer <token>`

## Запрос

```sh
curl -sS -X POST "https://entherium.duckdns.org:8443/api/v1/instances" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"attached_sc":"<attached_sc>","backend":"<backend>","base_url":"<base_url>","caption":"<caption>","gcs_bucket":"<gcs_bucket>","hostname":"<hostname>","instance_id":"<instance_id>","is_active":"<is_active>","registry":"<registry>","template_dir":"<template_dir>","theme_repo":"<theme_repo>","theme_sha":"<theme_sha>","tier":"<tier>","vps_ip":"<vps_ip>","vps_port":"<vps_port>"}'
```

## Ответ `201`

В контракте нет примера для этого ответа; схема: `HugoInstanceRead`. Поля — в [интерактивном обозревателе](https://entherium.duckdns.org:8443/reference).

## Возвращает

`HugoInstanceRead` — Successful Response

| Поле | Тип | Описание |
| --- | --- | --- |
| `attached_sc` | `integer \| null` (opt.) |  |
| `backend` | `"gcs" \| "local-fs" \| "wp"` (opt.) |  |
| `base_url` | `string \| null` (opt.) |  |
| `caption` | `string \| null` (opt.) |  |
| `createtime` | `string` |  |
| `gcs_bucket` | `string \| null` (opt.) |  |
| `guid` | `integer` |  |
| `hostname` | `string \| null` (opt.) |  |
| `instance_id` | `string` |  |
| `is_active` | `boolean` (opt.) |  |
| `last_build_at` | `string \| null` |  |
| `last_publish_at` | `string \| null` |  |
| `owner` | `integer \| null` (opt.) |  |
| `posts_count` | `integer` |  |
| `registry` | `object` (opt.) |  |
| `rsid` | `integer` |  |
| `template_dir` | `string \| null` (opt.) |  |
| `theme_repo` | `string \| null` (opt.) |  |
| `theme_sha` | `string \| null` (opt.) |  |
| `tier` | `"prod" \| "dev" \| "test" \| "staging"` (opt.) |  |
| `updatedby` | `integer \| null` (opt.) |  |
| `updatetime` | `string` |  |
| `vps_ip` | `string \| null` (opt.) |  |
| `vps_port` | `integer \| null` (opt.) |  |
| `warmup_state` | `"cold" \| "warming" \| "warm"` |  |

## Параметры

| Параметр | Где | Обязателен | Тип | По умолчанию | Ограничения | Описание |
| --- | --- | --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | нет | `string` | — | uuid | Optional. |

## Тело запроса

| Поле | Тип | Обязательно | Описание |
| --- | --- | --- | --- |
| `attached_sc` | `integer \| null` | нет |  |
| `backend` | `"gcs" \| "local-fs" \| "wp"` | нет |  |
| `base_url` | `string \| null` | нет |  |
| `caption` | `string \| null` | нет |  |
| `gcs_bucket` | `string \| null` | нет |  |
| `hostname` | `string \| null` | нет |  |
| `instance_id` | `string` | да |  |
| `is_active` | `boolean` | нет |  |
| `registry` | `object` | нет |  |
| `template_dir` | `string \| null` | нет |  |
| `theme_repo` | `string \| null` | нет |  |
| `theme_sha` | `string \| null` | нет |  |
| `tier` | `"prod" \| "dev" \| "test" \| "staging"` | нет |  |
| `vps_ip` | `string \| null` | нет |  |
| `vps_port` | `integer \| null` | нет |  |

## Ошибки

| Код | Смысл | Тело |
| --- | --- | --- |
| `401` | Missing or invalid authentication credentials | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Тело любой ошибки — `{detail, code?, request_id, doc_url}`: `request_id` — что цитировать, `doc_url` ведёт в [Справочник ошибок](../../../reference/errors/).
