> ## 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.

# Upload from YouTube

> AiGenda downloads the audio track of a YouTube video. Responds immediately, the video downloads in the background.

## Path parameters

<ParamField path="space_id" type="integer" required>
  Space ID.
</ParamField>

## Request body

<ParamField body="url" type="string" required>
  YouTube video link, up to 2048 characters.
</ParamField>

## Response

<ResponseField name="audio_id" type="integer">
  Recording ID. While the video downloads, the recording is hidden from the list; once downloaded, it gets the video's title.
</ResponseField>

After the response, wait for `is_uploaded: true` in [Upload status](/en/api-reference/audio/info) for that `audio_id`, then [start processing](/en/api-reference/processing/classify). Learn more: [Uploading from YouTube](/en/upload/youtube).

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.aigenda.tech/api/spaces/1024/audio/by_youtube/" \
    -H "Authorization: Bearer <access>" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://www.youtube.com/watch?v=VIDEO_ID"
    }'
  ```

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

  response = requests.post(
      "https://api.aigenda.tech/api/spaces/1024/audio/by_youtube/",
      headers={"Authorization": "Bearer <access>"},
      json={
          "url": "https://www.youtube.com/watch?v=VIDEO_ID",
      },
      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/by_youtube/", {
    method: "POST",
    headers: { Authorization: "Bearer <access>", "Content-Type": "application/json" },
    body: JSON.stringify({
      "url": "https://www.youtube.com/watch?v=VIDEO_ID"
    }),
  });
  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "audio_id": 51234
  }
  ```
</ResponseExample>


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