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

# API Quickstart for AI Workflows

> A practical API workflow for automation builders that need to upload media, retrieve social connections, and publish content with Dohoo.

This guide explains the basic Dohoo API workflow for AI agents, n8n workflows, Make scenarios, Zapier automations, and custom applications.

## Standard publishing flow

The automated publishing workflow is:

1. Authenticate with your Dohoo API key.
2. Upload or select a media file.
3. Wait until the file is ready.
4. Retrieve your connected social accounts.
5. Choose the target connection ID.
6. Publish or schedule the post through the relevant platform endpoint.

## Requirements

Before using the API, make sure you have:

* A Dohoo account on the Business or Agency plan
* A Dohoo API key
* At least one connected social media account
* A media file if you are publishing image or video content
* The correct platform endpoint for the social network you want to publish to

<Note>
  API access is available on the Business and Agency plans. Blogger accounts do not include API access.
</Note>

## Step 1 — Authenticate requests

Every Dohoo API request must include your API key in the `X-API-Key` header.

```bash theme={null}
curl https://dohoo.ai/api/connections \
  -H "X-API-Key: dh_live_xxxx"
```

## Step 2 — Upload media

For media posts, first request a presigned upload URL.

```bash theme={null}
curl -X POST https://dohoo.ai/api/upload/presigned-url \
  -H "X-API-Key: dh_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{"filename": "video.mp4", "contentType": "video/mp4"}'
```

The response includes a `fileId` and an `uploadUrl`.

## Step 3 — Upload the file bytes

Upload the actual file to the returned presigned URL.

```bash theme={null}
curl -X PUT "{uploadUrl}" \
  -H "Content-Type: video/mp4" \
  --data-binary @video.mp4
```

## Step 4 — Check processing status

After uploading video media, check whether the file is ready before publishing.

```bash theme={null}
curl https://dohoo.ai/api/upload/status/{fileId} \
  -H "X-API-Key: dh_live_xxxx"
```

## Step 5 — Retrieve social connections

List the social accounts connected to your Dohoo account.

```bash theme={null}
curl https://dohoo.ai/api/connections \
  -H "X-API-Key: dh_live_xxxx"
```

Save the `connectionId` for the account where you want to publish.

## Step 6 — Publish to the target platform

Use the correct publishing endpoint for the social platform. Each platform has its own page in the API Reference.

<CardGroup cols={2}>
  <Card title="Instagram API" icon="instagram" href="/api-reference/instagram">
    Publish photos and videos to Instagram.
  </Card>

  <Card title="TikTok API" icon="music" href="/api-reference/tiktok">
    Publish videos to TikTok.
  </Card>

  <Card title="YouTube API" icon="youtube" href="/api-reference/youtube">
    Publish videos to YouTube.
  </Card>

  <Card title="Pinterest API" icon="pinterest" href="/api-reference/pinterest">
    Create and publish Pinterest pins.
  </Card>
</CardGroup>

## AI workflow pattern

```text theme={null}
User request
  -> AI creates content plan
  -> AI writes caption and title
  -> media tool creates or selects an asset
  -> Dohoo uploads the media
  -> Dohoo retrieves connection IDs
  -> Dohoo publishes or schedules the post
```

## Best practices

* Check upload status before publishing video files.
* Use platform-specific captions instead of one identical caption everywhere.
* Respect daily publishing limits for each social network.
* Add a review step for sensitive campaigns.
* Store connection IDs securely inside your workflow tool.
* Use scheduling instead of sending many posts at the same minute.

## Related API pages

* [Authentication](/api-reference/authentication)
* [Files API](/api-reference/files)
* [Connections API](/api-reference/connections)
* [Errors](/api-reference/errors)
* [Use Dohoo with AI Agents](/ai-guides/dohoo-for-ai-agents)
