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

# Articles

> List, search, view, create, update, and share articles.

An article is a single page of content in your knowledge base. For fields and response details, see the [API reference](/api-reference/articles/list).

Every command that takes an article ID accepts the article's slug, its permalink identifier (`a-XXXXXXXX`), or its UUID. See [Getting an article ID](/getting-started/getting-article-id).

Samples on this page show the `--json` envelope, which stays stable across terminals; the default pretty output picks columns to fit your terminal width. See [Output formats](/cli/output-formats).

## List articles

This command lists articles in your workspace, including drafts. Use this when you want to review what exists, filter by category or state, or collect IDs for another command.

```bash theme={"system"}
neetokb articles list
neetokb articles list --state draft
neetokb articles list --category-id b7e91c2a-8f43-4d0e-9a15-6c2d8e7f1b3a
```

| Flag            | Type     | Required | Default | Description                       |
| --------------- | -------- | -------- | ------- | --------------------------------- |
| `--category-id` | `string` |          |         | Filter by category ID             |
| `--order-by`    | `string` |          |         | Sort order (ASC/DESC)             |
| `--page`        | `int`    |          | `0`     | Page number                       |
| `--page-size`   | `int`    |          | `0`     | Items per page (max 100)          |
| `--search-term` | `string` |          |         | Search term                       |
| `--sort-by`     | `string` |          |         | Sort field                        |
| `--state`       | `string` |          |         | Filter by state (draft/published) |

```json Sample output (--json) theme={"system"}
{
  "data": [
    {
      "id": "a1b2c3d4-1111-2222-3333-444455556666",
      "slug": "getting-started",
      "title": "Getting Started Guide",
      "state": "published",
      "unique_views_count": 42,
      "category": {
        "id": "b7e91c2a-8f43-4d0e-9a15-6c2d8e7f1b3a",
        "name": "Getting Started"
      }
    }
  ],
  "breadcrumbs": [
    { "label": "Show", "command": "neetokb articles show <id>" },
    { "label": "Update", "command": "neetokb articles update <id>" }
  ],
  "pagination": {
    "total_records": 1,
    "total_pages": 1,
    "current_page_number": 1,
    "page_size": 30
  }
}
```

`--search-term` matches article content and titles. `--sort-by` names the field to order on and `--order-by` takes `ASC` or `DESC`.

## Search articles

This command runs a full-text search across your published articles, ranked by relevance. Use this when you know roughly what an article says but not where it lives; `articles list --search-term` filters the same corpus but returns the full list shape. For fields and response details, see the [API reference](/api-reference/search/get).

```bash theme={"system"}
neetokb search --search-term "billing"
```

| Flag            | Type     | Required | Default | Description              |
| --------------- | -------- | -------- | ------- | ------------------------ |
| `--page`        | `int`    |          | `0`     | Page number              |
| `--page-size`   | `int`    |          | `0`     | Items per page (max 100) |
| `--search-term` | `string` | Yes      |         | Search query             |

```json Sample output (--json) theme={"system"}
{
  "data": [
    {
      "id": "a1b2c3d4-1111-2222-3333-444455556666",
      "url": "https://spinkart.neetokb.com/articles/billing-and-invoices",
      "title": "Billing and invoices",
      "category": "Getting Started",
      "category_url": "https://spinkart.neetokb.com/folders/getting-started",
      "matched_title": "<span class=article-matched-tag>Billing</span> and invoices",
      "matched_content": "Your <span class=article-matched-tag>billing</span> cycle starts on the day you subscribe.",
      "matched_category": null
    }
  ],
  "breadcrumbs": [
    { "label": "Show article", "command": "neetokb articles show <id>" }
  ],
  "pagination": {
    "total_records": 1,
    "total_pages": 1,
    "current_page_number": 1,
    "page_size": 30
  }
}
```

## Show an article

This command shows the full record for one article, including its HTML body, author, category, and tags. Use this when you want to read or export an article after finding its ID from `articles list` or `search`.

```bash theme={"system"}
neetokb articles show getting-started
neetokb articles show a-84af178b
```

**Required arguments:**

* `<id>` - Article slug, permalink identifier (`a-XXXXXXXX`), or UUID

```json Sample output (--json) theme={"system"}
{
  "data": {
    "article": {
      "id": "a1b2c3d4-1111-2222-3333-444455556666",
      "slug": "getting-started",
      "title": "Getting Started Guide",
      "state": "published",
      "full_url": "https://spinkart.neetokb.com/articles/getting-started",
      "url": "/articles/getting-started",
      "html_content": "<h1>Welcome</h1><p>This is a getting started guide.</p>",
      "author": {
        "name": "Oliver Smith",
        "email": "oliver@example.com",
        "profile_image_url": null
      },
      "category": {
        "id": "b7e91c2a-8f43-4d0e-9a15-6c2d8e7f1b3a",
        "name": "Getting Started"
      }
    },
    "meta": {
      "url": "/articles/getting-started",
      "page_title": "Getting Started - Knowledge Base",
      "meta_description": "A comprehensive guide to help you get started with our platform"
    }
  }
}
```

## Create an article

This command creates an article in a category. Use this when you want to publish content from a script or a content pipeline instead of the editor.

