@botpress/api 1.48.2 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-openapi.log +6 -6
- package/dist/index.js +21 -5
- package/dist/src/gen/files/state.d.ts +7 -0
- package/dist/src/gen/state.d.ts +7 -0
- package/package.json +1 -1
- package/src/gen/admin/openapi.json +1 -1
- package/src/gen/admin/state.ts +1 -1
- package/src/gen/files/openapi.json +1 -1
- package/src/gen/files/state.ts +9 -1
- package/src/gen/openapi.json +1 -1
- package/src/gen/runtime/openapi.json +1 -1
- package/src/gen/runtime/state.ts +1 -1
- package/src/gen/state.ts +9 -1
- package/src/gen/tables/openapi.json +1 -1
- package/src/gen/tables/state.ts +1 -1
package/src/gen/admin/state.ts
CHANGED
|
@@ -14063,7 +14063,7 @@ export const state = {
|
|
|
14063
14063
|
"title": "Botpress Admin API",
|
|
14064
14064
|
"description": "API for Botpress Cloud Manager",
|
|
14065
14065
|
"server": "https://api.botpress.cloud",
|
|
14066
|
-
"version": "1.
|
|
14066
|
+
"version": "1.49.0",
|
|
14067
14067
|
"prefix": "v1"
|
|
14068
14068
|
},
|
|
14069
14069
|
"errors": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openapi":"3.0.0","servers":[{"url":"https://api.botpress.cloud"}],"info":{"title":"Botpress Files API","description":"API for Botpress Files","version":"1.48.2"},"paths":{"/v1/files":{"put":{"operationId":"upsertFile","description":"Creates or updates a file using the `key` parameter as unique identifier. Updating a file will erase the existing content of the file. Upload the file content by sending it in a PUT request to the `uploadUrl` returned in the response.","parameters":[{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/upsertFileResponse"},"default":{"$ref":"#/components/responses/upsertFileResponse"}},"requestBody":{"$ref":"#/components/requestBodies/upsertFileBody"}},"get":{"operationId":"listFiles","description":"List files for bot","parameters":[{"name":"nextToken","in":"query","description":"Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results","schema":{"type":"string"}},{"name":"sortField","in":"query","description":"Sort results by this field","schema":{"type":"string","enum":["key","size","createdAt","updatedAt","status"]}},{"name":"sortDirection","in":"query","description":"Sort results in this direction","schema":{"type":"string","enum":["asc","desc"]}},{"name":"tags","in":"query","description":"Filter files by tags. Tags should be passed as a URL-encoded JSON object of key-value pairs that must be present in the tags of a file. An array of multiple string values for the same key are treated as an OR condition. To exclude a value, express it as an object with a nested `not` key with the string or string-array value(s) to exclude.","schema":{}},{"name":"ids","in":"query","description":"Filter files by IDs.","schema":{"type":"array","items":{"type":"string"},"maxItems":50}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/listFilesResponse"},"default":{"$ref":"#/components/responses/listFilesResponse"}}}},"/v1/files/{id}":{"delete":{"operationId":"deleteFile","description":"Deletes a file.","parameters":[{"name":"id","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/deleteFileResponse"},"default":{"$ref":"#/components/responses/deleteFileResponse"}}},"get":{"operationId":"getFile","description":"Get file","parameters":[{"name":"id","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/getFileResponse"},"default":{"$ref":"#/components/responses/getFileResponse"}}},"put":{"operationId":"updateFileMetadata","description":"Update file metadata, without updating the file content.","parameters":[{"name":"id","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/updateFileMetadataResponse"},"default":{"$ref":"#/components/responses/updateFileMetadataResponse"}},"requestBody":{"$ref":"#/components/requestBodies/updateFileMetadataBody"}}},"/v1/files/{idOrKey}/{destinationKey}":{"post":{"operationId":"copyFile","description":"Copy file","parameters":[{"name":"idOrKey","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"destinationKey","in":"path","description":"The new key of the file. The file key must not be in use already in the destination bot.","required":true,"schema":{"type":"string"}},{"name":"x-destination-bot-id","in":"header","description":"The bot ID to copy the file to. You must have permission to create files in the destination bot. If the destination bot ID is omitted, the file will be copied to the same bot the source file belongs to.","schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/copyFileResponse"},"default":{"$ref":"#/components/responses/copyFileResponse"}},"requestBody":{"$ref":"#/components/requestBodies/copyFileBody"}}},"/v1/files/search":{"get":{"operationId":"searchFiles","description":"Search files","parameters":[{"name":"tags","in":"query","description":"Filter files by tags. Tags should be passed as a URL-encoded JSON object of key-value pairs that must be present in the tags of a file. An array of multiple string values for the same key are treated as an OR condition. To exclude a value, express it as an object with a nested `not` key with the string or string-array value(s) to exclude.","schema":{}},{"name":"query","in":"query","description":"Query expressed in natural language to retrieve matching text passages within all indexed files in the bot using semantical search.","required":true,"schema":{"type":"string"}},{"name":"contextDepth","in":"query","description":"The number of neighbor passages to prepend and append as surrounding context to the content of each returned passage (default: 1, minimum: 0, maximum: 10).","schema":{"type":"integer"}},{"name":"limit","in":"query","description":"The maximum number of passages to return.","schema":{"type":"integer"}},{"name":"consolidate","in":"query","description":"Consolidate the results by merging matching passages from the same file into a single passage per file. The consolidated passage will include the matching passages ordered by their original position in the file (rather than by relevance score) and include hierarchical context such as the title/subtitle to which they belong.","schema":{"type":"boolean"}},{"name":"includeBreadcrumb","in":"query","description":"Prepend a breadcrumb to each passage, containing the title and subtitle(s) the passage belongs to in the file. This option is ignored when the `consolidate` option is set to `true`.","schema":{"type":"boolean"}},{"name":"withContext","in":"query","description":"Include the surrounding context with each passage in the `context` property of each passage. Not supported when `consolidate` is set to `true`.","schema":{"type":"boolean"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/searchFilesResponse"},"default":{"$ref":"#/components/responses/searchFilesResponse"}}}},"/v1/files/{id}/passages":{"get":{"operationId":"listFilePassages","description":"List passages for a file","parameters":[{"name":"nextToken","in":"query","description":"Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results","schema":{"type":"string"}},{"name":"id","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"The maximum number of passages to return per request (optional, default: 20, max: 200).","schema":{"type":"number"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/listFilePassagesResponse"},"default":{"$ref":"#/components/responses/listFilePassagesResponse"}}},"put":{"operationId":"setFilePassages","description":"Sets the indexed file passages asynchronously. All existing indexed passages will be deleted as soon as the indexing begins. This endpoint will return immediately and set the file status to \"indexing_pending\". Once the new passages are indexed the file status will be set to \"indexing_completed\", or \"indexing_failed\" if the passages failed to be indexed.","parameters":[{"name":"id","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/setFilePassagesResponse"},"default":{"$ref":"#/components/responses/setFilePassagesResponse"}},"requestBody":{"$ref":"#/components/requestBodies/setFilePassagesBody"}}},"/v1/files/tags":{"get":{"operationId":"listFileTags","description":"List available tags","parameters":[{"name":"nextToken","in":"query","description":"Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results","schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/listFileTagsResponse"},"default":{"$ref":"#/components/responses/listFileTagsResponse"}}}},"/v1/files/tags/{tag}/values":{"get":{"operationId":"listFileTagValues","description":"List available tags","parameters":[{"name":"nextToken","in":"query","description":"Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results","schema":{"type":"string"}},{"name":"tag","in":"path","description":"Tag name","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/listFileTagValuesResponse"},"default":{"$ref":"#/components/responses/listFileTagValuesResponse"}}}},"/v1/files/knowledge-bases":{"post":{"operationId":"createKnowledgeBase","description":"Creates a knowledge base for grouping files.","parameters":[{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/createKnowledgeBaseResponse"},"default":{"$ref":"#/components/responses/createKnowledgeBaseResponse"}},"requestBody":{"$ref":"#/components/requestBodies/createKnowledgeBaseBody"}},"get":{"operationId":"listKnowledgeBases","description":"List knowledge bases for bot","parameters":[{"name":"nextToken","in":"query","description":"Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results","schema":{"type":"string"}},{"name":"tags","in":"query","description":"Filter files by tags. Tags should be passed as a URL-encoded JSON object of key-value pairs that must be present in the tags of a file. An array of multiple string values for the same key are treated as an OR condition. To exclude a value, express it as an object with a nested `not` key with the string or string-array value(s) to exclude.","schema":{}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/listKnowledgeBasesResponse"},"default":{"$ref":"#/components/responses/listKnowledgeBasesResponse"}}}},"/v1/files/knowledge-bases/{id}":{"delete":{"operationId":"deleteKnowledgeBase","description":"Deletes a knowledge base.","parameters":[{"name":"id","in":"path","description":"Knowledge base ID","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/deleteKnowledgeBaseResponse"},"default":{"$ref":"#/components/responses/deleteKnowledgeBaseResponse"}}},"put":{"operationId":"updateKnowledgeBase","description":"Updates a knowledge base.","parameters":[{"name":"id","in":"path","description":"Knowledge base ID","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/updateKnowledgeBaseResponse"},"default":{"$ref":"#/components/responses/updateKnowledgeBaseResponse"}},"requestBody":{"$ref":"#/components/requestBodies/updateKnowledgeBaseBody"}}}},"components":{"schemas":{"File":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"],"additionalProperties":false},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner"],"additionalProperties":false}},"responses":{"upsertFileResponse":{"description":"The created or updated file","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"],"additionalProperties":false},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."},"uploadUrl":{"type":"string","description":"URL to upload the file content. File content needs to be sent to this URL via a PUT request."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner","uploadUrl"],"additionalProperties":false}},"required":["file"],"title":"upsertFileResponse","additionalProperties":false}}}},"deleteFileResponse":{"description":"Empty response.","content":{"application/json":{"schema":{"type":"object","title":"deleteFileResponse","additionalProperties":false}}}},"listFilesResponse":{"description":"Returns the list of files related to the bot.","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"]},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner"]}},"meta":{"type":"object","properties":{"nextToken":{"type":"string","description":"The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."}},"additionalProperties":false}},"required":["files","meta"],"title":"listFilesResponse","additionalProperties":false}}}},"getFileResponse":{"description":"An object containing the file metadata and URL","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"],"additionalProperties":false},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner"],"additionalProperties":false}},"required":["file"],"title":"getFileResponse","additionalProperties":false}}}},"updateFileMetadataResponse":{"description":"An object containing the updated file metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"],"additionalProperties":false},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner"],"additionalProperties":false}},"required":["file"],"title":"updateFileMetadataResponse","additionalProperties":false}}}},"copyFileResponse":{"description":"An object containing the file metadata and URL","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"],"additionalProperties":false},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner"],"additionalProperties":false}},"required":["file"],"title":"copyFileResponse","additionalProperties":false}}}},"searchFilesResponse":{"description":"Returns the text passages within all indexed files that matched the query.","content":{"application/json":{"schema":{"type":"object","properties":{"passages":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string","description":"The content of the matching passage in the file including surrounding context, if any."},"score":{"type":"number","description":"The score indicating the similarity of the passage to the query. A higher score indicates higher similarity."},"meta":{"type":"object","properties":{"type":{"type":"string","enum":["chunk","summary","consolidated","image"],"description":"The type of passage"},"subtype":{"type":"string","enum":["title","subtitle","paragraph","blockquote","list","table","code","image","page"],"description":"The subtype of passage, if available."},"pageNumber":{"type":"integer","description":"Page number the passage is located on. Only applicable if the passage was extracted from a PDF file."},"position":{"type":"integer","description":"Position number of the passage in the file relative to the other passages, if available. Can be used to know the order of passages within a file."},"sourceUrl":{"type":"string","format":"uri","description":"The URL of the source file for the vector, if applicable (e.g. for image vectors)."}},"description":"The passage metadata."},"file":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key-value pairs."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"}},"required":["id","key","contentType","tags","createdAt","updatedAt"]},"context":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The ID of the vector that the context passage belongs to. Omitted for breadcrumbs."},"text":{"type":"string"},"offset":{"type":"integer","description":"Position of the context passage relative to the current passage. Negative for preceding passages, positive for subsequent, ommited for breadcrumbs."},"type":{"type":"string","enum":["preceding","subsequent","current","breadcrumb"],"description":"The type of context passage"}},"required":["text","type"]},"description":"Surrounding passages including the current passage, based on the requested `contextDepth`. Only returned if the `withContext` parameter is set to `true`. Not supported when using the `consolidate` option."}},"required":["content","score","meta","file"]}}},"required":["passages"],"title":"searchFilesResponse","additionalProperties":false}}}},"listFilePassagesResponse":{"description":"Returns the list of passages extracted from a file.","content":{"application/json":{"schema":{"type":"object","properties":{"passages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Passage ID"},"content":{"type":"string","description":"The content of the passage."},"meta":{"type":"object","properties":{"type":{"type":"string","enum":["chunk","summary","consolidated","image"],"description":"The type of passage"},"subtype":{"type":"string","enum":["title","subtitle","paragraph","blockquote","list","table","code","image","page"],"description":"The subtype of passage, if available."},"pageNumber":{"type":"integer","description":"Page number the passage is located on. Only applicable if the passage was extracted from a PDF file."},"position":{"type":"integer","description":"Position number of the passage in the file relative to the other passages, if available. Can be used to know the order of passages within a file."},"sourceUrl":{"type":"string","format":"uri","description":"The URL of the source file for the vector, if applicable (e.g. for image vectors)."}},"description":"The passage metadata."}},"required":["id","content","meta"]}},"meta":{"type":"object","properties":{"nextToken":{"type":"string","description":"The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."}},"additionalProperties":false}},"required":["passages","meta"],"title":"listFilePassagesResponse","additionalProperties":false}}}},"setFilePassagesResponse":{"description":"Empty response.","content":{"application/json":{"schema":{"type":"object","title":"setFilePassagesResponse","additionalProperties":false}}}},"listFileTagsResponse":{"description":"Returns the list of available tags used across all files of the bot.","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}},"meta":{"type":"object","properties":{"nextToken":{"type":"string","description":"The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."}},"additionalProperties":false}},"required":["tags","meta"],"title":"listFileTagsResponse","additionalProperties":false}}}},"listFileTagValuesResponse":{"description":"Returns the list of available values used for a given tag across all files of the bot.","content":{"application/json":{"schema":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"meta":{"type":"object","properties":{"nextToken":{"type":"string","description":"The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."}},"additionalProperties":false}},"required":["values","meta"],"title":"listFileTagValuesResponse","additionalProperties":false}}}},"createKnowledgeBaseResponse":{"description":"The created knowledge base","content":{"application/json":{"schema":{"type":"object","properties":{"knowledgeBase":{"type":"object","properties":{"id":{"type":"string","description":"Knowledge base ID"},"name":{"type":"string","description":"Name of the knowledge base."},"tags":{"type":"object","additionalProperties":{"type":"string"}}},"required":["id","name","tags"],"additionalProperties":false}},"required":["knowledgeBase"],"title":"createKnowledgeBaseResponse","additionalProperties":false}}}},"deleteKnowledgeBaseResponse":{"description":"Empty response.","content":{"application/json":{"schema":{"type":"object","title":"deleteKnowledgeBaseResponse","additionalProperties":false}}}},"updateKnowledgeBaseResponse":{"description":"The updated knowledge base","content":{"application/json":{"schema":{"type":"object","properties":{"knowledgeBase":{"type":"object","properties":{"id":{"type":"string","description":"Knowledge base ID"},"name":{"type":"string","description":"Name of the knowledge base."},"tags":{"type":"object","additionalProperties":{"type":"string"}}},"required":["id","name","tags"],"additionalProperties":false}},"required":["knowledgeBase"],"title":"updateKnowledgeBaseResponse","additionalProperties":false}}}},"listKnowledgeBasesResponse":{"description":"Returns the list of knowledge bases for the bot.","content":{"application/json":{"schema":{"type":"object","properties":{"knowledgeBases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Knowledge base ID"},"name":{"type":"string","description":"Name of the knowledge base."},"createdAt":{"type":"string","description":"Knowledge base creation timestamp in ISO 8601 format"},"tags":{"type":"object","additionalProperties":{"type":"string"}}},"required":["id","name","createdAt","tags"]}},"meta":{"type":"object","properties":{"nextToken":{"type":"string","description":"The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."}},"additionalProperties":false}},"required":["knowledgeBases","meta"],"title":"listKnowledgeBasesResponse","additionalProperties":false}}}}},"requestBodies":{"upsertFileBody":{"description":"Properties of the file to create or update.","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"File tags as an object of key-value pairs. Tag values should be of `string` (text) type."},"size":{"type":"number","description":"File size in bytes. This will count against your File Storage quota. If the `index` parameter is set to `true`, this will also count against your Vector DB Storage quota."},"index":{"default":false,"type":"boolean","description":"Set to a value of 'true' to index the file in vector storage. Only certain file formats are currently supported for indexing. Files larger than 95 MB cannot be indexed. Note that if a file is indexed, it will count towards both the Vector DB Storage quota and the File Storage quota of the workspace."},"indexing":{"type":"object","properties":{"configuration":{"type":"object","properties":{"parsing":{"type":"object","properties":{"minimumParagraphLength":{"type":"integer","minimum":50,"maximum":2000,"description":"The minimum length a standalone paragraph should have. If a paragraph is shorter than this, it will be merged with the next immediate paragraph."},"smartCleanup":{"type":"boolean","description":"(Team/Enterprise plan only, charged as AI Spend) Enabling this will use a lightweight/inexpensive LLM to clean up the extracted content of PDF files before indexing them to increase the quality of the stored vectors, as PDFs often store raw text in unusual ways which when extracted may result in formatting issues (e.g. broken sentences/paragraphs, unexpected headings, garbled characters, etc.) that can affect retrieval performance for certain user queries if left untouched.\n\nNotes:\n- This feature is only available in Team and Enterprise plans.\n- This feature is only available for PDF files. If the file isn't a PDF, this setting will be ignored and no AI Spend will be incurred.\n- We recommend using this feature for PDFs that have custom layouts or design. For simple text-based PDFs like documents and books, this feature is usually not necessary.\n- The smart cleanup takes some time to perform due to the LLM calls involved, so enabling it will increase the total time it takes to index the file.\n- We take steps to prevent the original text from being fundamentally changed but due to the nature of LLMs this could theoretically still happen so it's recommended to review the passages generated for the file after indexing to ensure the content is still accurate.\n- This feature is limited to the first 30 pages or 20 KB of text in the PDF file (whichever comes first). If the file has more content than these limits then the rest of the file will be indexed as-is without any cleanup. If you need to clean up the content of the entire file, consider splitting it into smaller files."}},"additionalProperties":false},"chunking":{"type":"object","properties":{"maximumChunkLength":{"type":"integer","minimum":100,"maximum":5000,"description":"The maximum length of a chunk in characters."},"embeddedContextLevels":{"type":"integer","minimum":0,"maximum":3,"description":"The number of surrounding context levels to include in the vector embedding of the chunk."},"embedBreadcrumb":{"type":"boolean","description":"Include the breadcrumb of the chunk in the vector embedding."}},"additionalProperties":false},"summarization":{"type":"object","properties":{"enable":{"default":false,"type":"boolean","description":"(Team/Enterprise plan only, charged as AI Spend) Create summaries for this file and index them as standalone vectors. Enabling this option will incur in AI Spend cost (charged to the workspace of the bot) to generate the summaries based on the amount of content in the file and the summarization model used.\n\nPlease note that this feature is only available in Team and Enterprise plans."},"modelType":{"default":"balanced","type":"string","enum":["inexpensive","balanced","accurate"],"description":"The model type to use for summarization."},"minimumInputLength":{"type":"integer","minimum":1000,"maximum":10000,"description":"The minimum length a section of the file should have to create a summary of it."},"outputTokenLimit":{"type":"integer","minimum":1000,"maximum":10000,"description":"The maximum length of a summary (in tokens)."},"generateMasterSummary":{"type":"boolean","description":"Generate a summary of the entire file and index it as a standalone vector."}},"additionalProperties":false},"stack":{"type":"string","enum":["legacy","realtime-v1"],"description":"If not set, the default indexing stack will be used."},"vision":{"type":"object","properties":{"transcribePages":{"description":"(Team/Enterprise plan only, charged as AI Spend) For PDF files, set this option to `true` or pass an array with specific page numbers to use a vision-enabled LLM to transcribe each page of the PDF as standalone vectors and index them.\n\nThis feature is useful when a PDF file contains custom designs or layouts, or when your document has many infographics, which require visual processing in order to index the file effectively, as the default text-based indexing may not be enough to allow your bot to correctly understand the content in your PDFs.\n\nNotes:\n- This feature is only available in Team and Enterprise plans.\n- Enabling this feature will incur in AI Spend cost to use a vision-enabled LLM to index the PDF pages.\n- This is limited to a maximum of 100 pages of the PDF. If the file has more pages then the rest of the pages will NOT be transcribed using this vision feature, and will be processed using the default text-based indexing instead. If you need to transcribe the entire file using vision, please split it into smaller files.\n- Pages that are vision-transcribed will not be processed by the default text-based indexing to avoid duplicate content in the index.\n- This feature is only available for PDF files. If the file isn't a PDF, this setting will be ignored and no AI Spend will be incurred."},"indexPages":{"description":"(Team/Enterprise plan only, charged as AI Spend) For PDF files, set this option to `true` or pass an array with specific page numbers to use a vision-enabled LLM to index each page of the PDF as a standalone image.\n\nEnabling this feature will allow Autonomous Nodes in your bot to answer visual or higher-level questions about the content in these pages that can usually not be answered correctly by the default text-based indexing or visual transcription.\n\nThis feature is useful when a PDF has:\n- Tables with complex layouts\n- Charts, diagrams or infographics\n- Photos or images that can be used to answer user queries\n\nNotes:\n- This feature is only available in Team and Enterprise plans.\n- Enabling this will incur in extra AI Spend cost and additional File Storage usage, in order to use a vision-enabled LLM to visually index the PDF pages and store them as standalone page images in the bot's file storage.\n- Enabling this may increase the overall AI Spend cost of your bot as your bot may pass one or more indexed page images to a vision-enabled LLM for answering user queries.\n- This is limited to the first 100 pages of the PDF. If the file has more pages then the rest of the pages will NOT be vision-indexed. If you need to visually index the entire file, please split it into smaller files.\n- This feature is only available for PDF files. If the file isn't a PDF, this setting will be ignored and no AI Spend will be incurred."}},"additionalProperties":false}},"description":"Configuration to use for indexing the file, will be stored in the file's metadata for reference.","additionalProperties":false}},"required":["configuration"],"additionalProperties":false},"accessPolicies":{"type":"array","items":{"type":"string","enum":["public_content","integrations"]},"description":"File access policies. Add \"public_content\" to allow public access to the file content. Add \"integrations\" to allow read, search and list operations for any integration installed in the bot."},"contentType":{"type":"string","description":"File content type. If omitted, the content type will be inferred from the file extension (if any) specified in `key`. If a content type cannot be inferred, the default is \"application/octet-stream\"."},"expiresAt":{"type":"string","format":"date-time","description":"Expiry timestamp in ISO 8601 format with UTC timezone. After expiry, the File will be deleted. Must be in the future. Cannot be more than 90 days from now. The value up to minutes is considered. Seconds and milliseconds are ignored."},"publicContentImmediatelyAccessible":{"type":"boolean","description":"Use when your file has \"public_content\" in its access policy and you need the file\\'s content to be immediately accessible through its URL after the file has been uploaded without having to wait for the upload to be processed by our system.\n\nIf set to `true`, the `x-amz-tagging` HTTP header with a value of `public=true` will need to be sent in the HTTP PUT request to the `uploadUrl` in order for the upload request to work."},"metadata":{"description":"Custom metadata for the file expressed as an object of key-value pairs. The values can be of any type."}},"required":["key","size"],"title":"upsertFileBody","additionalProperties":false}}}},"updateFileMetadataBody":{"description":"File metadata to update.","content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"description":"Custom metadata for the file expressed as an object of key-value pairs. Omit to keep existing metadata intact. Any existing metadata keys not included will be preserved. New keys will be added. To delete a metadata key, set its value to `null`."},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000,"nullable":true},"description":"The file tags to update as an object of key-value pairs with `string` (text) values. Omit to keep existing tags intact. Any existing tags not included will be preserved. New tags will be added. To delete a tag, set its value to `null`."},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"New access policies to set for the file. Omit to keep existing policies intact."},"expiresAt":{"type":"string","format":"date-time","description":"Expiry timestamp in ISO 8601 format with UTC timezone. After expiry, the File will be deleted. Must be in the future. Cannot be more than 90 days from now. The value up to minutes is considered. Seconds and milliseconds are ignored. Omit to keep the existing expiry intact. Set to `null` to remove the expiry.","nullable":true}},"title":"updateFileMetadataBody","additionalProperties":false}}}},"copyFileBody":{"description":"Additional options for file copying.","content":{"application/json":{"schema":{"type":"object","properties":{"overwrite":{"type":"boolean","description":"Set to `true` to overwrite the file if it already exists, otherwise an error will be returned.\n\nWhen this endpoint is called using bot authentication, the existing file must have been originally created by the same bot making the file copy request in order to overwrite it."}},"title":"copyFileBody","additionalProperties":false}}}},"setFilePassagesBody":{"description":"List of passages to index for the file. These will replacing all the existing passages. Indexing of the new passages will be done asynchronously in the background. You can check the file status to see when the indexing is complete.","content":{"application/json":{"schema":{"type":"object","properties":{"passages":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string","description":"The content of the passage, supports Markdown formatting."},"type":{"default":"paragraph","type":"string","enum":["title","subtitle","paragraph","blockquote","list","table","code","image"],"description":"The type should match the Markdown format used for the passage content."},"pageNumber":{"type":"integer"}},"required":["content"]},"description":"Note: The passages should appear in the array in the same order as they appear in the original document."}},"required":["passages"],"title":"setFilePassagesBody","additionalProperties":false}}}},"createKnowledgeBaseBody":{"description":"Properties of the knowledge base.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the knowledge base."},"tags":{"type":"object","additionalProperties":{"type":"string"}}},"required":["name"],"title":"createKnowledgeBaseBody","additionalProperties":false}}}},"updateKnowledgeBaseBody":{"description":"Properties of the knowledge base to update.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New name of the knowledge base."},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000,"nullable":true},"description":"The knowledge base tags to update as an object of key-value pairs with `string` (text) values. Omit to keep existing tags intact. Any existing tags not included will be preserved. New tags will be added. To delete a tag, set its value to `null`."}},"required":["name"],"title":"updateKnowledgeBaseBody","additionalProperties":false}}}}},"parameters":{},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"BearerAuth":[]}]}
|
|
1
|
+
{"openapi":"3.0.0","servers":[{"url":"https://api.botpress.cloud"}],"info":{"title":"Botpress Files API","description":"API for Botpress Files","version":"1.49.0"},"paths":{"/v1/files":{"put":{"operationId":"upsertFile","description":"Creates or updates a file using the `key` parameter as unique identifier. Updating a file will erase the existing content of the file. Upload the file content by sending it in a PUT request to the `uploadUrl` returned in the response.","parameters":[{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/upsertFileResponse"},"default":{"$ref":"#/components/responses/upsertFileResponse"}},"requestBody":{"$ref":"#/components/requestBodies/upsertFileBody"}},"get":{"operationId":"listFiles","description":"List files for bot","parameters":[{"name":"nextToken","in":"query","description":"Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results","schema":{"type":"string"}},{"name":"sortField","in":"query","description":"Sort results by this field","schema":{"type":"string","enum":["key","size","createdAt","updatedAt","status"]}},{"name":"sortDirection","in":"query","description":"Sort results in this direction","schema":{"type":"string","enum":["asc","desc"]}},{"name":"tags","in":"query","description":"Filter files by tags. Tags should be passed as a URL-encoded JSON object of key-value pairs that must be present in the tags of a file. An array of multiple string values for the same key are treated as an OR condition. To exclude a value, express it as an object with a nested `not` key with the string or string-array value(s) to exclude.","schema":{}},{"name":"ids","in":"query","description":"Filter files by IDs.","schema":{"type":"array","items":{"type":"string"},"maxItems":50}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/listFilesResponse"},"default":{"$ref":"#/components/responses/listFilesResponse"}}}},"/v1/files/{id}":{"delete":{"operationId":"deleteFile","description":"Deletes a file.","parameters":[{"name":"id","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/deleteFileResponse"},"default":{"$ref":"#/components/responses/deleteFileResponse"}}},"get":{"operationId":"getFile","description":"Get file","parameters":[{"name":"id","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/getFileResponse"},"default":{"$ref":"#/components/responses/getFileResponse"}}},"put":{"operationId":"updateFileMetadata","description":"Update file metadata, without updating the file content.","parameters":[{"name":"id","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/updateFileMetadataResponse"},"default":{"$ref":"#/components/responses/updateFileMetadataResponse"}},"requestBody":{"$ref":"#/components/requestBodies/updateFileMetadataBody"}}},"/v1/files/{idOrKey}/{destinationKey}":{"post":{"operationId":"copyFile","description":"Copy file","parameters":[{"name":"idOrKey","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"destinationKey","in":"path","description":"The new key of the file. The file key must not be in use already in the destination bot.","required":true,"schema":{"type":"string"}},{"name":"x-destination-bot-id","in":"header","description":"The bot ID to copy the file to. You must have permission to create files in the destination bot. If the destination bot ID is omitted, the file will be copied to the same bot the source file belongs to.","schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/copyFileResponse"},"default":{"$ref":"#/components/responses/copyFileResponse"}},"requestBody":{"$ref":"#/components/requestBodies/copyFileBody"}}},"/v1/files/search":{"get":{"operationId":"searchFiles","description":"Search files","parameters":[{"name":"tags","in":"query","description":"Filter files by tags. Tags should be passed as a URL-encoded JSON object of key-value pairs that must be present in the tags of a file. An array of multiple string values for the same key are treated as an OR condition. To exclude a value, express it as an object with a nested `not` key with the string or string-array value(s) to exclude.","schema":{}},{"name":"query","in":"query","description":"Query expressed in natural language to retrieve matching text passages within all indexed files in the bot using semantical search.","required":true,"schema":{"type":"string"}},{"name":"contextDepth","in":"query","description":"The number of neighbor passages to prepend and append as surrounding context to the content of each returned passage (default: 1, minimum: 0, maximum: 10).","schema":{"type":"integer"}},{"name":"limit","in":"query","description":"The maximum number of passages to return.","schema":{"type":"integer"}},{"name":"consolidate","in":"query","description":"Consolidate the results by merging matching passages from the same file into a single passage per file. The consolidated passage will include the matching passages ordered by their original position in the file (rather than by relevance score) and include hierarchical context such as the title/subtitle to which they belong.","schema":{"type":"boolean"}},{"name":"includeBreadcrumb","in":"query","description":"Prepend a breadcrumb to each passage, containing the title and subtitle(s) the passage belongs to in the file. This option is ignored when the `consolidate` option is set to `true`.","schema":{"type":"boolean"}},{"name":"withContext","in":"query","description":"Include the surrounding context with each passage in the `context` property of each passage. Not supported when `consolidate` is set to `true`.","schema":{"type":"boolean"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/searchFilesResponse"},"default":{"$ref":"#/components/responses/searchFilesResponse"}}}},"/v1/files/{id}/passages":{"get":{"operationId":"listFilePassages","description":"List passages for a file","parameters":[{"name":"nextToken","in":"query","description":"Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results","schema":{"type":"string"}},{"name":"id","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"The maximum number of passages to return per request (optional, default: 20, max: 200).","schema":{"type":"number"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/listFilePassagesResponse"},"default":{"$ref":"#/components/responses/listFilePassagesResponse"}}},"put":{"operationId":"setFilePassages","description":"Sets the indexed file passages asynchronously. All existing indexed passages will be deleted as soon as the indexing begins. This endpoint will return immediately and set the file status to \"indexing_pending\". Once the new passages are indexed the file status will be set to \"indexing_completed\", or \"indexing_failed\" if the passages failed to be indexed.","parameters":[{"name":"id","in":"path","description":"File ID or Key","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/setFilePassagesResponse"},"default":{"$ref":"#/components/responses/setFilePassagesResponse"}},"requestBody":{"$ref":"#/components/requestBodies/setFilePassagesBody"}}},"/v1/files/tags":{"get":{"operationId":"listFileTags","description":"List available tags","parameters":[{"name":"nextToken","in":"query","description":"Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results","schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/listFileTagsResponse"},"default":{"$ref":"#/components/responses/listFileTagsResponse"}}}},"/v1/files/tags/{tag}/values":{"get":{"operationId":"listFileTagValues","description":"List available tags","parameters":[{"name":"nextToken","in":"query","description":"Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results","schema":{"type":"string"}},{"name":"tag","in":"path","description":"Tag name","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/listFileTagValuesResponse"},"default":{"$ref":"#/components/responses/listFileTagValuesResponse"}}}},"/v1/files/knowledge-bases":{"post":{"operationId":"createKnowledgeBase","description":"Creates a knowledge base for grouping files.","parameters":[{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/createKnowledgeBaseResponse"},"default":{"$ref":"#/components/responses/createKnowledgeBaseResponse"}},"requestBody":{"$ref":"#/components/requestBodies/createKnowledgeBaseBody"}},"get":{"operationId":"listKnowledgeBases","description":"List knowledge bases for bot","parameters":[{"name":"nextToken","in":"query","description":"Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results","schema":{"type":"string"}},{"name":"tags","in":"query","description":"Filter files by tags. Tags should be passed as a URL-encoded JSON object of key-value pairs that must be present in the tags of a file. An array of multiple string values for the same key are treated as an OR condition. To exclude a value, express it as an object with a nested `not` key with the string or string-array value(s) to exclude.","schema":{}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/listKnowledgeBasesResponse"},"default":{"$ref":"#/components/responses/listKnowledgeBasesResponse"}}}},"/v1/files/knowledge-bases/{id}":{"delete":{"operationId":"deleteKnowledgeBase","description":"Deletes a knowledge base.","parameters":[{"name":"id","in":"path","description":"Knowledge base ID","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/deleteKnowledgeBaseResponse"},"default":{"$ref":"#/components/responses/deleteKnowledgeBaseResponse"}}},"put":{"operationId":"updateKnowledgeBase","description":"Updates a knowledge base.","parameters":[{"name":"id","in":"path","description":"Knowledge base ID","required":true,"schema":{"type":"string"}},{"name":"x-bot-id","in":"header","description":"Bot id","required":true,"schema":{"type":"string"}},{"name":"x-integration-id","in":"header","description":"Integration id","required":false,"schema":{"type":"string"}},{"name":"x-integration-alias","in":"header","description":"Integration alias","required":false,"schema":{"type":"string"}},{"name":"x-integration-name","in":"header","description":"Integration name","required":false,"schema":{"type":"string"}},{"name":"x-user-id","in":"header","description":"User Id","required":false,"schema":{"type":"string"}},{"name":"x-user-role","in":"header","description":"User Role","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/updateKnowledgeBaseResponse"},"default":{"$ref":"#/components/responses/updateKnowledgeBaseResponse"}},"requestBody":{"$ref":"#/components/requestBodies/updateKnowledgeBaseBody"}}}},"components":{"schemas":{"File":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"],"additionalProperties":false},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner"],"additionalProperties":false}},"responses":{"upsertFileResponse":{"description":"The created or updated file","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"],"additionalProperties":false},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."},"uploadUrl":{"type":"string","description":"URL to upload the file content. File content needs to be sent to this URL via a PUT request."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner","uploadUrl"],"additionalProperties":false}},"required":["file"],"title":"upsertFileResponse","additionalProperties":false}}}},"deleteFileResponse":{"description":"Empty response.","content":{"application/json":{"schema":{"type":"object","title":"deleteFileResponse","additionalProperties":false}}}},"listFilesResponse":{"description":"Returns the list of files related to the bot.","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"]},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner"]}},"meta":{"type":"object","properties":{"nextToken":{"type":"string","description":"The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."}},"additionalProperties":false}},"required":["files","meta"],"title":"listFilesResponse","additionalProperties":false}}}},"getFileResponse":{"description":"An object containing the file metadata and URL","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"],"additionalProperties":false},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner"],"additionalProperties":false}},"required":["file"],"title":"getFileResponse","additionalProperties":false}}}},"updateFileMetadataResponse":{"description":"An object containing the updated file metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"],"additionalProperties":false},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner"],"additionalProperties":false}},"required":["file"],"title":"updateFileMetadataResponse","additionalProperties":false}}}},"copyFileResponse":{"description":"An object containing the file metadata and URL","content":{"application/json":{"schema":{"type":"object","properties":{"file":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"botId":{"type":"string","description":"The ID of the bot the file belongs to"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"url":{"type":"string","description":"URL to retrieve the file content. This URL will be ready to use once the file is uploaded.\n\nIf the file has a `public_content` policy, this will contain the permanent public URL to retrieve the file, otherwise this will contain a temporary pre-signed URL to download the file which should be used shortly after retrieving and should not be stored long-term as the URL will expire after a short timeframe."},"size":{"type":"number","description":"File size in bytes. Non-null if file upload status is \"COMPLETE\".","nullable":true},"contentType":{"type":"string","description":"MIME type of the file's content"},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key/value pairs"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key/value pairs. The values can be of any type."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"Access policies configured for the file."},"index":{"type":"boolean","description":"Whether the file was requested to be indexed for search or not."},"status":{"type":"string","enum":["upload_pending","upload_failed","upload_completed","indexing_pending","indexing_failed","indexing_completed"],"description":"Status of the file. If the status is `upload_pending`, the file content has not been uploaded yet. The status will be set to `upload_completed` once the file content has been uploaded successfully.\n\nIf the upload failed for any reason (e.g. exceeding the storage quota or the maximum file size limit) the status will be set to `upload_failed` and the reason for the failure will be available in the `failedStatusReason` field of the file.\n\nHowever, if the file has been uploaded and the `index` attribute was set to `true` on the file, the status will immediately transition to the `indexing_pending` status (the `upload_completed` status step will be skipped).\n\nOnce the indexing is completed and the file is ready to be used for searching its status will be set to `indexing_completed`. If the indexing failed the status will be set to `indexing_failed` and the reason for the failure will be available in the `failedStatusReason` field."},"failedStatusReason":{"type":"string","description":"If the file status is `upload_failed` or `indexing_failed` this will contain the reason of the failure."},"expiresAt":{"type":"string","description":"File expiry timestamp in ISO 8601 format"},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["bot","integration","user"]},"id":{"type":"string","description":"This field is present if `type` is \"user\" or \"bot\". If `type` is \"user\", this is the user ID. If `type` is \"bot\", this is the bot ID."},"name":{"type":"string","description":"This field is present if the `type` is \"integration\". If `type` is \"integration\", this is the integration name."}},"required":["type"],"additionalProperties":false},"indexingStack":{"type":"string","enum":["v1","v2"],"description":"Indicates the indexing stack used to index this file. Present only when file has been successfully indexed. A value of \"v2\" denotes the latest stack, \"v1\" denotes the legacy stack."}},"required":["id","botId","key","url","size","contentType","tags","metadata","createdAt","updatedAt","accessPolicies","index","status","owner"],"additionalProperties":false}},"required":["file"],"title":"copyFileResponse","additionalProperties":false}}}},"searchFilesResponse":{"description":"Returns the text passages within all indexed files that matched the query.","content":{"application/json":{"schema":{"type":"object","properties":{"passages":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string","description":"The content of the matching passage in the file including surrounding context, if any."},"score":{"type":"number","description":"The score indicating the similarity of the passage to the query. A higher score indicates higher similarity."},"meta":{"type":"object","properties":{"type":{"type":"string","enum":["chunk","summary","consolidated","image"],"description":"The type of passage"},"subtype":{"type":"string","enum":["title","subtitle","paragraph","blockquote","list","table","code","image","page"],"description":"The subtype of passage, if available."},"pageNumber":{"type":"integer","description":"Page number the passage is located on. Only applicable if the passage was extracted from a PDF file."},"position":{"type":"integer","description":"Position number of the passage in the file relative to the other passages, if available. Can be used to know the order of passages within a file."},"sourceUrl":{"type":"string","format":"uri","description":"The URL of the source file for the vector, if applicable (e.g. for image vectors)."}},"description":"The passage metadata."},"file":{"type":"object","properties":{"id":{"type":"string","description":"File ID"},"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"contentType":{"type":"string","description":"MIME type of the file's content"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Metadata of the file as an object of key-value pairs."},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"The tags of the file as an object of key-value pairs."},"createdAt":{"type":"string","description":"File creation timestamp in ISO 8601 format"},"updatedAt":{"type":"string","description":"File last update timestamp in ISO 8601 format"}},"required":["id","key","contentType","metadata","tags","createdAt","updatedAt"]},"context":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The ID of the vector that the context passage belongs to. Omitted for breadcrumbs."},"text":{"type":"string"},"offset":{"type":"integer","description":"Position of the context passage relative to the current passage. Negative for preceding passages, positive for subsequent, ommited for breadcrumbs."},"type":{"type":"string","enum":["preceding","subsequent","current","breadcrumb"],"description":"The type of context passage"}},"required":["text","type"]},"description":"Surrounding passages including the current passage, based on the requested `contextDepth`. Only returned if the `withContext` parameter is set to `true`. Not supported when using the `consolidate` option."}},"required":["content","score","meta","file"]}}},"required":["passages"],"title":"searchFilesResponse","additionalProperties":false}}}},"listFilePassagesResponse":{"description":"Returns the list of passages extracted from a file.","content":{"application/json":{"schema":{"type":"object","properties":{"passages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Passage ID"},"content":{"type":"string","description":"The content of the passage."},"meta":{"type":"object","properties":{"type":{"type":"string","enum":["chunk","summary","consolidated","image"],"description":"The type of passage"},"subtype":{"type":"string","enum":["title","subtitle","paragraph","blockquote","list","table","code","image","page"],"description":"The subtype of passage, if available."},"pageNumber":{"type":"integer","description":"Page number the passage is located on. Only applicable if the passage was extracted from a PDF file."},"position":{"type":"integer","description":"Position number of the passage in the file relative to the other passages, if available. Can be used to know the order of passages within a file."},"sourceUrl":{"type":"string","format":"uri","description":"The URL of the source file for the vector, if applicable (e.g. for image vectors)."}},"description":"The passage metadata."}},"required":["id","content","meta"]}},"meta":{"type":"object","properties":{"nextToken":{"type":"string","description":"The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."}},"additionalProperties":false}},"required":["passages","meta"],"title":"listFilePassagesResponse","additionalProperties":false}}}},"setFilePassagesResponse":{"description":"Empty response.","content":{"application/json":{"schema":{"type":"object","title":"setFilePassagesResponse","additionalProperties":false}}}},"listFileTagsResponse":{"description":"Returns the list of available tags used across all files of the bot.","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}},"meta":{"type":"object","properties":{"nextToken":{"type":"string","description":"The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."}},"additionalProperties":false}},"required":["tags","meta"],"title":"listFileTagsResponse","additionalProperties":false}}}},"listFileTagValuesResponse":{"description":"Returns the list of available values used for a given tag across all files of the bot.","content":{"application/json":{"schema":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string"}},"meta":{"type":"object","properties":{"nextToken":{"type":"string","description":"The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."}},"additionalProperties":false}},"required":["values","meta"],"title":"listFileTagValuesResponse","additionalProperties":false}}}},"createKnowledgeBaseResponse":{"description":"The created knowledge base","content":{"application/json":{"schema":{"type":"object","properties":{"knowledgeBase":{"type":"object","properties":{"id":{"type":"string","description":"Knowledge base ID"},"name":{"type":"string","description":"Name of the knowledge base."},"tags":{"type":"object","additionalProperties":{"type":"string"}}},"required":["id","name","tags"],"additionalProperties":false}},"required":["knowledgeBase"],"title":"createKnowledgeBaseResponse","additionalProperties":false}}}},"deleteKnowledgeBaseResponse":{"description":"Empty response.","content":{"application/json":{"schema":{"type":"object","title":"deleteKnowledgeBaseResponse","additionalProperties":false}}}},"updateKnowledgeBaseResponse":{"description":"The updated knowledge base","content":{"application/json":{"schema":{"type":"object","properties":{"knowledgeBase":{"type":"object","properties":{"id":{"type":"string","description":"Knowledge base ID"},"name":{"type":"string","description":"Name of the knowledge base."},"tags":{"type":"object","additionalProperties":{"type":"string"}}},"required":["id","name","tags"],"additionalProperties":false}},"required":["knowledgeBase"],"title":"updateKnowledgeBaseResponse","additionalProperties":false}}}},"listKnowledgeBasesResponse":{"description":"Returns the list of knowledge bases for the bot.","content":{"application/json":{"schema":{"type":"object","properties":{"knowledgeBases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Knowledge base ID"},"name":{"type":"string","description":"Name of the knowledge base."},"createdAt":{"type":"string","description":"Knowledge base creation timestamp in ISO 8601 format"},"tags":{"type":"object","additionalProperties":{"type":"string"}}},"required":["id","name","createdAt","tags"]}},"meta":{"type":"object","properties":{"nextToken":{"type":"string","description":"The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint."}},"additionalProperties":false}},"required":["knowledgeBases","meta"],"title":"listKnowledgeBasesResponse","additionalProperties":false}}}}},"requestBodies":{"upsertFileBody":{"description":"Properties of the file to create or update.","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Unique key for the file. Must be unique across the bot (and the integration, when applicable)."},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000},"description":"File tags as an object of key-value pairs. Tag values should be of `string` (text) type."},"size":{"type":"number","description":"File size in bytes. This will count against your File Storage quota. If the `index` parameter is set to `true`, this will also count against your Vector DB Storage quota."},"index":{"default":false,"type":"boolean","description":"Set to a value of 'true' to index the file in vector storage. Only certain file formats are currently supported for indexing. Files larger than 95 MB cannot be indexed. Note that if a file is indexed, it will count towards both the Vector DB Storage quota and the File Storage quota of the workspace."},"indexing":{"type":"object","properties":{"configuration":{"type":"object","properties":{"parsing":{"type":"object","properties":{"minimumParagraphLength":{"type":"integer","minimum":50,"maximum":2000,"description":"The minimum length a standalone paragraph should have. If a paragraph is shorter than this, it will be merged with the next immediate paragraph."},"smartCleanup":{"type":"boolean","description":"(Team/Enterprise plan only, charged as AI Spend) Enabling this will use a lightweight/inexpensive LLM to clean up the extracted content of PDF files before indexing them to increase the quality of the stored vectors, as PDFs often store raw text in unusual ways which when extracted may result in formatting issues (e.g. broken sentences/paragraphs, unexpected headings, garbled characters, etc.) that can affect retrieval performance for certain user queries if left untouched.\n\nNotes:\n- This feature is only available in Team and Enterprise plans.\n- This feature is only available for PDF files. If the file isn't a PDF, this setting will be ignored and no AI Spend will be incurred.\n- We recommend using this feature for PDFs that have custom layouts or design. For simple text-based PDFs like documents and books, this feature is usually not necessary.\n- The smart cleanup takes some time to perform due to the LLM calls involved, so enabling it will increase the total time it takes to index the file.\n- We take steps to prevent the original text from being fundamentally changed but due to the nature of LLMs this could theoretically still happen so it's recommended to review the passages generated for the file after indexing to ensure the content is still accurate.\n- This feature is limited to the first 30 pages or 20 KB of text in the PDF file (whichever comes first). If the file has more content than these limits then the rest of the file will be indexed as-is without any cleanup. If you need to clean up the content of the entire file, consider splitting it into smaller files."}},"additionalProperties":false},"chunking":{"type":"object","properties":{"maximumChunkLength":{"type":"integer","minimum":100,"maximum":5000,"description":"The maximum length of a chunk in characters."},"embeddedContextLevels":{"type":"integer","minimum":0,"maximum":3,"description":"The number of surrounding context levels to include in the vector embedding of the chunk."},"embedBreadcrumb":{"type":"boolean","description":"Include the breadcrumb of the chunk in the vector embedding."}},"additionalProperties":false},"summarization":{"type":"object","properties":{"enable":{"default":false,"type":"boolean","description":"(Team/Enterprise plan only, charged as AI Spend) Create summaries for this file and index them as standalone vectors. Enabling this option will incur in AI Spend cost (charged to the workspace of the bot) to generate the summaries based on the amount of content in the file and the summarization model used.\n\nPlease note that this feature is only available in Team and Enterprise plans."},"modelType":{"default":"balanced","type":"string","enum":["inexpensive","balanced","accurate"],"description":"The model type to use for summarization."},"minimumInputLength":{"type":"integer","minimum":1000,"maximum":10000,"description":"The minimum length a section of the file should have to create a summary of it."},"outputTokenLimit":{"type":"integer","minimum":1000,"maximum":10000,"description":"The maximum length of a summary (in tokens)."},"generateMasterSummary":{"type":"boolean","description":"Generate a summary of the entire file and index it as a standalone vector."}},"additionalProperties":false},"stack":{"type":"string","enum":["legacy","realtime-v1"],"description":"If not set, the default indexing stack will be used."},"vision":{"type":"object","properties":{"transcribePages":{"description":"(Team/Enterprise plan only, charged as AI Spend) For PDF files, set this option to `true` or pass an array with specific page numbers to use a vision-enabled LLM to transcribe each page of the PDF as standalone vectors and index them.\n\nThis feature is useful when a PDF file contains custom designs or layouts, or when your document has many infographics, which require visual processing in order to index the file effectively, as the default text-based indexing may not be enough to allow your bot to correctly understand the content in your PDFs.\n\nNotes:\n- This feature is only available in Team and Enterprise plans.\n- Enabling this feature will incur in AI Spend cost to use a vision-enabled LLM to index the PDF pages.\n- This is limited to a maximum of 100 pages of the PDF. If the file has more pages then the rest of the pages will NOT be transcribed using this vision feature, and will be processed using the default text-based indexing instead. If you need to transcribe the entire file using vision, please split it into smaller files.\n- Pages that are vision-transcribed will not be processed by the default text-based indexing to avoid duplicate content in the index.\n- This feature is only available for PDF files. If the file isn't a PDF, this setting will be ignored and no AI Spend will be incurred."},"indexPages":{"description":"(Team/Enterprise plan only, charged as AI Spend) For PDF files, set this option to `true` or pass an array with specific page numbers to use a vision-enabled LLM to index each page of the PDF as a standalone image.\n\nEnabling this feature will allow Autonomous Nodes in your bot to answer visual or higher-level questions about the content in these pages that can usually not be answered correctly by the default text-based indexing or visual transcription.\n\nThis feature is useful when a PDF has:\n- Tables with complex layouts\n- Charts, diagrams or infographics\n- Photos or images that can be used to answer user queries\n\nNotes:\n- This feature is only available in Team and Enterprise plans.\n- Enabling this will incur in extra AI Spend cost and additional File Storage usage, in order to use a vision-enabled LLM to visually index the PDF pages and store them as standalone page images in the bot's file storage.\n- Enabling this may increase the overall AI Spend cost of your bot as your bot may pass one or more indexed page images to a vision-enabled LLM for answering user queries.\n- This is limited to the first 100 pages of the PDF. If the file has more pages then the rest of the pages will NOT be vision-indexed. If you need to visually index the entire file, please split it into smaller files.\n- This feature is only available for PDF files. If the file isn't a PDF, this setting will be ignored and no AI Spend will be incurred."}},"additionalProperties":false}},"description":"Configuration to use for indexing the file, will be stored in the file's metadata for reference.","additionalProperties":false}},"required":["configuration"],"additionalProperties":false},"accessPolicies":{"type":"array","items":{"type":"string","enum":["public_content","integrations"]},"description":"File access policies. Add \"public_content\" to allow public access to the file content. Add \"integrations\" to allow read, search and list operations for any integration installed in the bot."},"contentType":{"type":"string","description":"File content type. If omitted, the content type will be inferred from the file extension (if any) specified in `key`. If a content type cannot be inferred, the default is \"application/octet-stream\"."},"expiresAt":{"type":"string","format":"date-time","description":"Expiry timestamp in ISO 8601 format with UTC timezone. After expiry, the File will be deleted. Must be in the future. Cannot be more than 90 days from now. The value up to minutes is considered. Seconds and milliseconds are ignored."},"publicContentImmediatelyAccessible":{"type":"boolean","description":"Use when your file has \"public_content\" in its access policy and you need the file\\'s content to be immediately accessible through its URL after the file has been uploaded without having to wait for the upload to be processed by our system.\n\nIf set to `true`, the `x-amz-tagging` HTTP header with a value of `public=true` will need to be sent in the HTTP PUT request to the `uploadUrl` in order for the upload request to work."},"metadata":{"description":"Custom metadata for the file expressed as an object of key-value pairs. The values can be of any type."}},"required":["key","size"],"title":"upsertFileBody","additionalProperties":false}}}},"updateFileMetadataBody":{"description":"File metadata to update.","content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"description":"Custom metadata for the file expressed as an object of key-value pairs. Omit to keep existing metadata intact. Any existing metadata keys not included will be preserved. New keys will be added. To delete a metadata key, set its value to `null`."},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000,"nullable":true},"description":"The file tags to update as an object of key-value pairs with `string` (text) values. Omit to keep existing tags intact. Any existing tags not included will be preserved. New tags will be added. To delete a tag, set its value to `null`."},"accessPolicies":{"type":"array","items":{"type":"string","enum":["integrations","public_content"]},"description":"New access policies to set for the file. Omit to keep existing policies intact."},"expiresAt":{"type":"string","format":"date-time","description":"Expiry timestamp in ISO 8601 format with UTC timezone. After expiry, the File will be deleted. Must be in the future. Cannot be more than 90 days from now. The value up to minutes is considered. Seconds and milliseconds are ignored. Omit to keep the existing expiry intact. Set to `null` to remove the expiry.","nullable":true}},"title":"updateFileMetadataBody","additionalProperties":false}}}},"copyFileBody":{"description":"Additional options for file copying.","content":{"application/json":{"schema":{"type":"object","properties":{"overwrite":{"type":"boolean","description":"Set to `true` to overwrite the file if it already exists, otherwise an error will be returned.\n\nWhen this endpoint is called using bot authentication, the existing file must have been originally created by the same bot making the file copy request in order to overwrite it."}},"title":"copyFileBody","additionalProperties":false}}}},"setFilePassagesBody":{"description":"List of passages to index for the file. These will replacing all the existing passages. Indexing of the new passages will be done asynchronously in the background. You can check the file status to see when the indexing is complete.","content":{"application/json":{"schema":{"type":"object","properties":{"passages":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string","description":"The content of the passage, supports Markdown formatting."},"type":{"default":"paragraph","type":"string","enum":["title","subtitle","paragraph","blockquote","list","table","code","image"],"description":"The type should match the Markdown format used for the passage content."},"pageNumber":{"type":"integer"}},"required":["content"]},"description":"Note: The passages should appear in the array in the same order as they appear in the original document."}},"required":["passages"],"title":"setFilePassagesBody","additionalProperties":false}}}},"createKnowledgeBaseBody":{"description":"Properties of the knowledge base.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of the knowledge base."},"tags":{"type":"object","additionalProperties":{"type":"string"}}},"required":["name"],"title":"createKnowledgeBaseBody","additionalProperties":false}}}},"updateKnowledgeBaseBody":{"description":"Properties of the knowledge base to update.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New name of the knowledge base."},"tags":{"type":"object","additionalProperties":{"type":"string","maxLength":1000,"nullable":true},"description":"The knowledge base tags to update as an object of key-value pairs with `string` (text) values. Omit to keep existing tags intact. Any existing tags not included will be preserved. New tags will be added. To delete a tag, set its value to `null`."}},"required":["name"],"title":"updateKnowledgeBaseBody","additionalProperties":false}}}}},"parameters":{},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"BearerAuth":[]}]}
|
package/src/gen/files/state.ts
CHANGED
|
@@ -1261,6 +1261,13 @@ export const state = {
|
|
|
1261
1261
|
"type": "string",
|
|
1262
1262
|
"description": "MIME type of the file's content"
|
|
1263
1263
|
},
|
|
1264
|
+
"metadata": {
|
|
1265
|
+
"type": "object",
|
|
1266
|
+
"additionalProperties": {
|
|
1267
|
+
"nullable": true
|
|
1268
|
+
},
|
|
1269
|
+
"description": "Metadata of the file as an object of key-value pairs."
|
|
1270
|
+
},
|
|
1264
1271
|
"tags": {
|
|
1265
1272
|
"type": "object",
|
|
1266
1273
|
"additionalProperties": {
|
|
@@ -1282,6 +1289,7 @@ export const state = {
|
|
|
1282
1289
|
"id",
|
|
1283
1290
|
"key",
|
|
1284
1291
|
"contentType",
|
|
1292
|
+
"metadata",
|
|
1285
1293
|
"tags",
|
|
1286
1294
|
"createdAt",
|
|
1287
1295
|
"updatedAt"
|
|
@@ -1868,7 +1876,7 @@ export const state = {
|
|
|
1868
1876
|
"title": "Botpress Files API",
|
|
1869
1877
|
"description": "API for Botpress Files",
|
|
1870
1878
|
"server": "https://api.botpress.cloud",
|
|
1871
|
-
"version": "1.
|
|
1879
|
+
"version": "1.49.0",
|
|
1872
1880
|
"prefix": "v1"
|
|
1873
1881
|
},
|
|
1874
1882
|
"errors": [
|