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

# Post generation

> Generate LinkedIn-ready post drafts from anecdotes.

Post generation jobs turn an anecdote into a draft post through YALG's AI workflow.

## Create a job

```bash theme={null}
curl https://api.yalg.ai/v1/post-generation/from-anecdote \
  -H "x-api-key: $YALG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "anecdoteId": "123e4567-e89b-12d3-a456-426614174000",
    "platform": "linkedin"
  }'
```

The response includes the job ID and current status.

## Run the pipeline

Some integrations create a job and then explicitly run it:

```http theme={null}
POST /v1/post-generation/{id}/run
```

## Check job status

```http theme={null}
GET /v1/post-generation/{id}
```

Poll at a reasonable interval and stop when the job reaches a terminal state.

## Validate generated content

```http theme={null}
POST /v1/post-generation/{id}/validate
```

Validation creates the resulting post when the job is ready.

## Regenerate or reject

Use these endpoints for review workflows:

* `POST /v1/post-generation/{id}/regenerate`
* `POST /v1/post-generation/{id}/reject`

Both require a reason in the request body.
