# Styles API

> Create writing styles and add examples from text, an X post URL, a handle or the tweet bank.

Source: https://xbeast.io/docs/api-styles

Styles teach XBeast how you write. A style holds example tweets and can be attached to presets and text generation. Community styles are read-only; duplicate the examples into your own style to customize them.

> **Maximum 9 examples per style**
>
> Adding an example from a URL or a handle fetches public X posts and requires a connected X account.

## Style object

```json
{
  "id": "f3a9d1…",
  "title": "Builder voice",
  "is_community": false,
  "examples": [
    "Shipped a tiny feature today. It will never trend, and it made a customer's week.",
    "Most growth advice is just consistency with better lighting."
  ],
  "tweet_bank_ids": [],
  "created_at": "2026-11-28T10:00:00.000Z"
}
```

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| id | string | — | Style id. |
| title | string | — | Display name. |
| is_community | boolean | — | Community styles cannot be edited. |
| examples | string[] | — | Example tweet texts. |
| tweet_bank_ids | string[] | — | Tweet bank entries used as examples. |

### List styles

**`GET /api/v1/styles`**

#### Query

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| include_community | boolean | No | Include shared community styles. |
| search | string | No | Filter by title. |
| limit | number | No | Default 20, max 100. |
| offset | number | No | Pagination offset. |

### Create a style

**`POST /api/v1/styles`**

```bash
curl -X POST "https://xbeast.io/api/v1/styles" \
  -H "Authorization: Bearer xb_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "title": "Builder voice" }'
```

### Get a style

**`GET /api/v1/styles/:id`**

### Update a style

**`PATCH /api/v1/styles/:id`**

Send exactly one change per request:

#### Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| title | string | No | Rename the style. |
| add_example | object | No | { text } to add one example. |
| add_from_url | string | No | X post URL to import as an example. |
| generate_from_handle | string | No | Handle whose recent tweets become examples. |
| replace_custom_tweets | array | No | Replace all manual examples. |
| replace_tweet_bank_ids | string[] | No | Replace tweet-bank examples. |
| remove_example_id | string | No | Remove one example by id. |

### Add an example

**`POST /api/v1/styles/:id/examples`**

Body: exactly one of `text`, `tweet_url` or `handle`.

### Remove an example

**`DELETE /api/v1/styles/:id/examples/:exampleId`**

### Delete a style

**`DELETE /api/v1/styles/:id`**

## Related

- [Use a style in a preset](https://xbeast.io/docs/api-presets.md)
- [Use a style in text generation](https://xbeast.io/docs/api-generations.md)
- [Import tweet-bank examples](https://xbeast.io/docs/api-tweet-bank.md)
