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

# n8n Social Media Automation with Dohoo

> Build n8n social media automation workflows that upload media and publish to eight platforms through the Dohoo API.

n8n social media automation with Dohoo gives you control over your publishing data and workflows while keeping n8n self-hosted. When you combine n8n with the Dohoo API, you can build powerful, fully custom automation workflows — from AI-generated content all the way to published posts on Instagram, YouTube, TikTok, and beyond — without any manual intervention.

## Why n8n + Dohoo

* **Full control** — host n8n on your own infrastructure and keep your API keys and media files entirely within your environment.
* **Flexible triggers** — kick off a workflow on a schedule, a webhook event, a new file in cloud storage, or any other supported trigger.
* **No vendor lock-in** — everything runs through standard HTTP requests against the Dohoo REST API, so your workflow is portable.

## Authentication

Every request to the Dohoo API must include your API key in the `X-API-Key` header. In n8n, add this header to each **HTTP Request** node.

```text theme={null}
X-API-Key: api_xxxxxxxxxxxxxxxxxxxxxxxx
```

<Tip>
  Store your API key in n8n's built-in **Credentials** manager (Generic Credential → Header Auth) rather than hardcoding it directly in a node. This keeps your key out of the workflow JSON and makes rotation straightforward.
</Tip>

## Basic workflow pattern

A typical n8n workflow for publishing to a social platform follows four steps:

<Steps>
  <Step title="Trigger">
    Start the workflow with any n8n trigger — a **Schedule** node for time-based publishing, a **Webhook** node to respond to external events, or a cloud-storage node (e.g., Google Drive) to react when a new file is uploaded.
  </Step>

  <Step title="Get a presigned upload URL">
    Add an **HTTP Request** node that sends a `POST` request to `/api/upload/presigned-url`. Dohoo responds with a presigned S3 URL and a `fileId` you'll use in the next steps.

    ```json theme={null}
    {
      "method": "POST",
      "url": "https://dohoo.ai/api/upload/presigned-url",
      "headers": {
        "X-API-Key": "api_xxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
    ```
  </Step>

  <Step title="Upload your file to S3">
    Add a second **HTTP Request** node that sends a `PUT` request to the `uploadUrl` returned in step 2. Attach your binary file as the request body. No `X-API-Key` header is needed for the S3 presigned URL — it's self-authenticating.
  </Step>

  <Step title="Publish to your social platform">
    Add a final **HTTP Request** node that posts to the relevant Dohoo publish endpoint. Pass the `fileId` from step 2, your `connectionId`, and any platform-specific metadata such as a caption or title.
  </Step>
</Steps>

## Example: publish to Instagram

Here is a complete configuration for the publish step of an Instagram workflow:

```json theme={null}
{
  "method": "POST",
  "url": "https://dohoo.ai/api/v2/instagram/publish",
  "headers": {
    "X-API-Key": "api_xxxxxxxxxxxxxxxxxxxxxxxx"
  },
  "body": {
    "fileId": "your-file-id",
    "connectionId": "your-connection-id",
    "caption": "Your post caption #hashtag"
  }
}
```

Replace `your-file-id` with the ID returned by the presigned-URL step, and `your-connection-id` with the ID of your connected Instagram account (In the social media tab, your connection ID will appear to the right of the account you're looking for).

## Ready-made templates

You don't have to build every workflow from scratch. The **Dohoo Shop** offers professionally built n8n templates for common use cases, including auto-slicing and auto-posting, cross-platform publishing, and AI-powered content pipelines.

<Card title="Browse n8n Templates" icon="store" href="/templates/overview">
  Explore ready-made n8n workflows in the Dohoo Shop and get up and running in minutes.
</Card>

<Note>
  API access is required to use Dohoo with n8n. Upgrade to the **Business** or **Agency** plan to unlock your API key.
</Note>
