Knowledge Base

get

Get all knowledge bases

Authorizations
Responses
200Success
application/json
get
GET /knowledge-bases HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer JWT
Accept: */*
{
  "data": [
    {
      "default_language": "text",
      "id": "text",
      "slug": "text",
      "supported_languages": [
        "text"
      ],
      "title": "text"
    }
  ],
  "pagination": {
    "cursor": "text",
    "has_next_page": true
  },
  "request_id": "text"
}
get

Get a knowledge base by its ID

Authorizations
Path parameters
idstringRequired

The ID of the knowledge base.

Responses
200Success
application/json
get
GET /knowledge-bases/{id} HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer JWT
Accept: */*
{
  "data": {
    "default_language": "text",
    "id": "text",
    "slug": "text",
    "supported_languages": [
      "text"
    ],
    "title": "text"
  },
  "request_id": "text"
}
get

List all collections in a knowledge base

Authorizations
Path parameters
idstringRequired

The ID of the knowledge base

Responses
200Success
application/json
get
GET /knowledge-bases/{id}/collections HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer JWT
Accept: */*
{
  "data": [
    {
      "created_at": "text",
      "description": "text",
      "id": "text",
      "parent_collection_id": "text",
      "slug": "text",
      "title": "text"
    }
  ],
  "request_id": "text"
}

Create a new article

post

This endpoint creates a new article in the specified knowledge base. If translations are provided, they will also be created and associated with the article. If the article is published, the translations will also be published.

Authorizations
Path parameters
idstringRequired

The ID of the knowledge base the article is being added to.

Body
author_user_idstringRequired

The ID of the user attributed as the author of the article.

body_htmlstringRequired

The HTML body of the article.

collection_idstringOptional

The id of the collection associated to the article

is_publishedbooleanOptional

Whether the article should be published. Defaults to false.

is_unlistedbooleanOptional

Whether the article can only be accessible only via direct link. Defaults to false.

slugstringOptional

The slug of the article. Defaults to a slug based on the title.

titlestringRequired

The title of the article.

Responses
200Success
application/json
post
POST /knowledge-bases/{id}/articles HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 248

{
  "author_user_id": "text",
  "body_html": "text",
  "collection_id": "text",
  "is_published": true,
  "is_unlisted": true,
  "slug": "text",
  "title": "text",
  "translations": [
    {
      "body_html": "text",
      "language": "text",
      "title": "text"
    }
  ],
  "visibility_config": {
    "visibility": "text"
  }
}
{
  "data": {
    "current_published_content_html": "text",
    "id": "text",
    "identifier": "text",
    "is_published": true,
    "last_published_at": "text",
    "slug": "text",
    "title": "text",
    "visibility_config": {
      "visibility": "text"
    }
  },
  "request_id": "text"
}
patch

Update an existing article

Authorizations
Path parameters
idstringRequired

The KnowledgeBaseID of the article to update.

article_idstringRequired

The ID of the article to update.

Body
body_htmlstringOptional

The HTML body of the article.

languagestringOptional

The language code of the translation to update. If not provided, the default language (original article) will be updated.

publish_updated_body_htmlbooleanOptional

Whether the changes to the article should be published. Defaults to false.

titlestringOptional

The title of the article.

Responses
200Success
application/json
patch
PATCH /knowledge-bases/{id}/articles/{article_id} HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 86

{
  "body_html": "text",
  "language": "text",
  "publish_updated_body_html": true,
  "title": "text"
}
{
  "data": {
    "current_published_content_html": "text",
    "id": "text",
    "identifier": "text",
    "is_published": true,
    "last_published_at": "text",
    "slug": "text",
    "title": "text",
    "visibility_config": {
      "visibility": "text"
    }
  },
  "request_id": "text"
}
post

Create a new collection

Authorizations
Path parameters
idstringRequired

The ID of the knowledge base the article is being added to.

Body
descriptionstringOptional

Description of the collection.

parent_collection_idstringOptional

The id of the collection associated to the article

slugstringOptional

The slug of the collection. Defaults to a slug based on the title.

titlestringRequired

The title of the collection.

Responses
200Success
application/json
post
POST /knowledge-bases/{id}/collections HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 81

{
  "description": "text",
  "parent_collection_id": "text",
  "slug": "text",
  "title": "text"
}
{
  "data": {
    "created_at": "text",
    "description": "text",
    "id": "text",
    "parent_collection_id": "text",
    "slug": "text",
    "title": "text"
  },
  "request_id": "text"
}
post

Create a new route redirect

Authorizations
Path parameters
idstringRequired

The ID of the knowledge base the route redirect is being added to.

Body
from_pathstringRequired

The path to redirect from.

languagestringOptional

Language of the object to redirect to. If not specified, the default language of the knowledge base will be used.

object_idstringRequired

The ID of the object to redirect to.

object_typestringRequired

The type of the object to redirect to. This must be "article".

Responses
200Success
application/json
post
POST /knowledge-bases/{id}/route-redirects HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 78

{
  "from_path": "text",
  "language": "text",
  "object_id": "text",
  "object_type": "text"
}
{
  "data": {
    "created_at": "text",
    "from_path": "text",
    "id": "text",
    "language": "text",
    "object_id": "text",
    "object_type": "text"
  },
  "request_id": "text"
}

Last updated

Was this helpful?