{
  "security": [
    {
      "accountSid_authToken": []
    }
  ],
  "components": {
    "securitySchemes": {
      "accountSid_authToken": {
        "scheme": "basic",
        "type": "http"
      }
    },
    "schemas": {
      "knowledge.v1.service.knowledge": {
        "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"
        ]
      },
      "knowledge.v1.service.knowledge_status": {
        "type": "object",
        "properties": {
          "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."
          },
          "status": {
            "description": "The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')",
            "type": "string"
          },
          "last_status": {
            "description": "The last status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')",
            "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": [
          "status"
        ]
      },
      "knowledge.v1.service.create_knowledge_request": {
        "type": "object",
        "properties": {
          "description": {
            "description": "The description of the knowledge source.",
            "type": "string"
          },
          "knowledge_source_details": {
            "description": "The details of the knowledge source based on the type.",
            "type": "object"
          },
          "name": {
            "description": "The name of the tool.",
            "type": "string"
          },
          "policy": {
            "description": "The policy associated with the knowledge source.",
            "$ref": "#/components/schemas/knowledge.v1.service.create_policy_request"
          },
          "type": {
            "description": "The type of the knowledge source.",
            "type": "string"
          },
          "embedding_model": {
            "description": "The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type"
        ]
      },
      "knowledge.v1.service.update_knowledge_request": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "description": {
            "description": "The description of the knowledge source.",
            "type": "string"
          },
          "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"
          },
          "policy": {
            "description": "The policy associated with the knowledge source.",
            "$ref": "#/components/schemas/knowledge.v1.service.create_policy_request"
          },
          "type": {
            "description": "The description of the knowledge source.",
            "type": "string"
          },
          "embedding_model": {
            "description": "The embedding model to be used for the knowledge source. It's only applicable to 'Database' type.",
            "type": "string"
          }
        }
      },
      "tags": {
        "description": "Array of tag and value pairs for tag filtering.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "description": "The tag key"
            },
            "value": {
              "type": "string",
              "description": "The tag value"
            }
          },
          "required": [
            "key",
            "value"
          ]
        },
        "required": [
          "query",
          "top"
        ]
      },
      "knowledge.v1.service.knowledge_chunk": {
        "type": "object",
        "properties": {
          "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."
          },
          "content": {
            "description": "The chunk content.",
            "type": "string"
          },
          "metadata": {
            "description": "The metadata of the chunk.",
            "type": "object"
          },
          "date_created": {
            "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"
          },
          "date_updated": {
            "description": "The date and time in GMT when the Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
            "format": "date-time",
            "type": "string"
          }
        }
      },
      "knowledge.v1.service.knowledge_chunk_with_score": {
        "allOf": [
          {
            "$ref": "#/components/schemas/knowledge.v1.service.knowledge_chunk"
          },
          {
            "type": "object",
            "properties": {
              "score": {
                "description": "The score associated with the chunk.",
                "type": "number",
                "format": "float"
              },
              "knowledge_id": {
                "description": "The knowledge ID associated with the chunk.",
                "type": "string"
              }
            }
          }
        ]
      },
      "knowledge.v1.service.create_policy_request": {
        "type": "object",
        "properties": {
          "description": {
            "description": "The description of the policy.",
            "type": "string"
          },
          "id": {
            "type": "string",
            "pattern": "^aia_plcy_.+$",
            "description": "The Policy ID."
          },
          "name": {
            "description": "The name of the policy.",
            "type": "string"
          },
          "policy_details": {},
          "type": {
            "description": "The description of the policy.",
            "type": "string"
          }
        },
        "required": [
          "policy_details"
        ]
      },
      "knowledge.v1.service.tag": {
        "type": "object",
        "properties": {
          "key": {
            "description": "The key of the tag.",
            "type": "string"
          },
          "id": {
            "description": "The ID of the tag.",
            "type": "string"
          },
          "date_created": {
            "description": "The date and time in GMT when the Tag 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 Tag was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
            "format": "date-time",
            "type": "string"
          },
          "allows_multiple": {
            "description": "Whether the tag allows multiple values.",
            "type": "boolean"
          },
          "twilio_tag": {
            "description": "Whether the tag is a Twilio tag.",
            "type": "boolean"
          },
          "account_sid": {
            "description": "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Tag resource.",
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^AC[0-9a-fA-F]{32}$"
          },
          "url": {
            "description": "The URL of the Tag resource.",
            "type": "string"
          }
        },
        "required": [
          "key",
          "id",
          "date_created",
          "date_updated",
          "allows_multiple",
          "account_sid",
          "url"
        ]
      },
      "knowledge.v1.service.update_tag_request": {
        "type": "object",
        "properties": {
          "key": {
            "description": "The key of the tag.",
            "type": "string"
          },
          "allows_multiple": {
            "description": "Whether the tag allows multiple values.",
            "type": "boolean"
          }
        }
      },
      "knowledge.v1.service.create_tag_request": {
        "type": "object",
        "properties": {
          "key": {
            "description": "The key of the tag.",
            "type": "string"
          },
          "twilio_tag": {
            "description": "Whether the tag is a Twilio tag.",
            "type": "boolean"
          },
          "allows_multiple": {
            "description": "Whether the tag allows multiple values.",
            "type": "boolean"
          }
        },
        "required": [
          "key",
          "allows_multiple"
        ]
      },
      "knowledge.v1.service.tag_value": {
        "type": "object",
        "properties": {
          "id": {
            "description": "The ID of the tag value.",
            "type": "string"
          },
          "value": {
            "description": "The value of the tag.",
            "type": "string"
          },
          "enabled": {
            "description": "Whether the tag value is enabled.",
            "type": "boolean"
          },
          "tag_id": {
            "description": "The ID of the tag.",
            "type": "string"
          },
          "date_created": {
            "description": "The date and time in GMT when the Tag Value 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 Tag Value was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "The URL of the Tag Value resource.",
            "type": "string"
          },
          "resource_id": {
            "description": "The ID of the resource.",
            "type": "string"
          },
          "resource_type": {
            "description": "The type of the resource.",
            "type": "string"
          },
          "account_sid": {
            "description": "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Tag Value resource.",
            "type": "string",
            "minLength": 34,
            "maxLength": 34,
            "pattern": "^AC[0-9a-fA-F]{32}$"
          }
        },
        "required": [
          "id",
          "value",
          "enabled",
          "tag_id",
          "date_created",
          "date_updated",
          "account_sid",
          "resource_id",
          "resource_type",
          "url"
        ]
      },
      "knowledge.v1.service.create_tag_value_request": {
        "type": "object",
        "properties": {
          "value": {
            "description": "The value of the tag.",
            "type": "string"
          },
          "enabled": {
            "description": "Whether the tag value is enabled.",
            "type": "boolean"
          },
          "tag_id": {
            "description": "The ID of the tag.",
            "type": "string"
          }
        },
        "required": [
          "value",
          "enabled",
          "tag_id"
        ]
      },
      "knowledge.v1.service.update_tag_value_request": {
        "type": "object",
        "properties": {
          "value": {
            "description": "The value of the tag.",
            "type": "string"
          },
          "enabled": {
            "description": "Whether the tag value is enabled.",
            "type": "boolean"
          }
        }
      }
    }
  },
  "openapi": "3.0.2",
  "info": {
    "title": "Twilio - Knowledge",
    "description": "This is the public Twilio REST API.",
    "termsOfService": "https://www.twilio.com/legal/tos",
    "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"
    },
    "version": "1.0.0",
    "x-twilio": {
      "apiStandards": "v0.1"
    }
  },
  "servers": [
    {
      "url": "https://knowledge.twilio.com"
    }
  ],
  "paths": {
    "/v1/Knowledge": {
      "servers": [
        {
          "url": "https://knowledge.twilio.com"
        }
      ],
      "get": {
        "operationId": "ListKnowledge",
        "summary": "List all knowledge",
        "description": "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",
                          "nullable": true,
                          "type": "string"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "page_size": {
                          "type": "integer"
                        },
                        "previous_page_url": {
                          "format": "uri",
                          "nullable": true,
                          "type": "string"
                        },
                        "url": {
                          "format": "uri",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "title": "ListKnowledgeResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "accountSid_authToken": []
          }
        ]
      },
      "post": {
        "operationId": "CreateKnowledge",
        "summary": "Create knowledge",
        "description": "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": []
          }
        ]
      }
    },
    "/v1/Knowledge/{id}": {
      "servers": [
        {
          "url": "https://knowledge.twilio.com"
        }
      ],
      "delete": {
        "operationId": "DeleteKnowledge",
        "summary": "Delete knowledge",
        "description": "Delete knowledge",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "the Knowledge ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "security": [
          {
            "accountSid_authToken": []
          }
        ]
      },
      "get": {
        "operationId": "FetchKnowledge",
        "summary": "Get knowledge",
        "description": "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": []
          }
        ]
      },
      "put": {
        "operationId": "UpdateKnowledge",
        "summary": "Update knowledge",
        "description": "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": []
          }
        ]
      }
    },
    "/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",
        "description": "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": []
          }
        ]
      }
    },
    "/v1/Knowledge/{id}/Chunks": {
      "servers": [
        {
          "url": "https://knowledge.twilio.com"
        }
      ],
      "x-twilio": {
        "parent": "/Knowledge/{id}",
        "pathType": "list"
      },
      "get": {
        "operationId": "ListKnowledgeChunks",
        "summary": "List knowledge chunks",
        "description": "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",
                          "nullable": true,
                          "type": "string"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "page_size": {
                          "type": "integer"
                        },
                        "previous_page_url": {
                          "format": "uri",
                          "nullable": true,
                          "type": "string"
                        },
                        "url": {
                          "format": "uri",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "title": "ListKnowledgeChunksResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "accountSid_authToken": []
          }
        ]
      }
    },
    "/v1/Knowledge/Upload": {
      "servers": [
        {
          "url": "https://knowledge.twilio.com"
        }
      ]
    }
  }
}