# API reference

> Every v1 route: its method, path, scope, request and answer, with a curl example. Made from the same contract the API runs on.

On the web: https://www.aeyho.com/docs/api/reference

API version 1.0.0. Base URL: `https://www.aeyho.com/api/v1`. The full OpenAPI 3.1 document is at https://aeyho.com/openapi.json.

Every call sends `Authorization: Bearer <key>`. The scope is what the key needs: `read`, `make` or `post`. Calls marked "runs on its own" answer `202` at once: poll the object or listen for webhooks.

## Account

### GET /account

Your plan and credit balance.

- Operation: `getAccount`
- Scope: `read`
- Answers: `200` with `Account`

Answer: `Account`

| Field | Type | Required | About |
|---|---|---|---|
| `plan` | `string` | yes |  |
| `credits` | `object` | yes |  |
| `livemode` | `boolean` | yes |  |


```bash
curl https://www.aeyho.com/api/v1/account \
  -H "Authorization: Bearer $AEYHO_KEY"
```

## Brands

### GET /brands

Your brands.

- Operation: `listBrands`
- Scope: `read`
- Answers: `200` with `BrandList`
- Query: `limit`, `cursor`

Answer: `BrandList`

| Field | Type | Required | About |
|---|---|---|---|
| `data` | `Brand[]` | yes |  |
| `nextCursor` | `string \| null` | yes |  |


```bash
curl https://www.aeyho.com/api/v1/brands \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### POST /brands

Make a brand, from a link or from its details.

- Operation: `createBrand`
- Scope: `make`
- Answers: `201` with `Brand`
- Takes an `Idempotency-Key` header

Request body: `CreateBrand`

| Field | Type | Required | About |
|---|---|---|---|
| `link` | `string` | no | A website, Instagram or YouTube link: aeyho reads it and fills in the brand. |
| `name` | `string` | no |  |
| `about` | `string` | no |  |
| `website` | `string` | no |  |
| `instagram` | `string` | no |  |
| `kind` | `"business" \| "personal" \| "product"` | no |  |
| `postsPerWeek` | `integer` | no |  |


Answer: `Brand`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes | The brand's id. |
| `name` | `string` | yes |  |
| `kind` | `string` | yes |  |
| `about` | `string` | yes |  |
| `website` | `string` | yes |  |
| `instagram` | `string` | yes |  |
| `audience` | `string` | yes |  |
| `offer` | `string` | yes |  |
| `cta` | `string` | yes |  |
| `tone` | `string[]` | yes |  |
| `timezone` | `string` | yes |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |
| `updatedAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X POST https://www.aeyho.com/api/v1/brands \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"link":"https://example.com"}'
```

### GET /brands/{brandId}

A brand.

- Operation: `getBrand`
- Scope: `read`
- Answers: `200` with `Brand`

Answer: `Brand`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes | The brand's id. |
| `name` | `string` | yes |  |
| `kind` | `string` | yes |  |
| `about` | `string` | yes |  |
| `website` | `string` | yes |  |
| `instagram` | `string` | yes |  |
| `audience` | `string` | yes |  |
| `offer` | `string` | yes |  |
| `cta` | `string` | yes |  |
| `tone` | `string[]` | yes |  |
| `timezone` | `string` | yes |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |
| `updatedAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl https://www.aeyho.com/api/v1/brands/brand_123 \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### PATCH /brands/{brandId}

Change a brand's details.

- Operation: `updateBrand`
- Scope: `make`
- Answers: `200` with `Brand`

Request body: `UpdateBrand`

| Field | Type | Required | About |
|---|---|---|---|
| `name` | `string` | no |  |
| `about` | `string` | no |  |
| `audience` | `string` | no |  |
| `offer` | `string` | no |  |
| `cta` | `string` | no |  |
| `tone` | `string[]` | no |  |
| `website` | `string` | no |  |
| `instagram` | `string` | no |  |


Answer: `Brand`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes | The brand's id. |
| `name` | `string` | yes |  |
| `kind` | `string` | yes |  |
| `about` | `string` | yes |  |
| `website` | `string` | yes |  |
| `instagram` | `string` | yes |  |
| `audience` | `string` | yes |  |
| `offer` | `string` | yes |  |
| `cta` | `string` | yes |  |
| `tone` | `string[]` | yes |  |
| `timezone` | `string` | yes |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |
| `updatedAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X PATCH https://www.aeyho.com/api/v1/brands/brand_123 \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"..."}'
```

