> ## Documentation Index
> Fetch the complete documentation index at: https://chatobserver.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I create and run AI monitoring prompts through the API?

> Create a monitoring prompt, configure its platforms and schedule, request an answer, and follow the resulting response history.

Create a prompt with `POST /v2/prompts`, then request collection with `POST /v2/prompts/{id}/rerun`. These actions require a credential with write access. Creating the configuration and collecting an answer are separate operations.

## Create a manual prompt

This illustrative request creates a question with explicit platform, region, and schedule choices:

```bash theme={null}
curl --fail-with-body \
  'https://app.chatobserver.com/api/v2/prompts' \
  -H "Authorization: Bearer $CHATOBSERVER_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: onboarding-question-001' \
  --data '{
    "promptText": "Which project management tools suit a small design agency?",
    "targetPlatforms": ["chatgpt"],
    "targetRegions": ["United Kingdom"],
    "schedule": {"frequency": "manual", "timezone": "Europe/London"}
  }'
```

Read the returned `data.id`; do not construct a prompt identifier yourself. For recurring monitoring, the API supports daily and weekly schedules with a time zone and clock time. Weekly schedules require at least one day in `daysOfWeek`, using 0 for Sunday through 6 for Saturday.

## Request an answer

Set `PROMPT_ID` to the identifier returned by creation:

```bash theme={null}
curl --request POST --fail-with-body \
  "https://app.chatobserver.com/api/v2/prompts/$PROMPT_ID/rerun" \
  -H "Authorization: Bearer $CHATOBSERVER_API_KEY"
```

A 202 response means the collection request was accepted. It does not contain the completed answer. Read `/v2/responses?promptId=...` to follow the prompt's response history, and distinguish collection status from analysis status.

## Organise and maintain prompts

Assign `tagIds` for dashboard groups and `personaIds` for audience organisation. Use the prompt update, activation, deactivation, and tag endpoints for ongoing management. Read the endpoint-specific payload before using bulk actions; their request shapes are not interchangeable.

See [safe retries](/docs/developers/safe-writes) before automating writes and [answer exports](/docs/developers/export-answers) for reading the resulting evidence.
