openapi: 3.2.0 info: title: Twilio Knowledge API contact: name: Twilio Support url: https://support.twilio.com email: support@twilio.com license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html termsOfService: https://www.twilio.com/legal/tos x-refined-note: - x-twilio differs across the merged source definitions and was not carried version: '1.0' description: 'Operations tagged Knowledge across 2 of this provider''s published API definitions: knowledge-openapi-original.yml, knowledge-v1-openapi-original.yml. Each path carries the servers of the definition it was published in.' servers: - url: https://knowledge.twilio.com security: - accountSid_authToken: [] tags: - name: Knowledge paths: /v2/KnowledgeBases/{kbId}/Knowledge: servers: - url: https://knowledge.twilio.com parameters: - $ref: '#/components/parameters/KbId' x-twilio: defaultOutputProperties: - knowledge pathType: list get: operationId: ListKnowledge tags: - Knowledge summary: List Knowledge Sources description: 'Retrieve a paginated list of all knowledge sources for a specific knowledge base. Knowledge sources represent unstructured data sources such as documents, websites, or text content that can be used for context and information retrieval.' parameters: - name: page in: query description: The page index. This value is simply for client state. schema: type: integer minimum: 0 - $ref: '#/components/parameters/PageSize' - $ref: '#/components/parameters/PageToken' responses: '200': description: OK content: application/json: schema: type: object properties: knowledge: type: array maxItems: 1000 items: $ref: '#/components/schemas/Knowledge' meta: $ref: '#/components/schemas/KnowledgeMeta' title: ListKnowledgeResponse example: knowledge: - id: know_knowledge_00000000000000000000000000 name: Company FAQ Knowledge Base description: Frequently asked questions and answers for customer support status: COMPLETED source: type: Web url: https://example.com/faq crawlDepth: 2 crawlPeriod: NEVER createdAt: '2026-01-15T10:30:00Z' updatedAt: '2026-01-15T11:45:00Z' meta: pageSize: 50 nextToken: eyJlYXN0ZXIiOiJlZ2cifQ previousToken: eyJlYXN0ZXIiOiJlZ2cifQ '400': $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' post: operationId: CreateKnowledge tags: - Knowledge summary: Create Knowledge Source description: 'Create a new knowledge source from various data sources such as web content, files, or raw text. The knowledge source will be processed and indexed to enable semantic search and retrieval. ## Best practices To maximize the effectiveness of Knowledge, consider the following best practices: **Assess and optimize content:** Regularly evaluate your existing Knowledge sources for accuracy, relevance, and coverage. Identify any gaps or outdated information that could hinder the Assistant''s performance. **Simplify and structure content:** Ensure that the content is clear and concise. Use headings, bullet points, and metadata to make information straightforward to navigate for both the AI Assistant and your users. **Prioritize high-impact content:** Focus on updating and maintaining content that is frequently accessed or critical to customer interactions. Consider using analytics to determine which Knowledge entries are most valuable.' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/KnowledgeCore' example: name: Product Documentation description: Comprehensive product documentation and user guides source: type: Web url: https://docs.example.com crawlDepth: 3 responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/Knowledge' examples: webSource: summary: Web-based knowledge source value: id: know_knowledge_00000000000000000000000000 name: Product Documentation description: Comprehensive product documentation and user guides status: QUEUED source: type: Web url: https://docs.example.com crawlDepth: 3 createdAt: '2026-01-15T12:00:00Z' updatedAt: '2026-01-15T12:00:00Z' fileSource: summary: File-based knowledge source with presigned upload URL value: id: know_knowledge_00000000000000000000000000 name: Company Handbook description: Employee handbook and policies status: SCHEDULED source: type: File fileName: company-handbook.pdf fileSize: 2048576 mimeType: application/pdf importUrl: https://s3.amazonaws.com/knowledge/uploads/abc123.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=... uploadExpiration: '2026-01-15T13:00:00Z' createdAt: '2026-01-15T12:00:00Z' updatedAt: '2026-01-15T12:00:00Z' '400': $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' /v2/KnowledgeBases/{kbId}/Search: servers: - url: https://knowledge.twilio.com parameters: - $ref: '#/components/parameters/KbId' x-twilio: pathType: list post: operationId: CreateKnowledgeSearch tags: - Knowledge summary: Search Knowledge Chunks description: 'Perform semantic search across knowledge sources within a knowledge base to find the most relevant content chunks based on a natural language query. Returns ranked chunks with similarity scores, allowing you to retrieve contextually relevant information for AI applications, chatbots, or information retrieval systems. You can filter results by specific knowledge sources.' requestBody: content: application/json: schema: $ref: '#/components/schemas/KnowledgeSearch' example: query: How do I reset my password? top: 5 knowledgeIds: - know_knowledge_00000000000000000000000000 responses: '200': description: OK content: application/json: schema: type: object properties: chunks: type: array maxItems: 100 items: $ref: '#/components/schemas/KnowledgeChunkResult' example: chunks: - content: To reset your password, go to the login page and click 'Forgot Password'. Enter your email address and follow the instructions in the reset email. knowledgeId: know_knowledge_00000000000000000000000001 createdAt: '2026-01-15T10:30:00Z' chunkIndex: 3 documentTitle: Account Help — Example Docs documentUrl: https://docs.example.com/account/password-reset - content: If you're having trouble with password reset, contact support at help@example.com or call 1-800-HELP. knowledgeId: know_knowledge_00000000000000000000000002 createdAt: '2026-01-15T10:30:00Z' chunkIndex: 7 documentTitle: Contact Support — Example Docs documentUrl: https://docs.example.com/support/contact '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' /v2/KnowledgeBases/{kbId}/Knowledge/{knowledgeId}: servers: - url: https://knowledge.twilio.com parameters: - $ref: '#/components/parameters/KbId' - $ref: '#/components/parameters/KnowledgeIdPath' x-twilio: pathType: instance get: operationId: FetchKnowledge tags: - Knowledge summary: Retrieve Knowledge Source description: 'Fetch detailed information about a specific knowledge source by its ID. This returns the complete knowledge source object including processing status, source details, and configuration information.' responses: '200': content: application/json: schema: $ref: '#/components/schemas/Knowledge' example: id: know_knowledge_00000000000000000000000000 name: Company FAQ Knowledge Base description: Frequently asked questions and answers for customer support status: COMPLETED source: type: Web url: https://example.com/faq crawlDepth: 2 createdAt: '2026-01-15T10:30:00Z' updatedAt: '2026-01-15T11:45:00Z' description: OK '400': $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' patch: operationId: UpdateKnowledge tags: - Knowledge summary: Update Knowledge Source description: 'Partially update mutable fields of an existing knowledge source such as name, description, tags, or source-specific configuration. Only the fields provided in the request body will be updated. Some changes (e.g., KnowledgeSourceTypes) may trigger asynchronous reprocessing of the underlying content. Fields omitted from the request remain unchanged. Immutable fields (id, type, status, url, createdAt, updatedAt) cannot be modified directly. ## Refresh ## To request reprocessing without changing fields, pass the query parameter `refresh=true`. When `refresh=true` is provided, the server will re-queue processing for this knowledge resource (transitioning the persisted status to `QUEUED`) and return 202 Accepted. This query parameter is idempotent while the resource is already QUEUED or PROCESSING.' parameters: - name: refresh in: query description: When true, re-queues processing for this knowledge resource. Idempotent while the resource is already QUEUED or PROCESSING. required: false schema: type: boolean default: false requestBody: content: application/json: schema: $ref: '#/components/schemas/KnowledgeCore' example: name: Updated FAQ Knowledge Base description: Updated frequently asked questions and answers for customer support source: type: Web url: https://example.com/faq crawlDepth: 2 responses: '200': content: application/json: schema: $ref: '#/components/schemas/Knowledge' description: OK '202': description: Knowledge update accepted and is being processed. content: application/json: schema: type: object properties: message: type: string maxLength: 512 example: Knowledge update accepted required: - message '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' delete: operationId: DeleteKnowledge tags: - Knowledge summary: Delete Knowledge Source description: Permanently delete knowledge source and all its associated data, including processed chunks and embeddings. This action cannot be undone. The knowledge resource will no longer be available for search or retrieval operations. responses: '204': description: No Content '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' /v2/KnowledgeBases/{kbId}/Knowledge/{knowledgeId}/Chunks: servers: - url: https://knowledge.twilio.com parameters: - $ref: '#/components/parameters/KbId' - $ref: '#/components/parameters/KnowledgeIdPath' x-twilio: defaultOutputProperties: - chunks pathType: list get: operationId: ListKnowledgeChunks tags: - Knowledge summary: List Knowledge Chunks description: Retrieve a paginated list of all processed content chunks from a specific knowledge source. Chunks are smaller segments of content that have been extracted and processed from the original knowledge source. Each chunk contains content text and associated metadata that can be used for semantic search and retrieval operations. parameters: - name: pageSize in: query description: How many resources to return in each list page. The default is 50, and the maximum is 1000. schema: type: integer minimum: 1 maximum: 1000 - name: pageToken in: query description: The page token. This is provided by the API. schema: type: string maxLength: 2048 responses: '200': content: application/json: schema: type: object properties: chunks: type: array maxItems: 1000 items: $ref: '#/components/schemas/KnowledgeChunk' meta: $ref: '#/components/schemas/KnowledgeMeta' description: OK '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalServerError' '503': $ref: '#/components/responses/ServiceUnavailable' /v1/Knowledge: servers: - url: https://knowledge.twilio.com get: operationId: getV1Knowledge summary: List all knowledge parameters: - name: Page in: query description: The page index. This value is simply for client state. schema: type: integer minimum: 0 - name: PageSize in: query description: How many resources to return in each list page. The default is 50, and the maximum is 1000. schema: type: integer minimum: 1 maximum: 1000 - name: PageToken in: query description: The page token. This is provided by the API. schema: type: string - name: Tags in: query description: Json array of tag and value pairs for tag filtering. schema: type: string responses: '200': description: OK content: application/json: schema: type: object properties: knowledge: type: array items: type: object properties: description: description: The type of knowledge source. type: string id: type: string pattern: ^aia_know_.+$ description: The description of knowledge. account_sid: type: string minLength: 34 maxLength: 34 pattern: ^AC[0-9a-fA-F]{32}$ description: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. knowledge_source_details: description: The details of the knowledge source based on the type. type: object name: description: The name of the knowledge source. type: string status: description: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') type: string type: description: The type of knowledge source ('Web', 'Database', 'Text', 'File') type: string url: type: string description: The url of the knowledge resource. embedding_model: description: The embedding model to be used for the knowledge source. type: string date_created: description: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. format: date-time type: string date_updated: description: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. format: date-time type: string required: - id - name - type - date_created - date_updated meta: properties: first_page_url: format: uri type: string key: type: string next_page_url: format: uri type: - string - 'null' page: type: integer page_size: type: integer previous_page_url: format: uri type: - string - 'null' url: format: uri type: string type: object title: ListKnowledgeResponse security: - accountSid_authToken: [] tags: - Knowledge x-operation-id-source: normalized x-operation-id-original: ListKnowledge post: operationId: postV1Knowledge summary: Create knowledge requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/knowledge.v1.service.create_knowledge_request' responses: '201': content: application/json: schema: $ref: '#/components/schemas/knowledge.v1.service.knowledge' description: Created security: - accountSid_authToken: [] tags: - Knowledge x-operation-id-source: normalized x-operation-id-original: CreateKnowledge /v1/Knowledge/{id}: servers: - url: https://knowledge.twilio.com delete: operationId: deleteV1KnowledgeById summary: Delete knowledge parameters: - in: path name: id description: the Knowledge ID. required: true schema: type: string responses: '204': description: No Content security: - accountSid_authToken: [] tags: - Knowledge x-operation-id-source: normalized x-operation-id-original: DeleteKnowledge get: operationId: getV1KnowledgeById summary: Get knowledge parameters: - in: path name: id required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/knowledge.v1.service.knowledge' description: OK security: - accountSid_authToken: [] tags: - Knowledge x-operation-id-source: normalized x-operation-id-original: FetchKnowledge put: operationId: putV1KnowledgeById summary: Update knowledge parameters: - in: path name: id required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/knowledge.v1.service.update_knowledge_request' responses: '200': content: application/json: schema: $ref: '#/components/schemas/knowledge.v1.service.knowledge' description: OK security: - accountSid_authToken: [] tags: - Knowledge x-operation-id-source: normalized x-operation-id-original: UpdateKnowledge /v1/Knowledge/{id}/Status: servers: - url: https://knowledge.twilio.com x-twilio: parent: /Knowledge/{id} mountName: knowledge_status pathType: instance get: operationId: FetchKnowledgeStatus summary: Get knowledge status parameters: - in: path name: id description: the Knowledge ID. required: true schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/knowledge.v1.service.knowledge_status' description: OK security: - accountSid_authToken: [] tags: - Knowledge /v1/Knowledge/{id}/Chunks: servers: - url: https://knowledge.twilio.com x-twilio: parent: /Knowledge/{id} pathType: list get: operationId: getV1KnowledgeByIdChunks summary: List knowledge chunks parameters: - in: path name: id description: The knowledge ID. required: true schema: type: string - name: PageSize in: query description: How many resources to return in each list page. The default is 50, and the maximum is 1000. schema: type: integer minimum: 1 maximum: 1000 - name: PageToken in: query description: The page token. This is provided by the API. schema: type: string responses: '200': content: application/json: schema: type: object properties: chunks: type: array items: $ref: '#/components/schemas/knowledge.v1.service.knowledge_chunk' meta: properties: first_page_url: format: uri type: string key: type: string next_page_url: format: uri type: - string - 'null' page: type: integer page_size: type: integer previous_page_url: format: uri type: - string - 'null' url: format: uri type: string type: object title: ListKnowledgeChunksResponse description: OK security: - accountSid_authToken: [] tags: - Knowledge x-operation-id-source: normalized x-operation-id-original: ListKnowledgeChunks components: schemas: KnowledgeCore: type: object description: 'Core properties for knowledge source that can be set at creation time. Regularly update and organize your Knowledge sources to ensure it contains the most accurate and relevant information. This includes adding new entries, updating existing ones, and removing outdated content.' properties: name: description: The name of the knowledge source. example: Company FAQ Knowledge Base type: string maxLength: 30 description: description: A detailed description of the knowledge source and when to use it. This helps provide context about the content and its intended purpose. type: string maxLength: 1024 source: $ref: '#/components/schemas/KnowledgeSourceTypes' required: - name TwilioError: type: object additionalProperties: false maxProperties: 10 description: A generic error object communicating client and server side API errors. properties: code: type: integer minimum: 100 maximum: 999999 description: The Twilio error code. format: int32 message: type: string maxLength: 1024 description: A human readable message describing the error. more_info: type: string description: A URL to a [Twilio error directory](https://www.twilio.com/docs/api/errors) page with more information about the error code. status: type: integer minimum: 100 maximum: 599 description: The HTTP status code for the error. format: int32 example: code: 21614 message: The address specified in the request is not a valid phone number. more_info: https://www.twilio.com/docs/api/errors/21614 status: 400 KnowledgeChunkResult: type: object properties: content: description: The chunk content. type: string maxLength: 65536 createdAt: description: 'The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.' format: date-time type: string chunkIndex: type: integer description: 0-based position of this chunk within its source document for a single ingestion run. example: 2 documentTitle: type: string maxLength: 512 description: 'Human-readable title of the source document. Web: HTML