# Knowledge Resource

[**Knowledge**](/docs/alpha/ai-assistants/knowledge) provides your Assistant with access to unstructured data sources. This API allows you to programmatically upload Knowledge for your Assistant to consume.

## Knowledge Properties

<OperationTable type="properties" data={{"type":"object","required":["id","name","type","date_created","date_updated"],"refName":"assistants.v1.service.knowledge","modelName":"assistants_v1_service_knowledge","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](/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"}}}} />

## Create new Knowledge sources

`POST https://assistants.twilio.com/v1/Knowledge`

### Request body parameters

```json
{"schema":{"type":"object","required":["name","type"],"refName":"assistants.v1.service.create_knowledge_request","modelName":"assistants_v1_service_create_knowledge_request","properties":{"assistant_id":{"type":"string","pattern":"^aia_asst_.+$","description":"The Assistant ID."},"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.","type":"object","required":["policy_details"],"refName":"assistants.v1.service.create_policy_request","modelName":"assistants_v1_service_create_policy_request","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"}}},"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"}}},"encodingType":"application/json","conditionalParameterMap":{}}
```

You can [configure Knowledge sources](/docs/alpha/ai-assistants/knowledge#configure-knowledge-sources) of type: `Web`, `Text`, and `File` from the API.

### Crawl a website

Give your Assistant a publicly-accessible URL to index information from. [See additional details about web crawling limits.](/docs/alpha/ai-assistants/knowledge#configure-knowledge-sources)

Crawl a website

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createKnowledge() {
  const knowledge = await client.assistants.v1.knowledge.create({
    description: "Use this for information about Twilio Alpha or AI Assistants",
    knowledge_source_details: {
      source: "https://twilioalpha.com",
    },
    name: "Info about Twilio Alpha",
    type: "Web",
  });

  console.log(knowledge.description);
}

createKnowledge();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client
from twilio.rest.assistants.v1 import KnowledgeList

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

knowledge = client.assistants.v1.knowledge.create(
    assistants_v1_service_create_knowledge_request=KnowledgeList.AssistantsV1ServiceCreateKnowledgeRequest(
        {
            "description": "Use this for information about Twilio Alpha or AI Assistants",
            "knowledge_source_details": {"source": "https://twilioalpha.com"},
            "name": "Info about Twilio Alpha",
            "type": "Web",
        }
    )
)

print(knowledge.description)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Assistants.V1;
using System.Threading.Tasks;
using System.Collections.Generic;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var knowledge = await KnowledgeResource.CreateAsync(
            assistantsV1ServiceCreateKnowledgeRequest: new KnowledgeResource
                .AssistantsV1ServiceCreateKnowledgeRequest.Builder()
                .WithDescription("Use this for information about Twilio Alpha or AI Assistants")
                .WithKnowledgeSourceDetails(
                    new Dictionary<string, Object>() { { "source", "https://twilioalpha.com" } })
                .WithName("Info about Twilio Alpha")
                .WithType("Web")
                .Build());

        Console.WriteLine(knowledge.Description);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import java.util.HashMap;
import com.twilio.Twilio;
import com.twilio.rest.assistants.v1.Knowledge;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

        Knowledge.AssistantsV1ServiceCreateKnowledgeRequest assistantsV1ServiceCreateKnowledgeRequest =
            new Knowledge.AssistantsV1ServiceCreateKnowledgeRequest();
        assistantsV1ServiceCreateKnowledgeRequest.setDescription(
            "Use this for information about Twilio Alpha or AI Assistants");
        assistantsV1ServiceCreateKnowledgeRequest.setKnowledgeSourceDetails(new HashMap<String, Object>() {
            {
                put("source", "https://twilioalpha.com");
            }
        });
        assistantsV1ServiceCreateKnowledgeRequest.setName("Info about Twilio Alpha");
        assistantsV1ServiceCreateKnowledgeRequest.setType("Web");

        Knowledge knowledge = Knowledge.creator(assistantsV1ServiceCreateKnowledgeRequest).create();

        System.out.println(knowledge.getDescription());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	assistants "github.com/twilio/twilio-go/rest/assistants/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &assistants.CreateKnowledgeParams{}
	params.SetAssistantsV1ServiceCreateKnowledgeRequest(assistants.assistants_v1_service_create_knowledge_request{
		Description: "Use this for information about Twilio Alpha or AI Assistants",
		KnowledgeSourceDetails: assistants.assistants_v1_service_create_knowledge_request{
			Source: "https://twilioalpha.com",
		},
		Name: "Info about Twilio Alpha",
		Type: "Web",
	})

	resp, err := client.AssistantsV1.CreateKnowledge(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.Description)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;
use Twilio\Rest\Assistants\V1\KnowledgeModels;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$knowledge = $twilio->assistants->v1->knowledge->create(
    KnowledgeModels::createAssistantsV1ServiceCreateKnowledgeRequest([
        "description" =>
            "Use this for information about Twilio Alpha or AI Assistants",
        "knowledgeSourceDetails" => [
            "source" => "https://twilioalpha.com",
        ],
        "name" => "Info about Twilio Alpha",
        "type" => "Web",
    ])
);

print $knowledge->description;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

knowledge = @client
            .assistants
            .v1
            .knowledge
            .create(
              assistants_v1_service_create_knowledge_request: {
                'description' => 'Use this for information about Twilio Alpha or AI Assistants',
                'knowledge_source_details' => {
                  'source' => 'https://twilioalpha.com'
                },
                'name' => 'Info about Twilio Alpha',
                'type' => 'Web'
              }
            )

puts knowledge.description
```

```bash
# This endpoint is not currently supported by the Twilio CLI. You can open an issue to request it on https://github.com/twilio/twilio-cli/issues
  # For an alternative low-code solution, check out https://www.twilio.com/docs/openapi/using-twilio-postman-collections
```

```bash
ASSISTANTS_V1_SERVICE_CREATE_KNOWLEDGE_REQUEST_OBJ=$(cat << EOF
{
  "description": "Use this for information about Twilio Alpha or AI Assistants",
  "knowledge_source_details": {
    "source": "https://twilioalpha.com"
  },
  "name": "Info about Twilio Alpha",
  "type": "Web"
}
EOF
)
curl -X POST "https://assistants.twilio.com/v1/Knowledge" \
--json "$ASSISTANTS_V1_SERVICE_CREATE_KNOWLEDGE_REQUEST_OBJ" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

### Upload text

Provide plain text for your Assistant.

Upload text

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createKnowledge() {
  const knowledge = await client.assistants.v1.knowledge.create({
    description: "Use this for famous Star Wars quotes",
    knowledge_source_details: {
      content: "This is the ship that made the Kessel Run in fourteen parsecs?",
    },
    name: "Star Wars Quotes",
    type: "Text",
  });

  console.log(knowledge.description);
}

createKnowledge();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client
from twilio.rest.assistants.v1 import KnowledgeList

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

knowledge = client.assistants.v1.knowledge.create(
    assistants_v1_service_create_knowledge_request=KnowledgeList.AssistantsV1ServiceCreateKnowledgeRequest(
        {
            "description": "Use this for famous Star Wars quotes",
            "knowledge_source_details": {
                "content": "This is the ship that made the Kessel Run in fourteen parsecs?"
            },
            "name": "Star Wars Quotes",
            "type": "Text",
        }
    )
)

print(knowledge.description)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Assistants.V1;
using System.Threading.Tasks;
using System.Collections.Generic;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var knowledge = await KnowledgeResource.CreateAsync(
            assistantsV1ServiceCreateKnowledgeRequest: new KnowledgeResource
                .AssistantsV1ServiceCreateKnowledgeRequest.Builder()
                .WithDescription("Use this for famous Star Wars quotes")
                .WithKnowledgeSourceDetails(new Dictionary<string, Object>() {
                    { "content", "This is the ship that made the Kessel Run in fourteen parsecs?" }
                })
                .WithName("Star Wars Quotes")
                .WithType("Text")
                .Build());

        Console.WriteLine(knowledge.Description);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import java.util.HashMap;
import com.twilio.Twilio;
import com.twilio.rest.assistants.v1.Knowledge;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

        Knowledge.AssistantsV1ServiceCreateKnowledgeRequest assistantsV1ServiceCreateKnowledgeRequest =
            new Knowledge.AssistantsV1ServiceCreateKnowledgeRequest();
        assistantsV1ServiceCreateKnowledgeRequest.setDescription("Use this for famous Star Wars quotes");
        assistantsV1ServiceCreateKnowledgeRequest.setKnowledgeSourceDetails(new HashMap<String, Object>() {
            {
                put("content", "This is the ship that made the Kessel Run in fourteen parsecs?");
            }
        });
        assistantsV1ServiceCreateKnowledgeRequest.setName("Star Wars Quotes");
        assistantsV1ServiceCreateKnowledgeRequest.setType("Text");

        Knowledge knowledge = Knowledge.creator(assistantsV1ServiceCreateKnowledgeRequest).create();

        System.out.println(knowledge.getDescription());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	assistants "github.com/twilio/twilio-go/rest/assistants/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &assistants.CreateKnowledgeParams{}
	params.SetAssistantsV1ServiceCreateKnowledgeRequest(assistants.assistants_v1_service_create_knowledge_request{
		Description: "Use this for famous Star Wars quotes",
		KnowledgeSourceDetails: assistants.assistants_v1_service_create_knowledge_request{
			Content: "This is the ship that made the Kessel Run in fourteen parsecs?",
		},
		Name: "Star Wars Quotes",
		Type: "Text",
	})

	resp, err := client.AssistantsV1.CreateKnowledge(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.Description)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;
use Twilio\Rest\Assistants\V1\KnowledgeModels;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$knowledge = $twilio->assistants->v1->knowledge->create(
    KnowledgeModels::createAssistantsV1ServiceCreateKnowledgeRequest([
        "description" => "Use this for famous Star Wars quotes",
        "knowledgeSourceDetails" => [
            "content" =>
                "This is the ship that made the Kessel Run in fourteen parsecs?",
        ],
        "name" => "Star Wars Quotes",
        "type" => "Text",
    ])
);

print $knowledge->description;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

knowledge = @client
            .assistants
            .v1
            .knowledge
            .create(
              assistants_v1_service_create_knowledge_request: {
                'description' => 'Use this for famous Star Wars quotes',
                'knowledge_source_details' => {
                  'content' => 'This is the ship that made the Kessel Run in fourteen parsecs?'
                },
                'name' => 'Star Wars Quotes',
                'type' => 'Text'
              }
            )

puts knowledge.description
```

```bash
# This endpoint is not currently supported by the Twilio CLI. You can open an issue to request it on https://github.com/twilio/twilio-cli/issues
  # For an alternative low-code solution, check out https://www.twilio.com/docs/openapi/using-twilio-postman-collections
```

```bash
ASSISTANTS_V1_SERVICE_CREATE_KNOWLEDGE_REQUEST_OBJ=$(cat << EOF
{
  "description": "Use this for famous Star Wars quotes",
  "knowledge_source_details": {
    "content": "This is the ship that made the Kessel Run in fourteen parsecs?"
  },
  "name": "Star Wars Quotes",
  "type": "Text"
}
EOF
)
curl -X POST "https://assistants.twilio.com/v1/Knowledge" \
--json "$ASSISTANTS_V1_SERVICE_CREATE_KNOWLEDGE_REQUEST_OBJ" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

### Upload a file

Upload a file for your Assistant to reference. [See supported file types](/docs/alpha/ai-assistants/knowledge#configure-knowledge-sources).

Upload a file

```js
const fs = require('fs');
// Before running this code, install "form-data" and "axios" using `npm install form-data axios`
const FormData = require('form-data');
const axios = require('axios');

// Provision API Keys at twilio.com/console/runtime/api-keys
// and set the environment variables. See https://twil.io/secure
const apiKey = process.env.TWILIO_API_KEY;
const apiSecret = process.env.TWILIO_API_SECRET;

const uploadUrl = `https://assistants-upload.twilio.com/v1/Knowledge/Upload`;

const form = new FormData();
form.append('name', 'File Demo');
form.append('description', 'A description of this file')
form.append('type', 'File');
form.append('assistant_id', 'aia_asst_xxxxxxxxxxxxxxxx');
form.append('file_0', fs.createReadStream('README.md'), {
  contentType: 'text/markdown',
});

// Create a new Function Version
axios
  .post(uploadUrl, form, {
    auth: {
      username: apiKey,
      password: apiSecret,
    },
    headers: form.getHeaders(),
  })
  .then((response) => {
    const newKnowledgeId = response.data.id;
    console.log(newKnowledgeId);
  });
```

```py
import os
import requests
import json

# Provision API Keys at twilio.com/console/runtime/api-keys
# and set the environment variables. See https://twil.io/secure
api_key = os.environ['TWILIO_API_KEY']
api_secret = os.environ['TWILIO_API_SECRET']

upload_url = 'https://assistants-upload.twilio.com/v1/Knowledge/Upload'

file_contents = open('README.md', 'rb')

# Create a new Function Version
response = requests.post(
    upload_url,
    auth=(api_key, api_secret),
    files={
        'file_0': ('README.md', file_contents, 'text/markdown')
    },
    data={
        'name': 'File Demo',
        'description': 'A description of this file',
        'type': 'File',
        'assistant_id': 'aia_asst_xxxxxxxxxxxxxxxx'
    },
)

new_version_id = json.loads(response.text).get("id")
print(new_version_id)
```

```java
import java.io.File;

import kong.unirest.HttpResponse;
import kong.unirest.JsonNode;
import kong.unirest.Unirest;
import kong.unirest.json.JSONObject;

public class UploadFunctionExample {
  public static void main(String[] args) {
    // Provision API Keys at twilio.com/console/runtime/api-keys
    // and set the environment variables. See https://twil.io/secure
    String TWILIO_API_KEY = System.getenv("TWILIO_API_KEY");
    String TWILIO_API_SECRET = System.getenv("TWILIO_API_SECRET");

    String upload_url = "https://assistants-upload.twilio.com/v1/Knowledge/Upload"

    HttpResponse<JsonNode> response = Unirest.post(upload_url)
        .basicAuth(TWILIO_API_KEY, TWILIO_API_SECRET)
        .field("file_0", new File("README.md"), "text/markdown")
        .field("name", "File Demo")
        .field("description", "A description of this file")
        .field("type", "File")
        .charset(null)
        .asJson();

    JSONObject knowledge_source = response.getBody().getObject();
    String knowledge_source_id = function_version.get("id").toString();
    System.out.println(knowledge_source_id);
  }
}
```

```php
<?php

# Provision API Keys at twilio.com/console/runtime/api-keys
# and set the environment variables. See https://twil.io/secure
$api_key = getenv("TWILIO_API_KEY");
$api_secret = getenv("TWILIO_API_SECRET");

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://assistants-upload.twilio.com/v1/Knowledge/Upload",
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => array(
    'file_0' => new CURLFile(
      'README.md',
      'text/markdown',
      'README.md'
    ),
    'name' => 'File Demo',
    'description' => 'A description of this file'
    'type' => 'File'
    'assistant_id' => 'aia_asst_xxxxxxxxxxxxxxxx'
  ),
  CURLOPT_USERPWD => $api_key . ":" . $api_secret,
  CURLOPT_RETURNTRANSFER => true
));

# Create a new Function Version
$response = curl_exec($curl);
curl_close($curl);

$data = json_decode($response);
echo $data->id;
```

```rb
require 'uri'
require 'http'
require 'json'

# Provision API Keys at twilio.com/console/runtime/api-keys
# and set the environment variables. See https://twil.io/secure
api_key = ENV['TWILIO_API_KEY']
api_secret = ENV['TWILIO_API_SECRET']

upload_url = "https://assistants-upload.twilio.com/v1/Knowledge/Upload"

response = HTTP
           .basic_auth(user: api_key, pass: api_secret)
           .post(upload_url, form: {
                   'file_0' => HTTP::FormData::File.new(
                     'README.md',
                     content_type: 'text/markdown',
                     filename: 'README.md'
                   ),
                   'name' => 'File Demo',
                   'description' => 'A description of this file'
                   'type' => 'File'
                   'assistant_id' => 'aia_asst_xxxxxxxxxxxxxxxx'
                 })

data = response.parse
puts data['id']
```

```bash
curl -X POST "https://assistants-upload.twilio.com/v1/Knowledge/Upload" \
-F "file_0=@README.md; type=text/markdown" \
-F "name=File Demo" \
-F "description=A description of this file" \
-F "type=File" \
-u "TWILIO_API_KEY:TWILIO_API_SECRET"
```

## Get a Knowledge source

`GET https://assistants.twilio.com/v1/Knowledge/{id}`

### Path parameters

```json
[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]
```

### Get a Knowledge source

Fetch details about a single Knowledge source

Get a Knowledge source

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchKnowledge() {
  const knowledge = await client.assistants.v1.knowledge("aia_know").fetch();

  console.log(knowledge.description);
}

fetchKnowledge();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

knowledge = client.assistants.v1.knowledge("aia_know").fetch()

print(knowledge.description)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Assistants.V1;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var knowledge = await KnowledgeResource.FetchAsync(pathId: "aia_know");

        Console.WriteLine(knowledge.Description);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.assistants.v1.Knowledge;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Knowledge knowledge = Knowledge.fetcher("aia_know").fetch();

        System.out.println(knowledge.getDescription());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.AssistantsV1.FetchKnowledge("aia_know")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.Description)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$knowledge = $twilio->assistants->v1->knowledge("aia_know")->fetch();

