> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aigenda.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Создать запись

> Создаёт запись и выдаёт ссылки для загрузки файла в хранилище. Первый шаг загрузки файла.

## Параметры пути

<ParamField path="space_id" type="integer" required>
  Идентификатор пространства.
</ParamField>

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

<ParamField body="title" type="string" required>
  Название до 255 символов. **Заканчивается расширением файла**: `.mp3`, `.m4a`, `.wav`, `.ogg`, `.webm`, `.mp4`.
</ParamField>

<ParamField body="size" type="integer" required>
  Точный размер файла в байтах.
</ParamField>

<ParamField body="content_type" type="string" required>
  MIME-тип файла.
</ParamField>

## Ответ

<ResponseField name="id" type="integer">
  Идентификатор записи (`audio_id`).
</ResponseField>

<ResponseField name="url" type="string[]">
  Ссылки для `PUT` частей файла, по одной на часть примерно в 10 МБ. Живут 5 часов.
</ResponseField>

<ResponseField name="is_uploaded" type="boolean">
  `false` до завершения загрузки.
</ResponseField>

Каждый вызов создаёт новую запись. Не повторяйте его вслепую, если ответ потерялся: см. [Надёжная интеграция](/reference/best-practices).

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.aigenda.tech/api/spaces/1024/audio/" \
    -H "Authorization: Bearer <access>" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "Планёрка отдела продаж.mp3",
      "size": 18874368,
      "content_type": "audio/mpeg"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.aigenda.tech/api/spaces/1024/audio/",
      headers={"Authorization": "Bearer <access>"},
      json={
          "title": "Планёрка отдела продаж.mp3",
          "size": 18874368,
          "content_type": "audio/mpeg",
      },
      timeout=30,
  )
  response.raise_for_status()
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.aigenda.tech/api/spaces/1024/audio/", {
    method: "POST",
    headers: { Authorization: "Bearer <access>", "Content-Type": "application/json" },
    body: JSON.stringify({
      "title": "Планёрка отдела продаж.mp3",
      "size": 18874368,
      "content_type": "audio/mpeg"
    }),
  });
  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": 51234,
    "title": "Планёрка отдела продаж.mp3",
    "created_at": "2026-10-17T12:30:00.481233+03:00",
    "size": 18874368,
    "content_type": "audio/mpeg",
    "space_id": 1024,
    "is_active": true,
    "is_favorite": false,
    "is_uploaded": false,
    "was_classified": false,
    "result_is_ready": false,
    "url": [
      "https://storage.yandexcloud.net/aigenda/3f6c1e0a.mp3?partNumber=1&uploadId=…&X-Amz-Signature=…",
      "https://storage.yandexcloud.net/aigenda/3f6c1e0a.mp3?partNumber=2&uploadId=…&X-Amz-Signature=…"
    ],
    "duration": null
  }
  ```

  ```json 400 theme={null}
  {
    "title": [
      "This field is required."
    ]
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.