Metadata, entries and binding as one document
POST
/worldbook/{worldbookId}/document
const url = 'https://api.harperharbor.com/open/v1/worldbook/example/document';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"metadata":{"name":"example","description":"example","tags":["example"]},"entries":[{"entryId":"example","name":"example","content":"example","keywords":["example"],"secondaryKeywords":["example"],"matchOptions":{"caseSensitive":true,"matchWholeWords":true,"selectiveLogic":1},"category":"example","isEnabled":true,"isConstant":true,"priority":1,"sortOrder":1,"lastUpdateTime":"example","activationCount":1,"op":"create"}],"binding":{"roleId":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.harperharbor.com/open/v1/worldbook/example/document \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "metadata": { "name": "example", "description": "example", "tags": [ "example" ] }, "entries": [ { "entryId": "example", "name": "example", "content": "example", "keywords": [ "example" ], "secondaryKeywords": [ "example" ], "matchOptions": { "caseSensitive": true, "matchWholeWords": true, "selectiveLogic": 1 }, "category": "example", "isEnabled": true, "isConstant": true, "priority": 1, "sortOrder": 1, "lastUpdateTime": "example", "activationCount": 1, "op": "create" } ], "binding": { "roleId": "example" } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”worldbookId
required
string
Request Body
Section titled “Request Body”Media typeapplication/json
object
metadata
object
name
string
description
string
tags
Array<string>
entries
Array
object
entryId
string
name
string
content
string
keywords
Array<string>
secondaryKeywords
AND gate — the entry fires only when a main keyword and one of these both appear.
Array<string>
matchOptions
null for native entries; { caseSensitive, matchWholeWords, selectiveLogic } for tavern-format worldbooks.
object
caseSensitive
boolean
matchWholeWords
boolean
selectiveLogic
0 any · 1 not all · 2 none · 3 all of secondaryKeywords
integer
category
string
isEnabled
boolean
isConstant
boolean
priority
integer
sortOrder
integer
lastUpdateTime
string
activationCount
integer
op
string
binding
object
roleId
string
Responses
Section titled “Responses”On update
Media typeapplication/json
object
createdEntryIds
Array<string>
updatedCount
integer
deletedCount
integer
bound
boolean
Examplegenerated
{ "createdEntryIds": [ "example" ], "updatedCount": 1, "deletedCount": 1, "bound": true}