print $knowledge->description;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

knowledge = @client
            .assistants
            .v1
            .knowledge('aia_know')
            .fetch

puts knowledge.description
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:assistants:v1:knowledge:list \
   --id aia_know
```

```bash
curl -X GET "https://assistants.twilio.com/v1/Knowledge/aia_know" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_created": "2009-07-06T20:30:00Z",
  "date_updated": "2009-07-06T20:30:00Z",
  "description": "description",
  "embedding_model": "embedding_model",
  "id": "aia_know",
  "knowledge_source_details": {},
  "name": "Miss Christine Morgan",
  "status": "status",
  "type": "type",
  "url": "https://www.example.com"
}
```

### Fetch status of a Knowledge source

`GET https://assistants.twilio.com/v1/Knowledge/{id}/Status`

When you create a Knowledge source, Twilio AI Assistants processes the Knowledge so it's accessible to your Assistant.
You can fetch the **status** of processing for a given Knowledge Source.

Get the status of a Knowledge source

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchKnowledgeStatus() {
  const knowledgeStatus = await client.assistants.v1
    .knowledge("aia_know")
    .knowledgeStatus()
    .fetch();

  console.log(knowledgeStatus.accountSid);
}

fetchKnowledgeStatus();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

knowledge_status = (
    client.assistants.v1.knowledge("aia_know").knowledge_status().fetch()
)

