# Snapchat Ads

Create image and video Snap Ads, target them, build Snap Audience Match lists, send conversions and read daily metrics on a snapchatads account.

import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

Create a Snap Ad with `POST /v1/ads/create` on a `snapchatads` account (ad platform value `snapchat`). Campaigns, ad squads and ads made in Snapchat Ads Manager sync in too.

## Quick reference

| Property | Value |
|----------|-------|
| Hierarchy | Ad Account > Campaign > Ad Squad > Ad, created in one call |
| Goals (`goal`) | `awareness`, `engagement`, `video_views`, `traffic`, `conversions` |
| Ad format | One full-screen image or video per ad |
| Budget | `daily` (at least 5) or `lifetime`, on the ad squad |
| Bidding | Auto bid, max bid or target cost |
| Targeting | Countries, regions, metros, ZIP codes, radius, age, gender, languages, interests, OS and audiences |
| Audiences | Snap Audience Match customer lists from hashed emails and phone numbers |
| Edits after creation | Status, name, budget and bid at each level, and the ad squad's targeting |
| Delete | Deletes on Snapchat, at every level |
| Performance sync | Daily spend, impressions, swipes, video views and purchases |
| Conversions | The [Snapchat Conversions API](/platforms/snapchat-ads/conversions), through `POST /v1/events` |

## Before you start

You need a Snapchat login that belongs to a Snapchat Business organization with at least one ad account, set up in Ads Manager with a payment method.

Snapchat Ads is a standalone connection: it has its own OAuth and its own `accountId`.

## Connect

Call `GET /v1/connect/snapchatads/ads` with the `profileId` the connection belongs to ([Connect ads](/connect/connect-ads)).

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
import Zernio from '@zernio/node';

const zernio = new Zernio();

const { data: start } = await zernio.connect.connectAds({
  path: { platform: 'snapchatads' },
  query: { profileId: '66a1f0c2a4b9d3e8f1a2b3c4', redirect_url: 'https://your-app.com/cb' }
});

console.log(start.authUrl ?? start.accountId);
```
</Tab>
<Tab value="Python">
```python
from zernio import Zernio

client = Zernio()

start = client.connect.connect_ads(
    platform="snapchatads",
    profile_id="66a1f0c2a4b9d3e8f1a2b3c4",
    redirect_url="https://your-app.com/cb",
)

print(start.get("authUrl") or start.get("accountId"))
```
</Tab>
<Tab value="curl">
```bash
curl "https://zernio.com/api/v1/connect/snapchatads/ads?profileId=66a1f0c2a4b9d3e8f1a2b3c4&redirect_url=https://your-app.com/cb" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```
</Tab>
</Tabs>

Send the user to the `authUrl` the call returns, where they sign in with Snapchat and allow the Snapchat Marketing API.

**Choosing ad accounts.** The user picks the ad accounts to sync from every organization they belong to.

Pass `adAccountId` (or `adAccountIds`, the ad account UUIDs) on the connect call to limit sync to them.

Call the connect endpoint again once the browser lands on your `redirect_url`: it answers with `alreadyConnected: true` and the `accountId` every sample in this section uses.

A Snap Pixel connected for the [Conversions API](/platforms/snapchat-ads/conversions) and the Marketing API connection share the profile's one `snapchatads` account.

## Common errors

| Error | Cause | Fix |
|-------|-------|-----|
| `error=snapchat_ads_no_ad_accounts` | The login belongs to no organization with an ad account | Create one in Snapchat Ads Manager, or sign in with a member of the organization. |
| `error=snapchat_ads_auth_failed` | The user declined on Snapchat's consent screen, or Snapchat refused the sign-in | Connect again and allow the Snapchat Marketing API. |
| `error=snapchat_ads_access_denied` | The API key cannot reach the `profileId` the connect started with | Start the connect with a profile the key can access. |

## In this section

<PlatformPages platform="snapchat-ads" />

## Related

- [Connect ads](/connect/connect-ads): every parameter of the connect call.
- [Create standalone ad](/ad-campaigns/create-standalone-ad): every field of the create request.
- [Get campaign tree](/ad-campaigns/get-ad-tree): campaigns, ad squads and ads with their metrics.
- [Conversions API](/platforms/snapchat-ads/conversions): send server-side events to your Snap Pixel.