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

# Article

> Create, read, update, and delete articles

The Article resource represents a piece of content — its title, description, content blocks, thumbnail, and styling.

## Sample payload

```json theme={null}
{
  "content": [],
  "created": "1970-01-01T00:00:00Z",
  "custom_data": {},
  "description": "Optional description for this content",
  "image": {},
  "key": "<article_key>",
  "navigation": {},
  "origin_template": "<template_key>",
  "style": {},
  "tags": [],
  "thumbnail": [],
  "thumbnail_style": {},
  "title": "Content title",
  "updated": "1970-01-01T00:00:00Z"
}
```

## Endpoints

### Create Article

`POST /articles`

Create a new article. Use the [sample payload](#sample-payload) as a guide for the request body.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://backend.choicely.com/articles" \
    -H "Authorization: Bearer <YOUR_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "Content title",
      "description": "Optional description for this content"
    }'
  ```
</CodeGroup>

### Get all Articles

`GET /articles`

Retrieve all articles.

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://backend.choicely.com/articles" \
    -H "Authorization: Bearer <YOUR_API_KEY>"
  ```
</CodeGroup>

### Get a single Article

`GET /articles/<article_key>`

Retrieve a single article by its key.

<ParamField path="article_key" type="string" required>
  Unique key of the article.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://backend.choicely.com/articles/<article_key>" \
    -H "Authorization: Bearer <YOUR_API_KEY>"
  ```
</CodeGroup>

### Update Article

`PATCH /articles/<article_key>`

Update an existing article. Include only the fields you want to change.

<ParamField path="article_key" type="string" required>
  Unique key of the article.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH "https://backend.choicely.com/articles/<article_key>" \
    -H "Authorization: Bearer <YOUR_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "Updated title"
    }'
  ```
</CodeGroup>

### Delete Article

`DELETE /articles/<article_key>`

Delete an article.

<ParamField path="article_key" type="string" required>
  Unique key of the article.
</ParamField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://backend.choicely.com/articles/<article_key>" \
    -H "Authorization: Bearer <YOUR_API_KEY>"
  ```
</CodeGroup>
