---
title: "Connect ads"
method: POST
path: "/ads/connect"
tags: ["Ads"]
---

# Connect ads

`POST /ads/connect`

## Request

- Base URL: `https://api.crevio.co/v1`
- URL: `https://api.crevio.co/v1/ads/connect`
- Auth: API key in header `Authorization`

Connect ads for a platform (separate from posting). Required before campaigns/ads sync. Same-token platforms (facebook, instagram, linkedin, pinterest) need no extra OAuth; tiktok, twitter and googleads return an auth_url. ChatGPT ads (openaiads) have no OAuth: send an `api_key` from ChatGPT Ads Manager, which covers exactly one ad account.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `platform` 'facebook' | 'instagram' | 'linkedin' | 'tiktok' | 'twitter' | 'pinterest' | 'googleads' | 'openaiads', required
  - `account_id` string: Parent posting channel (sacct_…), for same-token platforms.
  - `api_key` string: openaiads only, and required there. API key from ChatGPT Ads Manager (Settings). OpenAI has no read-only scope, so the key carries full campaign write access. Posting a rotated key for the same ad account updates the connection in place. A key OpenAI rejects returns 422.
  - `ad_account_id` string: Scope sync to one Meta ad account (act_…).
  - `redirect_url` string
  - `force` boolean: Re-run OAuth even though a connection already exists. Without it a same-token connection (facebook/instagram/linkedin/pinterest) keeps answering `already_connected` on its posting token, so a channel whose token lacks ads scopes can never be repaired.

## Response `200`

Connection result (already_connected, account, or auth_url).

- object

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `409`: Account not activated.
- `422`: Validation error
- `429`: Rate limit exceeded — 600 requests per minute per credential. Retry after the number of seconds in `Retry-After`.

---

[API](https://skmtc.dev/crevio/apis/crevio-api-v1.md) · [All operations](https://skmtc.dev/crevio/apis/crevio-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/crevio/apis/crevio-api-v1/revisions/2219f18ad651?raw)