### POST /brands/{brandId}/research

Research the brand's niche (runs on its own; uses credits).

- Operation: `startResearch`
- Scope: `make`
- Answers: `202` with `ResearchStarted`
- Runs on its own: poll the object or use webhooks
- Takes an `Idempotency-Key` header

Answer: `ResearchStarted`

| Field | Type | Required | About |
|---|---|---|---|
| `status` | `string` | yes |  |


```bash
curl -X POST https://www.aeyho.com/api/v1/brands/brand_123/research \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

## Taste

### GET /brands/{brandId}/taste

What the brand likes.

- Operation: `listTaste`
- Scope: `read`
- Answers: `200` with `TasteList`

Answer: `TasteList`

| Field | Type | Required | About |
|---|---|---|---|
| `data` | `TasteRule[]` | yes |  |
| `nextCursor` | `string \| null` | yes |  |


```bash
curl https://www.aeyho.com/api/v1/brands/brand_123/taste \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### POST /brands/{brandId}/taste

Add a rule the brand keeps.

- Operation: `addTaste`
- Scope: `make`
- Answers: `201` with `TasteRule`
- Takes an `Idempotency-Key` header

Request body: `NewTasteRule`

| Field | Type | Required | About |
|---|---|---|---|
| `rule` | `string` | yes |  |
| `about` | `"look" \| "words" \| "pace" \| "music" \| "voice" \| "captions" \| "structure"` | yes |  |


Answer: `TasteRule`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes |  |
| `rule` | `string` | yes |  |
| `about` | `"look" \| "words" \| "pace" \| "music" \| "voice" \| "captions" \| "structure"` | yes |  |
| `state` | `"proposed" \| "kept" \| "dropped"` | yes |  |
| `from` | `string[]` | yes | The comments it was learned from. |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X POST https://www.aeyho.com/api/v1/brands/brand_123/taste \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"rule":"Captions stay on one line","about":"look"}'
```

### PATCH /taste/{ruleId}

Keep, drop or reword a rule.

- Operation: `updateTaste`
- Scope: `make`
- Answers: `200` with `TasteRule`

Request body: `TastePatch`

| Field | Type | Required | About |
|---|---|---|---|
| `rule` | `string` | no |  |
| `state` | `"proposed" \| "kept" \| "dropped"` | no |  |


Answer: `TasteRule`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes |  |
| `rule` | `string` | yes |  |
| `about` | `"look" \| "words" \| "pace" \| "music" \| "voice" \| "captions" \| "structure"` | yes |  |
| `state` | `"proposed" \| "kept" \| "dropped"` | yes |  |
| `from` | `string[]` | yes | The comments it was learned from. |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X PATCH https://www.aeyho.com/api/v1/taste/rule_123 \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rule":"Captions stay on one line"}'
```

### DELETE /taste/{ruleId}

Remove a rule.

- Operation: `deleteTaste`
- Scope: `make`
- Answers: `204`

```bash
curl -X DELETE https://www.aeyho.com/api/v1/taste/rule_123 \
  -H "Authorization: Bearer $AEYHO_KEY"
```

## Ideas

### GET /brands/{brandId}/ideas

The brand's content plan.

- Operation: `listIdeas`
- Scope: `read`
- Answers: `200` with `IdeaList`
- Query: `limit`, `cursor`

Answer: `IdeaList`

| Field | Type | Required | About |
|---|---|---|---|
| `data` | `Idea[]` | yes |  |
| `nextCursor` | `string \| null` | yes |  |


