# Endpoints

Source: https://help.eniston.io/api/endpoints

Before you can access any of the available endpoints, make sure to create a valid [access token](https://help.eniston.io/api/authentication). Also make sure to read the [introduction](https://help.eniston.io/api/introduction) to get familiar with our API.

- [Get all workspaces](#workspaces)
- [Get a single workspace](#workspace)
- [Get single category](#category)
- [Get single article](#article-single)
- [Get all articles](#articles)
- [Create article](#create-article)
- [Update article](#update-article)
- [Delete article](#delete-article)
- [Create category](#create-category)
- [Update category](#update-category)

## Get all workspaces

To get a list of your workspaces, you can access the `/api/bases` endpoint.

```php
$access_token = 't8ZMQLQiquuyMjHFqfqW0hlEvQsNioCQLLe9npgZ';

curl https://eniston.io/api/bases \
    -H "Authorization: Bearer $access_token" \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'
```

The response will be a list of all workspaces you created.

**Example response:**

```php
{
  "success": true,
  "bases": [
    {
      "id": "a04025b1-7964-47cz-9e9d-7175bn002bpf",
      "public": 1,
      "name": "ACME Knowledge Bases",
      "description": "<p>This is the description of your base in HTML.<\/p>",
      "meta_description": null,
      "custom_domain": "help.example.com",
      "custom_domain_active": 1,
      "allow_bots": 1,
      "custom_css": null,
      "theme": "docs"
    }
  ]
}
```

---

## Get single workspace

You may also access a single workspace by providing the ID of the workspace you want to access. Use the `/api/base/{id}` endpoint for this. Replace `{id}` with the id of the workspace which can be obtained via the before mentioned `/api/bases` endpoint.

You can also find the ID of your workspaces(s) within the workspace settings.

```php
$access_token = 't8ZMQLQiquuyMjHFqfqW0hlEvQsNioCQLLe9npgZ';

curl https://eniston.io/api/base/{id} \
    -H "Authorization: Bearer $access_token" \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'
```

The response is similar to the `/api/bases` endpoint, just on a per-workspace level.

**Example response:**

```php
{
  "success": true,
  "base": [
    {
      "id": "a04025b1-7964-47cz-9e9d-7175bn002bpf",
      "public": 1,
      "name": "ACME Knowledge Bases",
      "description": "<p>This is the description of your base in HTML.<\/p>",
      "meta_description": null,
      "custom_domain": "help.example.com",
      "custom_domain_active": 1,
      "allow_bots": 1,
      "custom_css": null,
      "theme": "docs"
    }
  ]
}
```

---

## Get single category

If you want to access a category, use the `/api/category/{id}` endpoint. Replace `{id}` with the ID of the category. You can find the ID of each category in the category settings.

```php
$access_token = 't8ZMQLQiquuyMjHFqfqW0hlEvQsNioCQLLe9npgZ';

curl https://eniston.io/api/category/{id} \
    -H "Authorization: Bearer $access_token" \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'
```

The response will be the category information, as well as all articles within that category. Only published articles will be listed and drafts will be ignored for this request.

**Example response:**

```php
{
  "success": true,
  "category": {
    "id": "086e359c-ba2d-3726-8ac8-22541d439edc",
    "base_id": "bf2003ad-9087-4980-ae87-1e8d40d92a5a",
    "name": "This is my category title",
    "icon": null,
    "font_icon": null,
    "description": "Velit et dolorem ut ut dolores enim explicabo. Commodi a praesentium pariatur quasi nulla et corrupti. Autem asperiores voluptas deserunt occaecati voluptas sed est.",
    "meta_description": null,
    "slug": "my-category-slug",
    "updated_at": "2021-08-07T13:20:05.000000Z",
    "articles": [
      {
        "id": "473edce6-ec9a-370b-a047-b527ca1613fc",
        "category_id": "086e359c-ba2d-3726-8ac8-22541d439edc",
        "title": "Necessitatibus qui perspiciatis tempore architecto repellat qui.",
        "slug": "necessitatibus-qui-perspiciatis-tempore-architecto-repellat-qui-1",
        "text": "<p>HTML formatted output<\/p>",
        "views": 14,
        "rating_happy": 3,
        "rating_neutral": 0,
        "rating_sad": 8,
        "keywords": null,
        "introtext": null,
        "updated_at": "2021-11-18T16:16:31.000000Z"
      },
      {
        "id": "968f7ed9-a3f6-3d0d-b75c-5c4454eb8c3a",
        "category_id": "086e359c-ba2d-3726-8ac8-22541d439edc",
        "title": "Nisi praesentium aut sit voluptatem.",
        "slug": "occaecati-asperiores-optio-facilis-deleniti",
        "text": "<p>HTML formatted output<\/p>",
        "views": 24,
        "rating_happy": 2,
        "rating_neutral": 3,
        "rating_sad": 4,
        "keywords": null,
        "introtext": null,
        "updated_at": "2021-08-07T12:29:43.000000Z"
      },
      {
        "id": "99eb3e36-46d4-3a73-8ee9-a71ee6ff89ea",
        "category_id": "086e359c-ba2d-3726-8ac8-22541d439edc",
        "title": "Fugit eum vitae ut quia ad.",
        "slug": "laborum-veritatis-illum-et-voluptatem",
        "text": "<p>HTML formatted output<\/p>",
        "views": 59,
        "rating_happy": 9,
        "rating_neutral": 0,
        "rating_sad": 0,
        "keywords": null,
        "introtext": null,
        "updated_at": "2021-10-15T07:39:29.000000Z"
      }
    ]
  }
}
```

---

## Get single article

Use the `/api/article/{id}` endpoint to get information about a specific article. Replace `{id}` with the ID of the article you want to access. You can find the ID of the articles within the article settings.

Only published articles can be accessed via the API.

```php
$access_token = 't8ZMQLQiquuyMjHFqfqW0hlEvQsNioCQLLe9npgZ';

curl https://eniston.io/api/article/{id} \
    -H "Authorization: Bearer $access_token" \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'
```

**Example response:**

```php
{
  "success": true,
  "article": {
    "id": "99eb3e36-46d4-3a73-8ee9-a71ee6ff89ea",
    "category_id": "086e359c-ba2d-3726-8ac8-22541d439edc",
    "title": "Fugit eum vitae ut quia ad.",
    "slug": "laborum-veritatis-illum-et-voluptatem",
    "text": "<p>Corporis nostrum laboriosam enim non. Possimus aut magnam praesentium ut rem ut. Ipsa ut enim nihil praesentium voluptatem tenetur ipsa.<\/p>",
    "views": 59,
    "rating_happy": 9,
    "rating_neutral": 6,
    "rating_sad": 3,
    "keywords": null,
    "introtext": null,
    "updated_at": "2021-10-15T07:39:29.000000Z",
    "full_url": "https://help.example.com/category-slug/article-slug"
  }
}
```

---

## Get all articles

Use the endpoint `api/base/{WORKSPACE-ID}/articles` to get all articles in a workspace. Replace `{WORKSPACE-ID}` with the ID of your workspace. You can find the ID in the workspace settings. Only published articles can be accessed via the API.

```php
$access_token = 't8ZMQLQiquuyMjHFqfqW0hlEvQsNioCQLLe9npgZ';

curl https://eniston.io/api/base/{id}/articles \
    -H "Authorization: Bearer $access_token" \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json'
```

---

## Create article

Creates a new article in a category.

**Endpoint:** `POST /api/article`

**Parameters:**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `category_id` | string | Yes | The UUID of the category the article belongs to. |
| `title` | string | Yes | The article title (max 255 characters). |
| `slug` | string | No | A URL-friendly slug. Auto-generated from the title if omitted. |
| `text` | string | No | The article body content (HTML). |
| `enabled` | boolean | No | Whether the article is enabled. Defaults to `true`. |
| `draft` | boolean | No | Whether the article is a draft. Defaults to `false`. |
| `introtext` | string | No | A short intro or excerpt (max 255 characters). |
| `keywords` | string | No | Keywords for search (max 255 characters). |

You are **not** able to change the `draft` attribute via the `PUT` method below. If you create an article via API, you can only update the `enabled` attribute. When an article is created as draft, you can only publish it manually via our dashboard.



**Example request:**

```php
curl -X POST https://eniston.io/api/article \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "category_id": "9a1b2c3d-4e5f-6789-abcd-ef0123456789",
    "title": "Getting Started",
    "text": "<p>Welcome to our guide.</p>",
    "introtext": "A quick introduction to get you started.",
    "keywords": "getting started, introduction, guide"
  }'
```

**Example response (201):**

```php
{
  "success": true,
  "article": {
    "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "user_id": 1,
    "category_id": "9a1b2c3d-4e5f-6789-abcd-ef0123456789",
    "title": "Getting Started",
    "slug": "getting-started",
    "text": "<p>Welcome to our guide.</p>",
    "enabled": true,
    "draft": false,
    "introtext": "A quick introduction to get you started.",
    "keywords": "getting started, introduction, guide",
    "updated_at": "2026-02-20T10:30:00.000000Z",
    "created_at": "2026-02-20T10:30:00.000000Z"
  }
}
```

**Error responses:**

- `403` — You don't have permission to create articles in this category's workspace.
- `422` — Validation error, or an article with this slug already exists in the category.

---

## Update article

Updates an existing article. Only the fields you include in the request body will be changed.

**Endpoint:** `PUT /api/article/{id}`

**Parameters:**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `category_id` | string | No | Move the article to a different category by providing its UUID. |
| `title` | string | No | The article title (max 255 characters). |
| `slug` | string | No | A URL-friendly slug (max 255 characters). |
| `text` | string | No | The article body content (HTML). |
| `enabled` | boolean | No | Whether the article is enabled. |
| `introtext` | string | No | A short intro or excerpt (max 255 characters). |
| `keywords` | string | No | Keywords for search (max 255 characters). |

**Example request:**

```php
curl -X PUT https://eniston.io/api/article/f47ac10b-58cc-4372-a567-0e02b2c3d479 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "title": "Getting Started (Updated)",
    "text": "<p>Welcome to our updated guide.</p>"
  }'
```

**Example response (200):**

```php
{
  "success": true,
  "article": {
    "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "category_id": "9a1b2c3d-4e5f-6789-abcd-ef0123456789",
    "title": "Getting Started (Updated)",
    "slug": "getting-started",
    "text": "<p>Welcome to our updated guide.</p>",
    "enabled": true,
    "draft": false,
    "introtext": "A quick introduction to get you started.",
    "keywords": "getting started, introduction, guide",
    "updated_at": "2026-02-20T11:00:00.000000Z",
    "created_at": "2026-02-20T10:30:00.000000Z"
  }
}
```

**Error responses:**

- `403` — You don't have permission to update this article, or to move it to the target category.
- `404` — Article not found.
- `422` — Validation error, or an article with this slug already exists in the target category.

---

## Delete article

Permanently deletes an article and removes it from the search index.

**Endpoint:** `DELETE /api/article/{id}`

**Example request:**

```php
curl -X DELETE https://eniston.io/api/article/f47ac10b-58cc-4372-a567-0e02b2c3d479 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
```

**Example response (200):**

```php
{
  "success": true,
  "message": "Article deleted successfully"
}
```

**Error responses:**

- `403` — You don't have permission to delete this article.
- `404` — Article not found.

---

## Create category

Creates a new category in a workspace.

**Endpoint:** `POST /api/category`

**Parameters:**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `base_id` | string | Yes | The UUID of the workspace the category belongs to. |
| `name` | string | Yes | The category name (max 255 characters). |
| `slug` | string | No | A URL-friendly slug. Auto-generated from the name if omitted. |
| `description` | string | No | A description of the category. |
| `meta_description` | string | No | A meta description for SEO purposes. |

**Example request:**

```php
curl -X POST https://eniston.io/api/category \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "base_id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
    "name": "FAQs",
    "description": "Frequently asked questions",
    "meta_description": "Find answers to frequently asked questions."
  }'
```

**Example response (201):**

```php
{
  "success": true,
  "category": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
    "user_id": 1,
    "base_id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
    "name": "FAQs",
    "slug": "faqs",
    "description": "Frequently asked questions",
    "meta_description": "Find answers to frequently asked questions.",
    "updated_at": "2026-02-20T10:30:00.000000Z",
    "created_at": "2026-02-20T10:30:00.000000Z"
  }
}
```

**Error Responses:**

- `403` — You don't have permission to create categories in this workspace.
- `422` — Validation error, or a category with this slug already exists in the workspace.

---

## Update category

Updates an existing category. Only the fields you include in the request body will be changed.

**Endpoint:** `PUT /api/category/{id}`

**Parameters:**

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | No | The category name (max 255 characters). |
| `slug` | string | No | A URL-friendly slug (max 255 characters). |
| `description` | string | No | A description of the category. |
| `meta_description` | string | No | A meta description for SEO purposes. |

**Example request:**

```php
curl -X PUT https://eniston.io/api/category/a1b2c3d4-e5f6-7890-abcd-ef0123456789 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Frequently Asked Questions",
    "description": "Updated description for our FAQ section."
  }'
```

**Example response (200):**

```php
{
  "success": true,
  "category": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
    "base_id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789",
    "name": "Frequently Asked Questions",
    "slug": "faqs",
    "description": "Updated description for our FAQ section.",
    "meta_description": "Find answers to frequently asked questions.",
    "updated_at": "2026-02-20T11:00:00.000000Z",
    "created_at": "2026-02-20T10:30:00.000000Z"
  }
}
```

**Error responses:**

- `403` — You don't have permission to update this category.
- `404` — Category not found.
- `422` — Validation error, or a category with this slug already exists in the workspace.
