# Snapchat

Snapchat Stories, Saved Stories and Spotlight publishing with the Zernio API. Not available yet because Snap has not approved Zernio's app.

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

Publish Stories, Saved Stories and Spotlight videos to Snapchat with `POST /v1/posts` and `platform: "snapchat"`.

<Callout type="warn">
Snapchat is not available yet: Snap has not approved Zernio's app, so new connections return `403 PLATFORM_BETA_RESTRICTED` for every account. There is no access list to join and no release date.
</Callout>

## Quick reference

| Property | Value |
|----------|-------|
| Title limit | 45 characters (Saved Stories) |
| Description limit | 160 characters (Spotlight, including hashtags) |
| Media per post | 1 (a single image or video) |
| Image formats | JPEG, PNG |
| Image max size | 20 MB |
| Video format | MP4 only |
| Video max size | 500 MB |
| Video duration | 5 to 60 seconds |
| Post types | Story, Saved Story, Spotlight |
| Scheduling | Yes |
| Inbox | No |
| Analytics | Yes (views, unique viewers, shares) |

## Before you start

Snapchat requires a Public Profile (Person, Business or Official). A regular Snapchat account cannot publish through the API.

Every post carries exactly 1 image or video. There are no text-only posts, no carousels and no albums, and 9:16 vertical media is expected.

Zernio encrypts each file with AES-256-CBC before uploading it to Snapchat, so nothing changes on your side.

## Connect

Call `GET /v1/connect/snapchat` with `profileId` on [Get OAuth connect URL](/connect/get-connect-url).

After the user authorizes, they pick which Public Profile to connect. So Snapchat is one of the [platforms requiring secondary selection](/guides/connecting-accounts#platforms-requiring-secondary-selection): in standard mode Zernio hosts that screen, in headless mode you build it.

The [connecting accounts guide](/guides/connecting-accounts#platforms-requiring-secondary-selection) has the profile selection in both modes, with code.

## Publish a post

This request publishes a video Story to Snapchat right away. `platformSpecificData.contentType: "story"` picks the format.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: published } = await zernio.posts.createPost({
  body: {
    mediaItems: [
      { type: 'video', url: 'https://cdn.example.com/backstage.mp4' }
    ],
    platforms: [
      {
        platform: 'snapchat',
        accountId: '66b2e19d8c3f5a7e9d0b1c2d',
        platformSpecificData: { contentType: 'story' }
      }
    ],
    publishNow: true
  }
});

console.log(published.post.status);
```
</Tab>
<Tab value="Python">
```python
published = client.posts.create_post(
    media_items=[
        {"type": "video", "url": "https://cdn.example.com/backstage.mp4"}
    ],
    platforms=[
        {
            "platform": "snapchat",
            "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
            "platformSpecificData": {"contentType": "story"}
        }
    ],
    publish_now=True
)

print(published["post"]["status"])
```
</Tab>
<Tab value="curl">
```bash
curl -X POST https://zernio.com/api/v1/posts \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mediaItems": [
      {"type": "video", "url": "https://cdn.example.com/backstage.mp4"}
    ],
    "platforms": [
      {
        "platform": "snapchat",
        "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
        "platformSpecificData": {"contentType": "story"}
      }
    ],
    "publishNow": true
  }'
```
</Tab>
</Tabs>

Every option is on [Stories & Spotlight](/platforms/snapchat/posts).

## In this section

<PlatformPages platform="snapchat" />

## Related

- [Connecting accounts](/guides/connecting-accounts#platforms-requiring-secondary-selection): the OAuth flow and the Public Profile selection step.
- [Create post](/posts/create-post): every field of the request.
- [Media uploads](/guides/media-uploads): upload images and videos instead of hosting them.
- [Analytics](/analytics/get-analytics): post performance metrics.
- [Pricing](/pricing): what a connected account and analytics cost.