```bash
curl https://www.aeyho.com/api/v1/brands/brand_123/ideas \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### POST /brands/{brandId}/ideas

Add an idea to the plan.

- Operation: `addIdea`
- Scope: `make`
- Answers: `201` with `Idea`
- Takes an `Idempotency-Key` header

Request body: `NewIdea`

| Field | Type | Required | About |
|---|---|---|---|
| `title` | `string` | yes |  |
| `angle` | `string` | no |  |
| `seconds` | `integer` | no |  |
| `format` | `"reel" \| "carousel"` | no |  |
| `slides` | `integer` | no |  |
| `pillar` | `string` | no |  |


Answer: `Idea`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes |  |
| `title` | `string` | yes |  |
| `pillar` | `string` | yes |  |
| `angle` | `string` | yes |  |
| `seconds` | `integer` | yes |  |
| `format` | `"reel" \| "carousel"` | yes |  |
| `slides` | `integer` | no |  |
| `slot` | `string` | yes | An ISO 8601 time, UTC. |
| `status` | `string` | yes |  |
| `reelId` | `string` | no |  |


```bash
curl -X POST https://www.aeyho.com/api/v1/brands/brand_123/ideas \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"title":"Why a cache stampede happens"}'
```

### POST /brands/{brandId}/plan

Plan the next weeks (uses credits).

- Operation: `planContent`
- Scope: `make`
- Answers: `200` with `PlannedIdeas`
- Takes an `Idempotency-Key` header

Request body: `PlanRequest`

| Field | Type | Required | About |
|---|---|---|---|
| `weeks` | `integer` | no |  |


Answer: `PlannedIdeas`

| Field | Type | Required | About |
|---|---|---|---|
| `data` | `Idea[]` | yes |  |
| `nextCursor` | `string \| null` | yes |  |


```bash
curl -X POST https://www.aeyho.com/api/v1/brands/brand_123/plan \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"weeks":2}'
```

## Reels

### POST /ideas/{ideaId}/reel

Make an idea's reel (runs on its own; uses credits).

- Operation: `makeIdeaReel`
- Scope: `make`
- Answers: `202` with `Reel`
- Runs on its own: poll the object or use webhooks
- Takes an `Idempotency-Key` header

Answer: `Reel`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes | The reel's id (a carousel is a reel of slides). |
| `title` | `string` | yes |  |
| `format` | `"reel" \| "carousel"` | yes |  |
| `source` | `"generated" \| "footage" \| "clips"` | yes |  |
| `brandId` | `string` | no |  |
| `ideaId` | `string` | no |  |
| `status` | `"draft" \| "queued" \| "making" \| "done" \| "failed"` | yes |  |
| `progress` | `number` | yes |  |
| `version` | `integer` | no | The newest version's number. |
| `videoUrl` | `string` | no | A signed link to the MP4, good for an hour. |
| `posterUrl` | `string` | no |  |
| `images` | `Image[]` | no | A carousel's slides, in order. |
| `error` | `string` | no |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |
| `updatedAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X POST https://www.aeyho.com/api/v1/ideas/idea_123/reel \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

### GET /reels

Your reels and carousels, newest first.

- Operation: `listReels`
- Scope: `read`
- Answers: `200` with `ReelList`
- Query: `limit`, `cursor`

Answer: `ReelList`

| Field | Type | Required | About |
|---|---|---|---|
| `data` | `Reel[]` | yes |  |
| `nextCursor` | `string \| null` | yes |  |


```bash
curl https://www.aeyho.com/api/v1/reels \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### POST /reels

Make a reel or carousel about something, for a brand (runs on its own; uses credits).

- Operation: `createReel`
- Scope: `make`
- Answers: `202` with `Reel`
- Runs on its own: poll the object or use webhooks
- Takes an `Idempotency-Key` header

Request body: `NewReel`

| Field | Type | Required | About |
|---|---|---|---|
| `brandId` | `string` | yes |  |
| `title` | `string` | yes | What the reel is about, in a line. |
| `angle` | `string` | no |  |
| `seconds` | `integer` | no |  |
| `format` | `"reel" \| "carousel"` | no |  |
| `slides` | `integer` | no |  |


Answer: `Reel`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes | The reel's id (a carousel is a reel of slides). |
| `title` | `string` | yes |  |
| `format` | `"reel" \| "carousel"` | yes |  |
| `source` | `"generated" \| "footage" \| "clips"` | yes |  |
| `brandId` | `string` | no |  |
| `ideaId` | `string` | no |  |
| `status` | `"draft" \| "queued" \| "making" \| "done" \| "failed"` | yes |  |
| `progress` | `number` | yes |  |
| `version` | `integer` | no | The newest version's number. |
| `videoUrl` | `string` | no | A signed link to the MP4, good for an hour. |
| `posterUrl` | `string` | no |  |
| `images` | `Image[]` | no | A carousel's slides, in order. |
| `error` | `string` | no |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |
| `updatedAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X POST https://www.aeyho.com/api/v1/reels \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"brandId":"brand_123","title":"Why a cache stampede happens"}'
```

### GET /reels/{reelId}

A reel, with links once it's made.

- Operation: `getReel`
- Scope: `read`
- Answers: `200` with `Reel`

Answer: `Reel`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes | The reel's id (a carousel is a reel of slides). |
| `title` | `string` | yes |  |
| `format` | `"reel" \| "carousel"` | yes |  |
| `source` | `"generated" \| "footage" \| "clips"` | yes |  |
| `brandId` | `string` | no |  |
| `ideaId` | `string` | no |  |
| `status` | `"draft" \| "queued" \| "making" \| "done" \| "failed"` | yes |  |
| `progress` | `number` | yes |  |
| `version` | `integer` | no | The newest version's number. |
| `videoUrl` | `string` | no | A signed link to the MP4, good for an hour. |
| `posterUrl` | `string` | no |  |
| `images` | `Image[]` | no | A carousel's slides, in order. |
| `error` | `string` | no |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |
| `updatedAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl https://www.aeyho.com/api/v1/reels/reel_123 \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### POST /reels/{reelId}/change

