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

# Media

> Get images and videos into your library and attach them to posts.

Every file lives in your organization's media library, the same one you see in the Autoadify app. Attach files to a post with their ids in `mediaIds`.

| Type | Formats | Max size |
| - | - | - |
| Image | JPEG, PNG, WEBP, GIF | 50 MB |
| Video | MP4, MOV, WEBM | 200 MB |
| Document (LinkedIn) | PDF, DOC, DOCX, PPT, PPTX | 100 MB |

Each organization has 5 GB of storage.

## From a URL

If the file is online, [import it](/api-reference/media/import-media-from-url). This is the simplest way, and the one AI agents use:

```bash theme={null}
curl https://api.autoadify.com/v1/media/import \
  -H "Authorization: Bearer $AUTOADIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/launch.jpg", "altText": "Our team at the launch" }'
```

The response is the media item, already `ready` to attach. The URL must be publicly reachable over http or https.

## Uploading a file

For a file on your computer or server, upload in three steps:

<Steps>
  <Step title="Ask for an upload URL">
    Send the exact size in bytes.

    ```bash theme={null}
    curl https://api.autoadify.com/v1/media/uploads \
      -H "Authorization: Bearer $AUTOADIFY_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{ "fileName": "launch.mp4", "mimeType": "video/mp4", "fileSize": 18234567 }'
    ```

    You get back `media.id` and an `upload` object with a `url` and `headers`.
  </Step>

  <Step title="Send the file">
    PUT the raw bytes to `upload.url` with exactly the `upload.headers`, within 15 minutes:

    ```bash theme={null}
    curl -X PUT "$UPLOAD_URL" \
      -H "Content-Type: video/mp4" \
      --upload-file launch.mp4
    ```

    This goes straight to storage, not through the API, so it doesn't count towards your rate limit.
  </Step>

  <Step title="Complete it">
    ```bash theme={null}
    curl -X POST https://api.autoadify.com/v1/media/MEDIA_ID/complete \
      -H "Authorization: Bearer $AUTOADIFY_API_KEY"
    ```

    The media is now `ready`, with its dimensions.
  </Step>
</Steps>

## Finding files

[List media](/api-reference/media/list-media) returns ready files, newest first. Filter with `type` (`image`, `video`, `document`, or `media` for anything a post can carry) and search with `q`, which matches file names, alt text and `description`: Autoadify's summary of what a file shows. It's added in the background, so a new file may not have one yet.

## Deleting

[Delete media](/api-reference/media/delete-media) removes a file permanently. It's refused while the file is attached to a post that hasn't been published yet, so you can't break a scheduled post by accident. Posts already published keep their copy on the platforms.


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