Clienvy API documentation

List knowledge items

GET
https://api.clienvy.io/employee/v1
/knowledge-items

Returns a paginated list of knowledge items without their content; the summary says what each one holds, so open only the ones you need. Every item lives in one place (parent_type, parent_id): the organization (organization, no id) or one record. A record falls under the company it belongs to (company).

  • company_id: everything of a company, including what lives on its contacts, deals, projects, websites, invoices and subscriptions.
  • model_type + model_id: what applies to one record: what lives on it and on the company it falls under (a deal also returns its company's knowledge). record then names that record.
  • company_id + model_type + model_id: the same for a record seen from that company, which it has to fall under: what lives on the record and on that company (record.company).
  • parent_types=organization: the organization's own knowledge.

List knowledge items › query Parameters

company_id
​string · uuid

Return everything of one company: what lives on it and on the records under it.

model_type
​string

Return what applies to one record: company, contact, deal, project, website, invoice or subscription. Use together with model_id.

model_id
​string · uuid

UUID of that record.

types
​string

Only return these types. Accepts a comma-separated list of note, transcript, skill.

parent_types
​string

Only return items living here: organization for the organization's own knowledge, or a kind of record, e.g. deal for what is on the deals of a company. Accepts a comma-separated list of organization, company, contact, deal, project, website, invoice, subscription.

search
​string

Search across title, description and content.

page
​integer

Page number of the paginated result set.

per_page
​integer

Number of items per page. Defaults to the endpoint's own page size; capped at 500.

List knowledge items › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List knowledge items › Responses

Array of KnowledgeItemListResource

​object

Create a knowledge item

POST
https://api.clienvy.io/employee/v1
/knowledge-items

Stores knowledge for AI use. Say where it lives: parent_type=organization for knowledge of the organization as a whole, or the record it is about (a company, contact, deal, project, website, invoice or subscription) as parent_type + parent_id. Knowledge on a deal or project shows up at its company as well, so put it on the most specific record. Give it a title, and a description that says what the item holds or when to use it: lists show the description, and for a skill it is how AI clients know when to use it. Send the content as markdown; Clienvy turns it into blocks for its editor. Skills are instructions, for the organization as a whole or for one record, such as a customer's monthly report on its company. Knowledge on a record needs the permission that changes that record (deal.edit for a deal, relation.edit for a company or contact); knowledge of the organization needs organization.manage-knowledge. Search the context first and update an existing item on the same subject rather than creating a near duplicate.

Create a knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Create a knowledge item › Request Body

type
​string · required

One of note (information), transcript (what was said in a call or meeting) or skill (an instruction an AI client follows). Any item can carry files, such as a briefing, contract or template.

parent_type
​string · required

Where the item lives: organization, or the type of the record it is on: company, contact, deal, project, website, invoice or subscription.

title
​string | null · maxLength: 255

A short title. Always give one, even though an item can be nameless.

description
​string · maxLength: 500

What the item holds or when to use it. Shown in lists instead of the content; for a skill it is how AI clients know when to use it, so always give one.

markdown
​string · maxLength: 500000

The content as markdown. At most 10,000 characters for a pinned item.

markdown_file_id
​string · uuid

Instead of markdown: an uploaded text file (such as txt, json, md, vtt or srt, up to 512 KB) whose text becomes the content, for a long transcript or document that is too large to send as markdown.

is_pinned
​boolean

Send the full content along whenever its context is used (the organization: every conversation; a company: whenever you work for that company) instead of only the summary. The organization profile is a pinned note.

parent_id
​string · uuid

UUID of that record. Leave it out for the organization.

Create a knowledge item › Responses

KnowledgeItemResource

id
​string · uuid
type
​string
title
​string | null

Null while the item is nameless.

description
​string | null
summary
​string

The description, or the start of the text when there is none.

markdown
​string

The content as markdown: read this one.

content
​array | null

The content as blocks of the Clienvy editor.

is_pinned
​string
parent_type
​string

Where the item lives: organization, or the type of the record it is on (company, contact, deal, project, website, invoice, subscription).

parent_id
​string | null

The record it is on; null for the organization.

​KnowledgeItemRecordResource | null

The record the item lives on, with its name; null for the organization.

​KnowledgeItemRecordResource | null

The company the item falls under: the company it lives on, or that of its record.

​FileResource[]
​EmployeeReferenceResource | null
created_at
​string | null · date-time
updated_at
​string | null · date-time
deleted_at
​string | null

List deleted knowledge items

GET
https://api.clienvy.io/employee/v1
/knowledge-items/trashed

Returns the knowledge items in the trash, most recently deleted first. A deleted item can be put back with the restore endpoint.

List deleted knowledge items › query Parameters

page
​integer

Page number of the paginated result set.

per_page
​integer

Number of items per page. Defaults to the endpoint's own page size; capped at 500.

List deleted knowledge items › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List deleted knowledge items › Responses

Array of KnowledgeItemListResource

​object

Get a trashed knowledge item

GET
https://api.clienvy.io/employee/v1
/knowledge-items/trashed/{knowledgeItem}

Returns a knowledge item from the trash as it was when it was deleted, to see what it held before restoring it.

Get a trashed knowledge item › path Parameters

knowledgeItem
​string · uuid · required

The knowledge item UUID

Get a trashed knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Get a trashed knowledge item › Responses

KnowledgeItemResource

id
​string · uuid
type
​string
title
​string | null

Null while the item is nameless.

description
​string | null
summary
​string

The description, or the start of the text when there is none.

markdown
​string

The content as markdown: read this one.

content
​array | null

The content as blocks of the Clienvy editor.

is_pinned
​string
parent_type
​string

Where the item lives: organization, or the type of the record it is on (company, contact, deal, project, website, invoice, subscription).

parent_id
​string | null

The record it is on; null for the organization.

​KnowledgeItemRecordResource | null

The record the item lives on, with its name; null for the organization.

​KnowledgeItemRecordResource | null

The company the item falls under: the company it lives on, or that of its record.

​FileResource[]
​EmployeeReferenceResource | null
created_at
​string | null · date-time
updated_at
​string | null · date-time
deleted_at
​string | null

Restore a deleted knowledge item

POST
https://api.clienvy.io/employee/v1
/knowledge-items/trashed/{knowledgeItem}/restore

Takes the item out of the trash. Takes the same permission as deleting it.

Restore a deleted knowledge item › path Parameters

knowledgeItem
​string · uuid · required

The knowledge item UUID

Restore a deleted knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Restore a deleted knowledge item › Responses

KnowledgeItemResource

id
​string · uuid
type
​string
title
​string | null

Null while the item is nameless.

description
​string | null
summary
​string

The description, or the start of the text when there is none.

markdown
​string

The content as markdown: read this one.

content
​array | null

The content as blocks of the Clienvy editor.

is_pinned
​string
parent_type
​string

Where the item lives: organization, or the type of the record it is on (company, contact, deal, project, website, invoice, subscription).

parent_id
​string | null

The record it is on; null for the organization.

​KnowledgeItemRecordResource | null

The record the item lives on, with its name; null for the organization.

​KnowledgeItemRecordResource | null

The company the item falls under: the company it lives on, or that of its record.

​FileResource[]
​EmployeeReferenceResource | null
created_at
​string | null · date-time
updated_at
​string | null · date-time
deleted_at
​string | null

Get a knowledge item

GET
https://api.clienvy.io/employee/v1
/knowledge-items/{knowledgeItem}

Returns a knowledge item with its content, parent and attachments. The content comes twice: markdown to read, and content as the blocks of the Clienvy editor. Read a text attachment (template, example) with the file endpoint.

Get a knowledge item › path Parameters

knowledgeItem
​string · uuid · required

The knowledge item UUID

Get a knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Get a knowledge item › Responses

KnowledgeItemResource

id
​string · uuid
type
​string
title
​string | null

Null while the item is nameless.

description
​string | null
summary
​string

The description, or the start of the text when there is none.

markdown
​string

The content as markdown: read this one.

content
​array | null

The content as blocks of the Clienvy editor.

is_pinned
​string
parent_type
​string

Where the item lives: organization, or the type of the record it is on (company, contact, deal, project, website, invoice, subscription).

parent_id
​string | null

The record it is on; null for the organization.

​KnowledgeItemRecordResource | null

The record the item lives on, with its name; null for the organization.

​KnowledgeItemRecordResource | null

The company the item falls under: the company it lives on, or that of its record.

​FileResource[]
​EmployeeReferenceResource | null
created_at
​string | null · date-time
updated_at
​string | null · date-time
deleted_at
​string | null

Update a knowledge item

PUT
https://api.clienvy.io/employee/v1
/knowledge-items/{knowledgeItem}

Changes a knowledge item; only the fields present are changed. parent_type (with parent_id for a record) moves it. Every change of the content is kept as a version that can be restored.

Update a knowledge item › path Parameters

knowledgeItem
​string · uuid · required

The knowledge item UUID

Update a knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Update a knowledge item › Request Body

title
​string | null · maxLength: 255
description
​string · maxLength: 500
markdown
​string · maxLength: 500000

The content as markdown; replaces the whole content.

markdown_file_id
​string · uuid

Instead of markdown: an uploaded text file whose text replaces the whole content.

is_pinned
​boolean
parent_type
​string
parent_id
​string · uuid

Update a knowledge item › Responses

KnowledgeItemResource

id
​string · uuid
type
​string
title
​string | null

Null while the item is nameless.

description
​string | null
summary
​string

The description, or the start of the text when there is none.

markdown
​string

The content as markdown: read this one.

content
​array | null

The content as blocks of the Clienvy editor.

is_pinned
​string
parent_type
​string

Where the item lives: organization, or the type of the record it is on (company, contact, deal, project, website, invoice, subscription).

parent_id
​string | null

The record it is on; null for the organization.

​KnowledgeItemRecordResource | null

The record the item lives on, with its name; null for the organization.

​KnowledgeItemRecordResource | null

The company the item falls under: the company it lives on, or that of its record.

​FileResource[]
​EmployeeReferenceResource | null
created_at
​string | null · date-time
updated_at
​string | null · date-time
deleted_at
​string | null

Delete a knowledge item

DELETE
https://api.clienvy.io/employee/v1
/knowledge-items/{knowledgeItem}

Moves the item to the trash, from where it can be restored for 30 days; after that it is deleted for good. Takes the permission that deletes the record it lives on (a deal: deal.delete), or organization.manage-knowledge for knowledge of the organization.

Delete a knowledge item › path Parameters

knowledgeItem
​string · uuid · required

The knowledge item UUID

Delete a knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Delete a knowledge item › Responses

KnowledgeItemResource

id
​string · uuid
type
​string
title
​string | null

Null while the item is nameless.

description
​string | null
summary
​string

The description, or the start of the text when there is none.

markdown
​string

The content as markdown: read this one.

content
​array | null

The content as blocks of the Clienvy editor.

is_pinned
​string
parent_type
​string

Where the item lives: organization, or the type of the record it is on (company, contact, deal, project, website, invoice, subscription).

parent_id
​string | null

The record it is on; null for the organization.

​KnowledgeItemRecordResource | null

The record the item lives on, with its name; null for the organization.

​KnowledgeItemRecordResource | null

The company the item falls under: the company it lives on, or that of its record.

​FileResource[]
​EmployeeReferenceResource | null
created_at
​string | null · date-time
updated_at
​string | null · date-time
deleted_at
​string | null

Add a file to a knowledge item

POST
https://api.clienvy.io/employee/v1
/knowledge-items/{knowledgeItem}/files

Attaches a file to a knowledge item, e.g. a template a skill uses: one uploaded with the file upload endpoint (file_id), or text with a name (including its extension) and its content, which is stored as a file.

Add a file to a knowledge item › path Parameters

knowledgeItem
​string · uuid · required

The knowledge item UUID

Add a file to a knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Add a file to a knowledge item › Request Body

file_id
​string · uuid

UUID of a file uploaded with the file upload endpoint.

name
​string · maxLength: 255

File name with extension when sending text, e.g. proposal-template.html.

content
​string

The text of the file when sending text.

Add a file to a knowledge item › Responses

KnowledgeItemResource

id
​string · uuid
type
​string
title
​string | null

Null while the item is nameless.

description
​string | null
summary
​string

The description, or the start of the text when there is none.

markdown
​string

The content as markdown: read this one.

content
​array | null

The content as blocks of the Clienvy editor.

is_pinned
​string
parent_type
​string

Where the item lives: organization, or the type of the record it is on (company, contact, deal, project, website, invoice, subscription).

parent_id
​string | null

The record it is on; null for the organization.

​KnowledgeItemRecordResource | null

The record the item lives on, with its name; null for the organization.

​KnowledgeItemRecordResource | null

The company the item falls under: the company it lives on, or that of its record.

​FileResource[]
​EmployeeReferenceResource | null
created_at
​string | null · date-time
updated_at
​string | null · date-time
deleted_at
​string | null

Get a file of a knowledge item

GET
https://api.clienvy.io/employee/v1
/knowledge-items/{knowledgeItem}/files/{file}

Returns a text attachment (txt, md, csv, json, xml, yml, yaml, html, css, scss, js, ts, php, sql, svg, log, vtt or srt) with its content, so a template or example can be read within this connection. Up to 512 KB; another file type, or a larger file, is opened through its url.

Get a file of a knowledge item › path Parameters

knowledgeItem
​string · uuid · required

The knowledge item UUID

file
​string · uuid · required

The file UUID

Get a file of a knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Get a file of a knowledge item › Responses

KnowledgeItemFileResource

id
​string · uuid
name
​string
file_type
​string
url
​string
content
​string

The file's text.


Remove a file from a knowledge item

DELETE
https://api.clienvy.io/employee/v1
/knowledge-items/{knowledgeItem}/files/{file}

Detaches the file. Earlier versions of the item still refer to it, so it can come back with a restore.

Remove a file from a knowledge item › path Parameters

knowledgeItem
​string · uuid · required

The knowledge item UUID

file
​string · uuid · required

The file UUID

Remove a file from a knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Remove a file from a knowledge item › Responses

KnowledgeItemResource

id
​string · uuid
type
​string
title
​string | null

Null while the item is nameless.

description
​string | null
summary
​string

The description, or the start of the text when there is none.

markdown
​string

The content as markdown: read this one.

content
​array | null

The content as blocks of the Clienvy editor.

is_pinned
​string
parent_type
​string

Where the item lives: organization, or the type of the record it is on (company, contact, deal, project, website, invoice, subscription).

parent_id
​string | null

The record it is on; null for the organization.

​KnowledgeItemRecordResource | null

The record the item lives on, with its name; null for the organization.

​KnowledgeItemRecordResource | null

The company the item falls under: the company it lives on, or that of its record.

​FileResource[]
​EmployeeReferenceResource | null
created_at
​string | null · date-time
updated_at
​string | null · date-time
deleted_at
​string | null

List versions of a knowledge item

GET
https://api.clienvy.io/employee/v1
/knowledge-items/{knowledgeItem}/versions

Returns the version history of the knowledge item, newest first, each version as markdown and with the files it had that still exist. Changes by the same employee, through the same AI connection, within a few minutes are combined into one version. The 100 most recent versions are kept.

List versions of a knowledge item › path Parameters

knowledgeItem
​string · uuid · required

The knowledge item UUID

List versions of a knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List versions of a knowledge item › Responses

Array of KnowledgeItemVersionResource

id
​string · uuid
​object[]

The content as it was, as blocks of the editor.

​object | null

What the record was besides its content, such as its title; null for a record that versions only its content.

​EmployeeReferenceResource | null
​ContactReferenceResource | null

The contact who made the version in the customer portal, if not an employee.

​OAuthConnectionReferenceResource | null

The AI connection the change was made through, if any.

created_at
​string | null · date-time
updated_at
​string | null · date-time
markdown
​string

The content of this version as markdown: read this one.

​FileResource[]

The files the item had, as far as they still exist.


Restore a version of a knowledge item

POST
https://api.clienvy.io/employee/v1
/knowledge-items/{knowledgeItem}/versions/{version}/restore

Puts an earlier version of the knowledge item back: its text, title, description, whether it is pinned and the files it had that still exist. The restore itself is stored as a new version, so it can be undone. Answers with the version that was put back.

Restore a version of a knowledge item › path Parameters

knowledgeItem
​string · uuid · required

The knowledge item UUID

version
​string · uuid · required

The version UUID, as listed by the versions endpoint.

Restore a version of a knowledge item › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Restore a version of a knowledge item › Responses

KnowledgeItemVersionResource

id
​string · uuid
​object[]

The content as it was, as blocks of the editor.

​object | null

What the record was besides its content, such as its title; null for a record that versions only its content.

​EmployeeReferenceResource | null
​ContactReferenceResource | null

The contact who made the version in the customer portal, if not an employee.

​OAuthConnectionReferenceResource | null

The AI connection the change was made through, if any.

created_at
​string | null · date-time
updated_at
​string | null · date-time
markdown
​string

The content of this version as markdown: read this one.

​FileResource[]

The files the item had, as far as they still exist.


List skill templates

GET
https://api.clienvy.io/employee/v1
/skill-templates

Returns the skill templates Clienvy provides: starting points for common skills, such as drawing up a proposal. A template is not an instruction: write the organization's own skill from it, in its language and fitted to how it works, and save that as a knowledge item.

List skill templates › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List skill templates › Responses

Array of SkillTemplateListResource

key
​string
title
​string
description
​string

When the skill is used.

files
​string[]

The names of the files that come with it, not their text: read one with GET /skill-templates/{template}/files/{name}.


Get a skill template

GET
https://api.clienvy.io/employee/v1
/skill-templates/{template}

Returns the text to write a skill from, and the names of the files that come with it.

Get a skill template › path Parameters

template
​string · required

The key of the template.

Get a skill template › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Get a skill template › Responses

SkillTemplateResource

key
​string
title
​string
description
​string

When the skill is used.

markdown
​string

The text to write the skill from.

files
​string[]

The names of the files that come with it, not their text: read one with GET /skill-templates/{template}/files/{name}.


Get a file of a skill template

GET
https://api.clienvy.io/employee/v1
/skill-templates/{template}/files/{name}

Returns the text of a file that comes with a template, e.g. an HTML template for proposals.

Get a file of a skill template › path Parameters

template
​string · required

The key of the template.

name
​string · required

The file name, as listed by the template.

Get a file of a skill template › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Get a file of a skill template › Responses

SkillTemplateFileResource

name
​string
content
​string

The file's text.