Zum Inhalt springen

Account Documents

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

List of valid attributes:

Attribute Description Specifics
account_id ID of the account an account-document belongs to Cannot be set
created_at Timestamp of document creation Cannot be set
extension File extension, e.g. pdf Required field. Must be either docx, csv, pdf or txt, Cannot be updated
name Name for a document Required field. Maximum length is 250 code points
team_ids Array of IDs of teams who should be granted document access in AI knowledge base Optional
upload_status File upload status Can only be set on update. Must be either uploading, success or error
vectorization_status Vectorization status of a document Can only be set on update. Must be either non_vectorized, succeeded or failed

Meta data: Permissions

Group Description
actions Contains permissions to edit or delete an account document

Meta data: Upload/Download URL

Parameter Allowed values Description
download_url true/false When passing true on GET endpoints, it generates a temporary URL to use for downloading the account document
upload_url true/false When passing true on CREATE endpoint, it generates a temporary URL to use for uploading the account document

Note: upload_url returns a presigned POST S3 object, which contains url and fields keys, which can be used for HTML form. Maximum file size for upload is 100MB.

Example request:

{
"data": {
"type": "account_document",
"data": {
"attributes": {
"extension": "pdf",
"name": "Account Document Name",
"team_ids": ["team_id_1", "team_id_2"]
}
}
}
}

Example response:

{
"data": {
"id": "66370ab1-8d08-4a03-b0ac-4ba83c8f101d",
"type": "account_document",
"attributes": {
...
}
}
}

On success, this endpoint creates a new account document with upload_status = "uploading" and vectorization_status = "not_vectorized". Also generates a presigned URL for uploading the document, if upload_url meta is passed.

POST /api/v1/account_documents

Example request:

{
"data": {
"type": "account_document",
"data": {
"attributes": {
"name": "Document Name",
"upload_status": "success",
"team_ids": ["team_id_1", "team_id_2"]
}
}
}
}

Example response:

{
"data": {
"id": "52370ab1-7d08-4a03-b0ac-4ba63c8f209d",
"type": "account_document",
"attributes": {
...
}
}
}

On success, this endpoint updates the account document with the given ID and returns it.

PUT /api/v1/account_documents/:account_document_id

Parameter Description
account_document_id The ID of the account document to update

Example response:

{
"data": [
{
"id": "0a7cd22a-ceab-4b38-a6a2-1ea9e550ca53",
"type": "account_document",
"attributes": {
...
}
},
{
...
}
]
}

This endpoint returns all account documents.

GET /api/v1/account_documents

Example response:

{
"data": {
"id": "3aab0a84-8ed3-4ddf-8572-f1799bb60e0a",
"type": "account_document",
"attributes": {
...
}
}
}

This endpoint returns an account document.

GET /api/v1/account_documents/:account_document_id

Parameter Description
account_document_id The ID of the account document to return

Example response:

{
"data": {
"id": "bfcde02e-7e9e-4706-9504-ae0cecd5019c",
"type": "account_document",
"attributes": {
...
}
}
}

This endpoint deletes an account document with the given ID.

DELETE /api/v1/account_documents/:account_document_id

Parameter Description
account_document_id The ID of the account document to delete

Example response:

{
"data": {
"id": "bfcde02e-7e9e-4706-9504-ae0cecd5019c",
"type": "account_document",
"attributes": {
"vectorization_status": "succeeded",
...
}
}
}

This endpoint vectorizes an account document with the given ID and thus makes the information available to AI-agent @Pulse.

CREATE /api/v1/account_documents/:account_document_id/vectorize

Parameter Description
account_document_id The ID of the account document to vectorize

Example response:

{
"data": {
"id": "bfcde02e-7e9e-4706-9504-ae0cecd5019c",
"type": "account_document",
"attributes": {
"vectorization_status": "not_vectorized",
...
}
}
}

This endpoint de-vectorizes an account document with the given ID. This means that the information contained in this document is no longer available to the AI-agent @Pulse.

DELETE /api/v1/account_documents/:account_document_id/vectorize

Parameter Description
account_document_id The ID of the account document to de-vectorize