Add Assistant Tag
POST
/
ai
/
assistants
/
{assistant_id}
/
tags
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.assistants.tags.add('assistant_id', { tag: 'tag' });
console.log(response.tags);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.ai.assistants.tags.add(
assistant_id="assistant_id",
tag="tag",
)
print(response.tags)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.AI.Assistants.Tags.Add(
context.TODO(),
"assistant_id",
telnyx.AIAssistantTagAddParams{
Tag: "tag",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Tags)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.tags.TagAddParams;
import com.telnyx.sdk.models.ai.assistants.tags.TagAddResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TagAddParams params = TagAddParams.builder()
.assistantId("assistant_id")
.tag("tag")
.build();
TagAddResponse response = client.ai().assistants().tags().add(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.assistants.tags.add("assistant_id", tag: "tag")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->ai->assistants->tags->add('assistant_id', tag: 'tag');
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants:tags add \
--api-key 'My API Key' \
--assistant-id assistant_id \
--tag tagcurl --request POST \
--url https://api.telnyx.com/v2/ai/assistants/{assistant_id}/tags \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tag": "<string>"
}
'{
"tags": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the assistant.
Body
application/json
Response
Successful Response
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.assistants.tags.add('assistant_id', { tag: 'tag' });
console.log(response.tags);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.ai.assistants.tags.add(
assistant_id="assistant_id",
tag="tag",
)
print(response.tags)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.AI.Assistants.Tags.Add(
context.TODO(),
"assistant_id",
telnyx.AIAssistantTagAddParams{
Tag: "tag",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Tags)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.tags.TagAddParams;
import com.telnyx.sdk.models.ai.assistants.tags.TagAddResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TagAddParams params = TagAddParams.builder()
.assistantId("assistant_id")
.tag("tag")
.build();
TagAddResponse response = client.ai().assistants().tags().add(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.assistants.tags.add("assistant_id", tag: "tag")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->ai->assistants->tags->add('assistant_id', tag: 'tag');
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants:tags add \
--api-key 'My API Key' \
--assistant-id assistant_id \
--tag tagcurl --request POST \
--url https://api.telnyx.com/v2/ai/assistants/{assistant_id}/tags \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tag": "<string>"
}
'{
"tags": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}