NAME
Twilio::Rest::Knowledge::V1::Knowledge - The Knowledge resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $knowledge = $client->knowledge->v1->knowledge->create(\%body);
for my $knowledge ($client->knowledge->v1->knowledge->read({}, 20)) {
...
}
my $knowledge = $client->knowledge->v1->knowledge($id)->fetch;
$client->knowledge->v1->knowledge($id)->update(\%body);
$client->knowledge->v1->knowledge($id)->delete;
DESCRIPTION
This file holds KnowledgeList, KnowledgePage, KnowledgeContext and KnowledgeInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
KnowledgeList
Returned by $client->knowledge->v1->knowledge. See also Twilio::ListResource.
create
my $knowledge = $client->knowledge->v1->knowledge->create(\%body);
Create knowledge. Returns a KnowledgeInstance.
%body is sent as JSON. It takes the names Twilio's API documentation uses.
Its fields are:
description-
The description of the knowledge source.
embedding_model-
The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types.
knowledge_source_details-
The details of the knowledge source based on the type.
name-
Required. The name of the tool.
policy-
The policy associated with the knowledge source.
type-
Required. The type of the knowledge source.
read
my @records = $client->knowledge->v1->knowledge->read(\%options, $limit, $page_size);
List all knowledge. Returns the records as a list, fetching as many pages as it needs.
The options are:
-
Json array of tag and value pairs for tag filtering.
stream
my $stream = $client->knowledge->v1->knowledge->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->knowledge->v1->knowledge->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->knowledge->v1->knowledge->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->knowledge->v1->knowledge->get_context($id);
Returns a KnowledgeContext, and makes no request.
KnowledgePage
A Twilio::Page of KnowledgeInstance objects.
records_key
build_instance
Used by Twilio::Page.
KnowledgeContext
Returned by $client->knowledge->v1->knowledge($id). It makes no request until one of these methods is called.
fetch
my $knowledge = $client->knowledge->v1->knowledge($id)->fetch;
Get knowledge. Returns a KnowledgeInstance.
update
my $knowledge = $client->knowledge->v1->knowledge($id)->update(\%body);
Update knowledge. Returns a KnowledgeInstance.
%body is sent as JSON. It can be left out. When given, it takes the names Twilio's API documentation uses.
Its fields are:
description-
The description of the knowledge source.
embedding_model-
The embedding model to be used for the knowledge source. It's only applicable to 'Database' type.
knowledge_source_details-
The details of the knowledge source based on the type.
name-
The name of the knowledge source.
policy-
The policy associated with the knowledge source.
type-
The description of the knowledge source.
delete
$client->knowledge->v1->knowledge($id)->delete;
Delete knowledge. Returns true.
chunks
my $list = $object->chunks;
See Twilio::Rest::Knowledge::V1::Knowledge::Chunk.
knowledge_status
my $context = $object->knowledge_status;
See Twilio::Rest::Knowledge::V1::Knowledge::KnowledgeStatus.
KnowledgeInstance
See also Twilio::InstanceResource.
It has fetch, update, delete, chunks and knowledge_status, which work as they do on the context.
Its fields are:
- account_sid
-
The SID of the Account that created the Knowledge resource.
- date_created
-
The date and time in GMT when the Knowledge was created specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- date_updated
-
The date and time in GMT when the Knowledge was last updated specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- description
-
The type of knowledge source.
- embedding_model
-
The embedding model to be used for the knowledge source.
- id
-
The description of knowledge.
- knowledge_source_details
-
The details of the knowledge source based on the type.
- name
-
The name of the knowledge source.
- status
-
The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')
- type
-
The type of knowledge source ('Web', 'Database', 'Text', 'File')
- url
-
The url of the knowledge resource.
CONSTRUCTORS
new
Objects here come from the methods above, so there is no need to call new directly.
LICENSE
Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.