Ask for a change in words (made again; uses credits).

- Operation: `changeReel`
- Scope: `make`
- Answers: `202` with `Reel`
- Runs on its own: poll the object or use webhooks
- Takes an `Idempotency-Key` header

Request body: `ChangeRequest`

| Field | Type | Required | About |
|---|---|---|---|
| `ask` | `string` | yes |  |


Answer: `Reel`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes | The reel's id (a carousel is a reel of slides). |
| `title` | `string` | yes |  |
| `format` | `"reel" \| "carousel"` | yes |  |
| `source` | `"generated" \| "footage" \| "clips"` | yes |  |
| `brandId` | `string` | no |  |
| `ideaId` | `string` | no |  |
| `status` | `"draft" \| "queued" \| "making" \| "done" \| "failed"` | yes |  |
| `progress` | `number` | yes |  |
| `version` | `integer` | no | The newest version's number. |
| `videoUrl` | `string` | no | A signed link to the MP4, good for an hour. |
| `posterUrl` | `string` | no |  |
| `images` | `Image[]` | no | A carousel's slides, in order. |
| `error` | `string` | no |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |
| `updatedAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X POST https://www.aeyho.com/api/v1/reels/reel_123/change \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"ask":"Make the opening line shorter"}'
```

## Versions

### GET /reels/{reelId}/versions

Every version of a reel, oldest first.

- Operation: `listVersions`
- Scope: `read`
- Answers: `200` with `VersionList`
- Query: `limit`, `cursor`

Answer: `VersionList`

| Field | Type | Required | About |
|---|---|---|---|
| `data` | `Version[]` | yes |  |
| `nextCursor` | `string \| null` | yes |  |


```bash
curl https://www.aeyho.com/api/v1/reels/reel_123/versions \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### POST /versions/{versionId}/restore

Bring a version back, as the newest one (free).

- Operation: `restoreVersion`
- Scope: `make`
- Answers: `201` with `Version`
- Takes an `Idempotency-Key` header

Answer: `Version`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes |  |
| `reelId` | `string` | yes |  |
| `n` | `integer` | yes |  |
| `title` | `string` | yes |  |
| `asks` | `string[]` | yes | What was asked for, word for word. |
| `by` | `object` | yes |  |
| `changes` | `VersionChange[]` | yes |  |
| `parent` | `string` | no |  |
| `restoredFrom` | `string` | no |  |
| `approved` | `boolean` | no |  |
| `status` | `"queued" \| "rendering" \| "done" \| "failed"` | yes |  |
| `videoUrl` | `string` | no |  |
| `posterUrl` | `string` | no |  |
| `images` | `Image[]` | no |  |
| `openComments` | `integer` | yes |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X POST https://www.aeyho.com/api/v1/versions/version_123/restore \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

### POST /versions/{versionId}/approve

Mark a version as the approved one.

- Operation: `approveVersion`
- Scope: `make`
- Answers: `200` with `Version`
- Takes an `Idempotency-Key` header

Answer: `Version`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes |  |
| `reelId` | `string` | yes |  |
| `n` | `integer` | yes |  |
| `title` | `string` | yes |  |
| `asks` | `string[]` | yes | What was asked for, word for word. |
| `by` | `object` | yes |  |
| `changes` | `VersionChange[]` | yes |  |
| `parent` | `string` | no |  |
| `restoredFrom` | `string` | no |  |
| `approved` | `boolean` | no |  |
| `status` | `"queued" \| "rendering" \| "done" \| "failed"` | yes |  |
| `videoUrl` | `string` | no |  |
| `posterUrl` | `string` | no |  |
| `images` | `Image[]` | no |  |
| `openComments` | `integer` | yes |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X POST https://www.aeyho.com/api/v1/versions/version_123/approve \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

## Comments

### GET /reels/{reelId}/comments

A reel's comments.

- Operation: `listComments`
- Scope: `read`
- Answers: `200` with `CommentList`
- Query: `limit`, `cursor`

Answer: `CommentList`

| Field | Type | Required | About |
|---|---|---|---|
| `data` | `Comment[]` | yes |  |
| `nextCursor` | `string \| null` | yes |  |


```bash
curl https://www.aeyho.com/api/v1/reels/reel_123/comments \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### POST /versions/{versionId}/comments