print(knowledge_status.account_sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Assistants.V1.Knowledge;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var knowledgeStatus = await KnowledgeStatusResource.FetchAsync(pathId: "aia_know");

        Console.WriteLine(knowledgeStatus.AccountSid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.assistants.v1.knowledge.KnowledgeStatus;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        KnowledgeStatus knowledgeStatus = KnowledgeStatus.fetcher("aia_know").fetch();

        System.out.println(knowledgeStatus.getAccountSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.AssistantsV1.FetchKnowledgeStatus("aia_know")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.AccountSid)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$knowledge_status = $twilio->assistants->v1
    ->knowledge("aia_know")
    ->knowledgeStatus()
    ->fetch();

print $knowledge_status->accountSid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

knowledge_status = @client
                   .assistants
                   .v1
                   .knowledge('aia_know')
                   .knowledge_status
                   .fetch

puts knowledge_status.account_sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:assistants:v1:knowledge:status:fetch \
   --id aia_know
```

```bash
curl -X GET "https://assistants.twilio.com/v1/Knowledge/aia_know/Status" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_updated": "2009-07-06T20:30:00Z",
  "last_status": "last_status",
  "status": "status"
}
```

## List Knowledge sources

`GET https://assistants.twilio.com/v1/Knowledge`

### Query parameters

```json
[{"explode":false,"in":"query","name":"AssistantId","schema":{"type":"string"}},{"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"}}]
```

List all knowledge

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listKnowledge() {
  const knowledge = await client.assistants.v1.knowledge.list({ limit: 20 });

  knowledge.forEach((k) => console.log(k.description));
}

listKnowledge();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

knowledge = client.assistants.v1.knowledge.list(limit=20)

for record in knowledge:
    print(record.description)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Assistants.V1;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var knowledge = await KnowledgeResource.ReadAsync(limit: 20);

        foreach (var record in knowledge) {
            Console.WriteLine(record.Description);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.assistants.v1.Knowledge;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<Knowledge> knowledge = Knowledge.reader().limit(20).read();

        for (Knowledge record : knowledge) {
            System.out.println(record.getDescription());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	assistants "github.com/twilio/twilio-go/rest/assistants/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &assistants.ListKnowledgeParams{}
	params.SetLimit(20)

	resp, err := client.AssistantsV1.ListKnowledge(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			fmt.Println(resp[record].Description)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$knowledge = $twilio->assistants->v1->knowledge->read([], 20);

foreach ($knowledge as $record) {
    print $record->description;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

knowledge = @client
            .assistants
            .v1
            .knowledge
            .list(limit: 20)

knowledge.each do |record|
   puts record.description
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:assistants:v1:knowledge:list
```

```bash
curl -X GET "https://assistants.twilio.com/v1/Knowledge?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "knowledge": [
    {
      "description": "description",
      "id": "aia_know_#",
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "knowledge_source_details": {},
      "name": "name",
      "status": "status",
      "type": "type",
      "url": "https://www.example.com",
      "embedding_model": "embedding_model",
      "date_created": "2009-07-06T20:30:00Z",
      "date_updated": "2009-07-06T20:30:00Z"
    }
  ],
  "meta": {
    "first_page_url": "https://www.example.com",
    "key": "key",
    "next_page_url": "https://www.example.com",
    "page": 42,
    "page_size": 42,
    "previous_page_url": "https://www.example.com",
    "url": "https://www.example.com"
  }
}
```

## Update a Knowledge source

`PUT https://assistants.twilio.com/v1/Knowledge/{id}`

### Path parameters

```json
[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}]
```

### Request body parameters

```json
{"schema":{"type":"object","refName":"assistants.v1.service.update_knowledge_request","modelName":"assistants_v1_service_update_knowledge_request","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.","type":"object","required":["policy_details"],"refName":"assistants.v1.service.create_policy_request","modelName":"assistants_v1_service_create_policy_request","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"}}},"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"}}},"encodingType":"application/json","conditionalParameterMap":{}}
```

Update a Knowledge source

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateKnowledge() {
  const knowledge = await client.assistants.v1.knowledge("aia_know").update({
    description: "Updated Knowledge description.",
  });

  console.log(knowledge.description);
}

updateKnowledge();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client
from twilio.rest.assistants.v1 import KnowledgeList

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

knowledge = client.assistants.v1.knowledge("aia_know").update(
    assistants_v1_service_update_knowledge_request=KnowledgeList.AssistantsV1ServiceUpdateKnowledgeRequest(
        {"description": "Updated Knowledge description."}
    )
)

print(knowledge.description)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Assistants.V1;
using System.Threading.Tasks;
using System.Collections.Generic;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var knowledge = await KnowledgeResource.UpdateAsync(new UpdateKnowledgeOptions("aia_know") {
            AssistantsV1ServiceUpdateKnowledgeRequest =
                new KnowledgeResource.AssistantsV1ServiceUpdateKnowledgeRequest.Builder()
                    .WithDescription("Updated Knowledge description.")
                    .Build()
        });

        Console.WriteLine(knowledge.Description);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import java.util.HashMap;
import com.twilio.Twilio;
import com.twilio.rest.assistants.v1.Knowledge;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

        Knowledge.AssistantsV1ServiceUpdateKnowledgeRequest assistantsV1ServiceUpdateKnowledgeRequest =
            new Knowledge.AssistantsV1ServiceUpdateKnowledgeRequest();
        assistantsV1ServiceUpdateKnowledgeRequest.setDescription("Updated Knowledge description.");

        Knowledge knowledge = Knowledge.updater("aia_know", assistantsV1ServiceUpdateKnowledgeRequest).update();

        System.out.println(knowledge.getDescription());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	assistants "github.com/twilio/twilio-go/rest/assistants/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &assistants.UpdateKnowledgeParams{}
	params.SetAssistantsV1ServiceUpdateKnowledgeRequest(assistants.assistants_v1_service_update_knowledge_request{
		Description: "Updated Knowledge description.",
	})

	resp, err := client.AssistantsV1.UpdateKnowledge("aia_know",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.Description)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;
use Twilio\Rest\Assistants\V1\KnowledgeModels;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$knowledge = $twilio->assistants->v1->knowledge("aia_know")->update(
    KnowledgeModels::createAssistantsV1ServiceUpdateKnowledgeRequest([
        "description" => "Updated Knowledge description.",
    ])
);

print $knowledge->description;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

knowledge = @client
            .assistants
            .v1
            .knowledge('aia_know')
            .update(
              assistants_v1_service_update_knowledge_request: {
                'description' => 'Updated Knowledge description.'
              }
            )

puts knowledge.description
```

```bash
# This endpoint is not currently supported by the Twilio CLI. You can open an issue to request it on https://github.com/twilio/twilio-cli/issues
  # For an alternative low-code solution, check out https://www.twilio.com/docs/openapi/using-twilio-postman-collections
```

```bash
ASSISTANTS_V1_SERVICE_UPDATE_KNOWLEDGE_REQUEST_OBJ=$(cat << EOF
{
  "description": "Updated Knowledge description."
}
EOF
)
curl -X PUT "https://assistants.twilio.com/v1/Knowledge/aia_know" \
--json "$ASSISTANTS_V1_SERVICE_UPDATE_KNOWLEDGE_REQUEST_OBJ" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "date_created": "2009-07-06T20:30:00Z",
  "date_updated": "2009-07-06T20:30:00Z",
  "description": "Updated Knowledge description.",
  "embedding_model": "embedding_model",
  "id": "aia_know",
  "knowledge_source_details": {},
  "name": "Miss Christine Morgan",
  "status": "status",
  "type": "type",
  "url": "https://www.example.com"
}
```

## Delete a Knowledge source

`DELETE https://assistants.twilio.com/v1/Knowledge/{id}`

### Path parameters

```json
[{"in":"path","name":"id","description":"the Knowledge ID.","required":true,"schema":{"type":"string"}}]
```

Delete a Knowledge source

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function deleteKnowledge() {
  await client.assistants.v1.knowledge("aia_know").remove();
}

deleteKnowledge();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

client.assistants.v1.knowledge("aia_know").delete()
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Assistants.V1;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        await KnowledgeResource.DeleteAsync(pathId: "aia_know");
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.assistants.v1.Knowledge;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Knowledge.deleter("aia_know").delete();
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	err := client.AssistantsV1.DeleteKnowledge("aia_know")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$twilio->assistants->v1->knowledge("aia_know")->delete();
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client
  .assistants
  .v1
  .knowledge('aia_know')
  .delete
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:assistants:v1:knowledge:remove \
   --id aia_know
```

```bash
curl -X DELETE "https://assistants.twilio.com/v1/Knowledge/aia_know" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```
