Skip to main content
POST
/
personalities
/
{personality_id}
/
knowledge
Add knowledge item
curl --request POST \
  --url https://api.spikelabs.com/v1/personalities/{personality_id}/knowledge \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "document",
  "name": "<string>",
  "url": "<string>",
  "content": "<string>",
  "refresh_interval": "never"
}
'
{
  "id": "kb_abc123",
  "object": "knowledge_item",
  "type": "document",
  "status": "pending",
  "created_at": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "source_url": "<string>",
  "content_preview": "<string>",
  "chunk_count": 123,
  "token_count": 123,
  "error": {
    "code": "<string>",
    "message": "<string>"
  },
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key authentication. Use your secret key (starts with sk_) as a Bearer token.

Path Parameters

personality_id
string
required

Personality ID (starts with personality_)

Body

type
enum<string>
Available options:
document,
url,
text,
feed
name
string
Maximum string length: 255
url
string<uri>

URL to fetch (for url/feed types)

content
string

Text content (for text type)

Maximum string length: 100000
refresh_interval
enum<string>
default:never

Auto-refresh for URL/feed types

Available options:
hourly,
daily,
weekly,
never

Response

Knowledge item created (processing)

id
string
required
Example:

"kb_abc123"

object
enum<string>
required
Available options:
knowledge_item
type
enum<string>
required
Available options:
document,
url,
text,
feed
status
enum<string>
required
Available options:
pending,
processing,
ready,
failed
created_at
string<date-time>
required
name
string
source_url
string<uri> | null
content_preview
string | null

First 500 characters

chunk_count
integer

Number of indexed chunks

token_count
integer

Total tokens

error
object
updated_at
string<date-time>