> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# Stories & Spotlight

Publish Stories, Saved Stories and Spotlight videos to Snapchat, and the platform fields they accept.

A plain post becomes a Story: `contentType` defaults to `"story"`. Set it to `"saved_story"` or `"spotlight"` for the other 2 types.

| `contentType` | What it publishes | Lifetime | Text |
|------|-------------|----------|--------------|
| `story` | A snap in the profile's Story | 24 hours | No caption |
| `saved_story` | A permanent story on the Public Profile | Permanent | `content` is the title, max 45 characters |
| `spotlight` | A video in Snapchat's Spotlight feed | Permanent | `content` is the description, max 160 characters, hashtags allowed |

## Story

A Story is visible for 24 hours and carries no caption, so `content` is not used:

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

Response (`201`):

```json
{
  "post": {
    "_id": "65f1c0a9e2b5af0012ab34cd",
    "status": "published",
    "platforms": [
      {
        "platform": "snapchat",
        "status": "published"
      }
    ]
  }
}
```

Every sample below changes only the `content` or the `platforms` entry of this request. An image works the same way with `{ "type": "image", "url": "https://cdn.example.com/backstage.jpg" }`.

## Saved Story

A Saved Story stays on the Public Profile. `content` becomes its title, at most 45 characters:

```json
{
  "content": "Behind the scenes",
  "platforms": [
    {
      "platform": "snapchat",
      "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
      "platformSpecificData": { "contentType": "saved_story" }
    }
  ]
}
```

## Spotlight

Spotlight is Snapchat's public video feed and takes video only. `content` becomes the description, at most 160 characters including hashtags:

```json
{
  "content": "Sunset over the pier #sunset #nature",
  "platforms": [
    {
      "platform": "snapchat",
      "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
      "platformSpecificData": { "contentType": "spotlight" }
    }
  ]
}
```

## Platform fields

All fields go in `platformSpecificData` on the Snapchat entry.

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `contentType` | `"story"`, `"saved_story"`, `"spotlight"` | `"story"` | Where the media publishes. See [Story](#story), [Saved Story](#saved-story) and [Spotlight](#spotlight). |