Knowledge Base

Get all knowledge bases

get

/knowledge-bases

Authorizations
Responses
curl -L \
  --url 'https://api.usepylon.com/knowledge-bases' \
  --header 'Authorization: Bearer JWT'
{
  "pagination": {
    "cursor": "text",
    "has_next_page": true
  },
  "request_id": "text",
  "data": [
    {
      "id": "text",
      "slug": "text",
      "title": "text"
    }
  ]
}

Get a knowledge base by its ID

get

/knowledge-bases/{id}

Authorizations
Path parameters
idstringrequired

The ID of the knowledge base.

Responses
curl -L \
  --url 'https://api.usepylon.com/knowledge-bases/{id}' \
  --header 'Authorization: Bearer JWT'
{
  "data": {
    "id": "text",
    "slug": "text",
    "title": "text"
  },
  "request_id": "text"
}

List all collections in a knowledge base

get

/knowledge-bases/{id}/collections

Authorizations
Path parameters
idstringrequired

The ID of the knowledge base

Responses
curl -L \
  --url 'https://api.usepylon.com/knowledge-bases/{id}/collections' \
  --header 'Authorization: Bearer JWT'
{
  "request_id": "text",
  "data": [
    {
      "created_at": "text",
      "description": "text",
      "id": "text",
      "parent_collection_id": "text",
      "slug": "text",
      "title": "text"
    }
  ]
}

Create a new article

post

/knowledge-bases/{id}/articles

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_idstring

The id of the collection associated to the article

is_publishedboolean

Whether the article should be published. Defaults to false.

is_unlistedboolean

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

slugstring

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

titlestringrequired

The title of the article.

visibility_configobject
Responses
curl -L \
  --request POST \
  --url 'https://api.usepylon.com/knowledge-bases/{id}/articles' \
  --header 'Authorization: Bearer JWT' \
  --header 'Content-Type: application/json' \
  --data '{"author_user_id":"text","body_html":"text","title":"text","visibility_config":{}}'
{
  "data": {
    "current_published_content_html": "text",
    "id": "text",
    "identifier": "text",
    "is_published": true,
    "slug": "text",
    "title": "text"
  },
  "request_id": "text"
}

Update an existing article

patch

/knowledge-bases/{id}/articles/{article_id}

Authorizations
Path parameters
idstringrequired

The KnowledgeBaseID of the article to update.

article_idstringrequired

The ID of the article to update.

Body
body_htmlstring

The HTML body of the article.

publish_updated_body_htmlboolean

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

titlestring

The title of the article.

Responses
curl -L \
  --request PATCH \
  --url 'https://api.usepylon.com/knowledge-bases/{id}/articles/{article_id}' \
  --header 'Authorization: Bearer JWT' \
  --header 'Content-Type: application/json'
{
  "data": {
    "current_published_content_html": "text",
    "id": "text",
    "identifier": "text",
    "is_published": true,
    "slug": "text",
    "title": "text"
  },
  "request_id": "text"
}

Create a new collection

post

/knowledge-bases/{id}/collections

Authorizations
Path parameters
idstringrequired

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

Body
descriptionstring

Description of the collection.

parent_collection_idstring

The id of the collection associated to the article

slugstring

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

titlestringrequired

The title of the collection.

Responses
curl -L \
  --request POST \
  --url 'https://api.usepylon.com/knowledge-bases/{id}/collections' \
  --header 'Authorization: Bearer JWT' \
  --header 'Content-Type: application/json' \
  --data '{"title":"text"}'
{
  "data": {
    "created_at": "text",
    "description": "text",
    "id": "text",
    "parent_collection_id": "text",
    "slug": "text",
    "title": "text"
  },
  "request_id": "text"
}

Create a new route redirect

post

/knowledge-bases/{id}/route-redirects

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.

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
curl -L \
  --request POST \
  --url 'https://api.usepylon.com/knowledge-bases/{id}/route-redirects' \
  --header 'Authorization: Bearer JWT' \
  --header 'Content-Type: application/json' \
  --data '{"from_path":"text","object_id":"text","object_type":"text"}'
{
  "data": {
    "created_at": "text",
    "from_path": "text",
    "id": "text",
    "object_id": "text",
    "object_type": "text"
  },
  "request_id": "text"
}

Last updated

Was this helpful?