Delete a team
Deletes a team that has no keys and returns it. A team that still has keys answers 409; delete or move its keys first. The instance must be ready; otherwise the request answers 409.
DELETE
/
agent_gateways
/
{instance_id}
/
teams
/
{team_id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
await client.agentGateways.teams.delete('instance_id', 'team_id');import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
client.agent_gateways.teams.delete(
"instance_id",
"team_id",
)
package main
import (
"context"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.AgentGateways.Teams.Delete(
context.TODO(),
"instance_id",
"team_id",
)
if err != nil {
panic(err.Error())
}
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
client.agentGateways().teams().delete("instance_id", "team_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
agent_gateway_team = telnyx.agent_gateways.teams.delete("instance_id", "team_id")
puts(agent_gateway_team)<?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 {
$agent_gateway_team = $client->agentGateways->teams->delete(
'instance_id',
'team_id',
);
var_dump($agent_gateway_team);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways:teams delete \
--api-key 'My API Key' \
--instance-id ecffdf4b-93ea-4a7b-8295-51dfd2077996 \
--team-id 0b6c5d4e-3f2a-4b1c-9d8e-7f6a5b4c3d2ecurl --request DELETE \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id}/teams/{team_id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "0b6c5d4e-3f2a-4b1c-9d8e-7f6a5b4c3d2e",
"name": "support",
"models": [
"GLM-5.3-Flash",
"Qwen3.8-27B-nothink"
],
"max_budget": 50,
"budget_resets_every": "30d",
"budget_resets_at": "2026-11-20T19:35:00Z",
"spend": 0,
"created_at": "2026-10-21T19:35:00Z",
"blocked": false,
"requests_per_minute": 120,
"tokens_per_minute": null
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
}
}
]
}{
"errors": [
{
"code": "10021",
"title": "Resource in use",
"detail": "The resource can not be removed as it is still in use.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10021"
}
}
]
}{
"errors": [
{
"code": "99903",
"title": "Engine unavailable",
"detail": "The instance's engine did not answer; try again shortly."
}
]
}Authorizations
Telnyx API key
Path Parameters
The Agent Gateway's id.
The team's id.
Response
The deleted team
A team on an instance: a model list, a budget, and rate limits that its keys share.
Show child attributes
Show child attributes
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
await client.agentGateways.teams.delete('instance_id', 'team_id');import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
client.agent_gateways.teams.delete(
"instance_id",
"team_id",
)
package main
import (
"context"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.AgentGateways.Teams.Delete(
context.TODO(),
"instance_id",
"team_id",
)
if err != nil {
panic(err.Error())
}
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
client.agentGateways().teams().delete("instance_id", "team_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
agent_gateway_team = telnyx.agent_gateways.teams.delete("instance_id", "team_id")
puts(agent_gateway_team)<?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 {
$agent_gateway_team = $client->agentGateways->teams->delete(
'instance_id',
'team_id',
);
var_dump($agent_gateway_team);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways:teams delete \
--api-key 'My API Key' \
--instance-id ecffdf4b-93ea-4a7b-8295-51dfd2077996 \
--team-id 0b6c5d4e-3f2a-4b1c-9d8e-7f6a5b4c3d2ecurl --request DELETE \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id}/teams/{team_id} \
--header 'Authorization: Bearer <token>'{
"data": {
"id": "0b6c5d4e-3f2a-4b1c-9d8e-7f6a5b4c3d2e",
"name": "support",
"models": [
"GLM-5.3-Flash",
"Qwen3.8-27B-nothink"
],
"max_budget": 50,
"budget_resets_every": "30d",
"budget_resets_at": "2026-11-20T19:35:00Z",
"spend": 0,
"created_at": "2026-10-21T19:35:00Z",
"blocked": false,
"requests_per_minute": 120,
"tokens_per_minute": null
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
}
}
]
}{
"errors": [
{
"code": "10021",
"title": "Resource in use",
"detail": "The resource can not be removed as it is still in use.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10021"
}
}
]
}{
"errors": [
{
"code": "99903",
"title": "Engine unavailable",
"detail": "The instance's engine did not answer; try again shortly."
}
]
}