Pin a comment to a moment or a slide.

- Operation: `addComment`
- Scope: `make`
- Answers: `201` with `Comment`
- Takes an `Idempotency-Key` header

Request body: `NewComment`

| Field | Type | Required | About |
|---|---|---|---|
| `at` | `number` | no |  |
| `slide` | `integer` | no |  |
| `point` | `object` | no |  |
| `text` | `string` | yes |  |
| `drawing` | `string` | no | The frame with marks drawn on it, as a data:image/png;base64 URL. |


Answer: `Comment`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes |  |
| `versionId` | `string` | yes |  |
| `reelId` | `string` | yes |  |
| `at` | `number` | no | Seconds into the version (a video). |
| `slide` | `integer` | no | The slide (a carousel), from 1. |
| `point` | `object` | no |  |
| `text` | `string` | yes |  |
| `drawingUrl` | `string` | no |  |
| `author` | `object` | yes |  |
| `accepted` | `boolean` | yes | A guest's comment waits for the owner before a fix acts on it. |
| `status` | `"open" \| "done" \| "wontfix"` | yes |  |
| `doneIn` | `string` | no | The version that fixed it. |
| `reply` | `string` | no | aeyho's answer when it couldn't fix it. |
| `context` | `object` | no |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X POST https://www.aeyho.com/api/v1/versions/version_123/comments \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"text":"Make this line shorter"}'
```

### PATCH /comments/{commentId}

Change, accept or close a comment.

- Operation: `updateComment`
- Scope: `make`
- Answers: `200` with `Comment`

Request body: `CommentPatch`

| Field | Type | Required | About |
|---|---|---|---|
| `text` | `string` | no |  |
| `status` | `"open" \| "done" \| "wontfix"` | no |  |
| `accepted` | `boolean` | no |  |


Answer: `Comment`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes |  |
| `versionId` | `string` | yes |  |
| `reelId` | `string` | yes |  |
| `at` | `number` | no | Seconds into the version (a video). |
| `slide` | `integer` | no | The slide (a carousel), from 1. |
| `point` | `object` | no |  |
| `text` | `string` | yes |  |
| `drawingUrl` | `string` | no |  |
| `author` | `object` | yes |  |
| `accepted` | `boolean` | yes | A guest's comment waits for the owner before a fix acts on it. |
| `status` | `"open" \| "done" \| "wontfix"` | yes |  |
| `doneIn` | `string` | no | The version that fixed it. |
| `reply` | `string` | no | aeyho's answer when it couldn't fix it. |
| `context` | `object` | no |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |


```bash
curl -X PATCH https://www.aeyho.com/api/v1/comments/comment_123 \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Make this line shorter"}'
```

### DELETE /comments/{commentId}

Remove a comment.

- Operation: `deleteComment`
- Scope: `make`
- Answers: `204`

```bash
curl -X DELETE https://www.aeyho.com/api/v1/comments/comment_123 \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### POST /reels/{reelId}/fix

Fix a reel's comments: only the parts commented on when it can (runs on its own; uses credits).

- Operation: `fixReel`
- Scope: `make`
- Answers: `202` with `Fix`
- Runs on its own: poll the object or use webhooks
- Takes an `Idempotency-Key` header

Request body: `FixRequest`

| Field | Type | Required | About |
|---|---|---|---|
| `comments` | `string[]` | no | Which comments; every open, accepted one when left out. |
| `ask` | `string` | no |  |


Answer: `Fix`