```bash theme={"system"}
neetokb articles create \
  --title "Getting Started" \
  --slug getting-started \
  --category "Getting Started,Installation" \
  --html-content "<h1>Welcome</h1><p>Example content</p>" \
  --state draft
```

| Flag             | Type          | Required | Default | Description                                          |
| ---------------- | ------------- | -------- | ------- | ---------------------------------------------------- |
| `--category`     | `stringSlice` | Yes      | `[]`    | Category path (comma-separated, e.g. 'Parent,Child') |
| `--html-content` | `string`      |          |         | Article HTML content                                 |
| `--slug`         | `string`      |          |         | Article slug                                         |
| `--state`        | `string`      |          |         | Article state (draft/published)                      |
| `--title`        | `string`      |          |         | Article title                                        |

`--category` is the category path, most specific first: `"Installation,Getting Started"` places the article in `Installation`, whose parent is `Getting Started`. Names are matched, not IDs or slugs. Omit `--state` and the article is created as a draft.

```json Sample output (--json) theme={"system"}
{
  "data": {
    "article": {
      "id": "a1b2c3d4-1111-2222-3333-444455556666",
      "slug": "getting-started",
      "permalink": "a-84af178b"
    }
  },
  "breadcrumbs": [
    { "label": "Show", "command": "neetokb articles show <id>" }
  ]
}
```

With `--quiet`, this prints only the new article's ID.

## Update an article

This command updates an existing article's title, body, slug, or state. Use this to publish a draft, correct content, or rename an article's URL.

```bash theme={"system"}
neetokb articles update a-84af178b --title "Getting Started Guide"
neetokb articles update a-84af178b --state published
```

**Required arguments:**

* `<id>` - Article slug, permalink identifier (`a-XXXXXXXX`), or UUID

| Flag             | Type     | Required | Default | Description                     |
| ---------------- | -------- | -------- | ------- | ------------------------------- |
| `--html-content` | `string` |          |         | Article HTML content            |
| `--slug`         | `string` |          |         | Article slug                    |
| `--state`        | `string` |          |         | Article state (draft/published) |
| `--title`        | `string` |          |         | Article title                   |

Only the flags you pass are changed. `--slug` can be modified only while the article is published.

```json Sample output (--json) theme={"system"}
{
  "data": {
    "article": {
      "id": "a1b2c3d4-1111-2222-3333-444455556666",
      "slug": "getting-started",
      "title": "Getting Started Guide",
      "state": "published",
      "permalink": "a-84af178b"
    }
  }
}
```

## Unlisted links

An unlisted link is a secret URL that lets anyone view a published article without signing in. For fields and response details, see the [API reference](/api-reference/articles/get-unlisted-link).

### Get an unlisted link

This command fetches an article's unlisted link, creating a never-expiring one if the article does not have one yet. Use this when you want to share a published article outside your knowledge base.

```bash theme={"system"}
neetokb articles unlisted-links get getting-started
```

**Required arguments:**

* `<article-id>` - Article slug, permalink identifier (`a-XXXXXXXX`), or UUID

```json Sample output (--json) theme={"system"}
{
  "data": {
    "unlisted_link": {
      "url": "https://spinkart.neetokb.com/public/p-1a2b3c4d5e",
      "enabled": true,
      "expiration_type": "never",
      "expiration_date": null
    }
  },
  "breadcrumbs": [
    {
      "label": "Regenerate",
      "command": "neetokb articles unlisted-links regenerate <article-id>"
    }
  ]
}
```

An expired link is replaced with a fresh one automatically. The article must be published; a draft returns an error.

### Regenerate an unlisted link

This command issues a new unlisted link and invalidates the old URL immediately. Use this when a link has been shared too widely, or when you want the link to expire.

```bash theme={"system"}
neetokb articles unlisted-links regenerate getting-started
neetokb articles unlisted-links regenerate getting-started --expiration-type seven_days
neetokb articles unlisted-links regenerate getting-started \
  --expiration-type custom --expiration-date 2026-08-21T10:00:00Z
```

**Required arguments:**

* `<article-id>` - Article slug, permalink identifier (`a-XXXXXXXX`), or UUID

| Flag                | Type     | Required | Default | Description                                                                                                                                                            |
| ------------------- | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--expiration-date` | `string` |          |         | Exact expiry datetime (ISO8601, future). Required with --expiration-type custom; implies custom when --expiration-type is omitted; rejected alongside presets or never |
| `--expiration-type` | `string` |          |         | Expiration preset: never (default, no expiration), one\_day, seven\_days, thirty\_days, or custom; preset dates are computed server-side and reject --expiration-date  |

The presets `one_day`, `seven_days`, and `thirty_days` compute the expiry on the server and reject `--expiration-date`. Use `custom` together with `--expiration-date` for an exact time; passing `--expiration-date` alone is treated as `custom`.

```json Sample output (--json) theme={"system"}
{
  "data": {
    "unlisted_link": {
      "url": "https://spinkart.neetokb.com/public/p-9f8e7d6c5b",
      "enabled": true,
      "expiration_type": "seven_days",
      "expiration_date": "2026-08-07T10:00:00.000Z"
    }
  },
  "breadcrumbs": [
    {
      "label": "Get",
      "command": "neetokb articles unlisted-links get <article-id>"
    }
  ]
}
```
