---
title: "Preview keywords for a campaign without saving them to the database"
method: POST
path: "/api/campaign/generate-keywords/preview"
tags: ["Campaign", "Keywords"]
---

# Preview keywords for a campaign without saving them to the database

`POST /api/campaign/generate-keywords/preview`

## Request

- Base URL: `https://api.kolect.com`
- URL: `https://api.kolect.com/api/campaign/generate-keywords/preview`
- Auth: HTTP bearer

Generate 5-20 relevant keywords for a campaign using AI and return them directly without storing in the database. Uses the same generation logic as the main endpoint but skips the storage step. Useful for previewing keywords before committing to storage.

## Request body

- object
  - `campaign_id` string, uuid, required: UUID of the campaign to generate keywords for
  - `channels` string[], required: Array of channels to generate keywords for (1-3 channels)
  - `prompt_version` 'v1' | 'v2': Version of the prompt to use for keyword generation

## Response `200`

Keywords generated successfully (preview only, not saved)

- object
  - `success` boolean
  - `campaign_id` string, uuid
  - `results` object[]
    - `channel` string
    - `keywords` string[]: Array of generated keywords (not saved to database)
    - `strategy_used` 'original' | 'variation': Strategy used for keyword generation
    - `existing_keywords_count` number: Number of existing keywords found for this channel
    - `error` string: Error message if channel processing failed
  - `total_keywords_generated` number
  - `completed_channels` string[]
  - `failed_channels` string[]: Only present if some channels failed

## Other responses

- `400`: Invalid request data
- `404`: Campaign not found
- `500`: Internal server error during keyword generation

---

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