| Field | Type | Required | About |
|---|---|---|---|
| `status` | `"queued" \| "sent" \| "nothing"` | yes |  |
| `reelId` | `string` | yes |  |
| `reply` | `string` | yes |  |
| `notFixed` | `object[]` | yes |  |


```bash
curl -X POST https://www.aeyho.com/api/v1/reels/reel_123/fix \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"comments":["..."]}'
```

## Reel Score

### POST /score

Check any reel's craft from its link (Reel Score, free).

- Operation: `scoreReel`
- Scope: `read`
- Answers: `202` with `ScoreCheck`
- Runs on its own: poll the object or use webhooks
- Takes an `Idempotency-Key` header

Request body: `ScoreRequest`

| Field | Type | Required | About |
|---|---|---|---|
| `url` | `string` | yes | A public reel or video link. |


Answer: `ScoreCheck`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes |  |
| `status` | `string` | yes |  |
| `reportUrl` | `string` | yes |  |
| `result` | `any` | no |  |


```bash
curl -X POST https://www.aeyho.com/api/v1/score \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"url":"https://example.com/hooks/aeyho"}'
```

### GET /score/{checkId}

A Reel Score check.

- Operation: `getScore`
- Scope: `read`
- Answers: `200` with `ScoreCheck`

Answer: `ScoreCheck`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes |  |
| `status` | `string` | yes |  |
| `reportUrl` | `string` | yes |  |
| `result` | `any` | no |  |


```bash
curl https://www.aeyho.com/api/v1/score/check_123 \
  -H "Authorization: Bearer $AEYHO_KEY"
```

## Webhooks

### GET /webhooks

Your webhooks.

- Operation: `listWebhooks`
- Scope: `read`
- Answers: `200` with `WebhookList`
- Query: `limit`, `cursor`

Answer: `WebhookList`

| Field | Type | Required | About |
|---|---|---|---|
| `data` | `Webhook[]` | yes |  |
| `nextCursor` | `string \| null` | yes |  |


```bash
curl https://www.aeyho.com/api/v1/webhooks \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### POST /webhooks

Send events to a link of yours.

- Operation: `createWebhook`
- Scope: `make`
- Answers: `201` with `Webhook`
- Takes an `Idempotency-Key` header

Request body: `NewWebhook`

| Field | Type | Required | About |
|---|---|---|---|
| `url` | `string` | yes |  |
| `events` | `"version.created" \| "comment.resolved" \| "reel.done" \| "reel.failed" \| "credits.low" \| "post.published"[]` | no |  |


Answer: `Webhook`

| Field | Type | Required | About |
|---|---|---|---|
| `id` | `string` | yes |  |
| `url` | `string` | yes |  |
| `events` | `string[]` | yes |  |
| `mode` | `"live" \| "test"` | yes |  |
| `createdAt` | `string` | yes | An ISO 8601 time, UTC. |
| `secret` | `string` | no | Shown once, when it's made: verify each delivery's webhook-signature with it. |


```bash
curl -X POST https://www.aeyho.com/api/v1/webhooks \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"url":"https://example.com/hooks/aeyho"}'
```

### DELETE /webhooks/{webhookId}

Stop a webhook.

- Operation: `deleteWebhook`
- Scope: `make`
- Answers: `204`

```bash
curl -X DELETE https://www.aeyho.com/api/v1/webhooks/webhook_123 \
  -H "Authorization: Bearer $AEYHO_KEY"
```

### POST /webhooks/{webhookId}/test

Send a test event.

- Operation: `testWebhook`
- Scope: `make`
- Answers: `202` with `TestSent`
- Takes an `Idempotency-Key` header

Answer: `TestSent`

| Field | Type | Required | About |
|---|---|---|---|
| `deliveryId` | `string` | yes |  |


```bash
curl -X POST https://www.aeyho.com/api/v1/webhooks/webhook_123/test \
  -H "Authorization: Bearer $AEYHO_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

### GET /webhooks/{webhookId}/deliveries

A webhook's recent deliveries.

- Operation: `listDeliveries`
- Scope: `read`
- Answers: `200` with `DeliveryList`
- Query: `limit`, `cursor`

Answer: `DeliveryList`

| Field | Type | Required | About |
|---|---|---|---|
| `data` | `Delivery[]` | yes |  |
| `nextCursor` | `string \| null` | yes |  |


```bash
curl https://www.aeyho.com/api/v1/webhooks/webhook_123/deliveries \
  -H "Authorization: Bearer $AEYHO_KEY"
```
