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

# Quickstart

> Upload an asset, fetch it back, then clean up.

The examples use two variables: `BASE_URL` (your Media Cloud host) and
`API_KEY` (your key).

```bash theme={null}
export BASE_URL="https://api.mediacloud.me"
export API_KEY="your_api_key"
```

<Steps>
  <Step title="Upload a file">
    Send the file as `multipart/form-data` in the `file` field.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST "$BASE_URL/api/v1/assets" \
        -H "Authorization: Bearer $API_KEY" \
        -F "file=@./photo.jpg"
      ```

      ```javascript JavaScript theme={null}
      const form = new FormData();
      form.append("file", fileInput.files[0]);

      const res = await fetch(`${BASE_URL}/api/v1/assets`, {
        method: "POST",
        headers: { Authorization: `Bearer ${API_KEY}` },
        body: form,
      });
      const { data } = await res.json();
      ```
    </CodeGroup>

    The response is `201 Created` with the new asset. Keep its `id`.
  </Step>

  <Step title="Fetch it back">
    ```bash theme={null}
    curl "$BASE_URL/api/v1/assets/ASSET_ID" \
      -H "Authorization: Bearer $API_KEY"
    ```

    Use `attributes.url` to display the file, or `attributes.download_url` to
    download it.
  </Step>

  <Step title="List your assets">
    ```bash theme={null}
    curl "$BASE_URL/api/v1/assets?page=1" \
      -H "Authorization: Bearer $API_KEY"
    ```
  </Step>

  <Step title="Trash, then delete">
    ```bash theme={null}
    curl -X POST "$BASE_URL/api/v1/assets/bulk-trash" \
      -H "Authorization: Bearer $API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"asset_ids": ["ASSET_ID"]}'
    ```

    Both bulk routes answer `204 No Content`. To remove the asset for good, call
    [Bulk delete assets](/api-reference/assets/bulk-delete-assets).
  </Step>
</Steps>

<Note>
  Uploaded assets return `is_favourite: null`. Fetch or list them to see the
  stored value.
</Note>


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