Create an RCS agent
Creates an editable RCS agent draft under a brand. The brand does not need to be submitted. When the brand status is no longer CREATED, Telnyx also creates the agent with the provider so test devices can be added before the agent is submitted. The Idempotency-Key is scoped to the authenticated organization. Reusing the key with the same request returns the original agent, while reusing it with a different request returns a conflict.
POST
/
rcs
/
agents
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const Agent = await client.rcs.agents.create({
brand_id: 'brand_id',
configuration: 'configuration',
display_name: 'display_name',
use_case: 'MULTI_USE',
'Idempotency-Key': 'idempotency-key',
});
console.log(Agent.agent_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
)
agent = client.rcs.agents.create(
brand_id="brand_id",
configuration="configuration",
display_name="display_name",
use_case="MULTI_USE",
idempotency_key="idempotency-key",
)
print(agent.agent_id)
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"),
)
agent, err := client.Rcs.Agents.New(
context.TODO(),
telnyx.RcAgentNewParams{
BrandID: "brand_id",
Configuration: "configuration",
DisplayName: "display_name",
UseCase: "use_case",
IdempotencyKey: "idempotency-key",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", agent.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.rcs.agents.AgentCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AgentCreateParams params = AgentCreateParams.builder()
.brandId("brand_id")
.configuration("configuration")
.displayName("display_name")
.useCase(AgentCreateParams.UseCase.MULTI_USE)
.idempotencyKey("idempotency-key")
.build();
var response = client.rcs().agents().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
agent = telnyx.rcs.agents.create(
brand_id: "brand_id",
configuration: "configuration",
display_name: "display_name",
use_case: :MULTI_USE,
idempotency_key: "idempotency-key"
)
puts(agent)<?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 = $client->rcs->agents->create(
brand_id: 'brand_id',
configuration: 'configuration',
display_name: 'display_name',
use_case: 'MULTI_USE',
idempotencyKey: 'idempotency-key',
);
var_dump($agent);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx rcs:agents create \
--api-key 'My API Key' \
--brand-id brand_id \
--display-name display_name \
--use-case MULTI_USE \
--configuration configuration \
--idempotency-key idempotency-keycurl --request POST \
--url https://api.telnyx.com/v2/rcs/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"brand_id": "11111111-1111-4111-8111-111111111111",
"display_name": "Acme Order Updates",
"use_case": "TRANSACTIONAL",
"configuration": {
"basics": {
"description": "Order confirmations and delivery updates",
"logo_url": "https://www.example.com/rcs/logo.png",
"hero_url": "https://www.example.com/rcs/hero.png",
"brand_color": "#123456",
"privacy_policy_url": "https://www.example.com/privacy",
"terms_and_conditions_url": "https://www.example.com/terms",
"email": {
"address": "[email protected]",
"label": "Support"
}
}
}
}
'{
"agent_id": "22222222-2222-4222-8222-222222222222",
"brand_id": "11111111-1111-4111-8111-111111111111",
"display_name": "Acme Order Updates",
"use_case": "TRANSACTIONAL",
"status": "SUBMITTED",
"profile_id": "40000000-0000-0000-0000-000000000001",
"basics_status": "SUBMITTED",
"campaign_status": null,
"testing_status": null,
"billing_category": "NON_CONVERSATIONAL",
"hosting_region": null,
"configuration": {
"basics": {
"description": "Order confirmations and delivery updates",
"logo_url": "https://www.example.com/rcs/logo.png",
"hero_url": "https://www.example.com/rcs/hero.png",
"brand_color": "#123456",
"privacy_policy_url": "https://www.example.com/privacy",
"terms_and_conditions_url": "https://www.example.com/terms",
"email": {
"address": "[email protected]",
"label": "Support"
}
},
"campaign": null,
"testing": null
},
"carrier_approvals": [],
"test_devices": [],
"capabilities": {
"brand_entity": true,
"brand_verification": true,
"submission_sections": true,
"distinct_launch_phase": false,
"per_carrier_approval": false,
"templates": false,
"campaigns": false,
"vendor_webhooks": false,
"invite_test_devices": false
}
}{
"detail": "The requested RCS resource was not found."
}{
"detail": "The requested RCS resource was not found."
}{
"detail": "The requested RCS resource was not found."
}{
"detail": "The requested RCS resource was not found."
}{
"detail": [
{
"loc": [
"body",
"display_name"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"detail": {
"field": "configuration.basics.logo_url",
"code": "image_unavailable",
"message": "image could not be retrieved"
}
}{
"detail": "The requested RCS resource was not found."
}Authorizations
Headers
Body
application/json
Response
The agent draft was created or replayed from the idempotency record.
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
});
const Agent = await client.rcs.agents.create({
brand_id: 'brand_id',
configuration: 'configuration',
display_name: 'display_name',
use_case: 'MULTI_USE',
'Idempotency-Key': 'idempotency-key',
});
console.log(Agent.agent_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
)
agent = client.rcs.agents.create(
brand_id="brand_id",
configuration="configuration",
display_name="display_name",
use_case="MULTI_USE",
idempotency_key="idempotency-key",
)
print(agent.agent_id)
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"),
)
agent, err := client.Rcs.Agents.New(
context.TODO(),
telnyx.RcAgentNewParams{
BrandID: "brand_id",
Configuration: "configuration",
DisplayName: "display_name",
UseCase: "use_case",
IdempotencyKey: "idempotency-key",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", agent.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.rcs.agents.AgentCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AgentCreateParams params = AgentCreateParams.builder()
.brandId("brand_id")
.configuration("configuration")
.displayName("display_name")
.useCase(AgentCreateParams.UseCase.MULTI_USE)
.idempotencyKey("idempotency-key")
.build();
var response = client.rcs().agents().create(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
agent = telnyx.rcs.agents.create(
brand_id: "brand_id",
configuration: "configuration",
display_name: "display_name",
use_case: :MULTI_USE,
idempotency_key: "idempotency-key"
)
puts(agent)<?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 = $client->rcs->agents->create(
brand_id: 'brand_id',
configuration: 'configuration',
display_name: 'display_name',
use_case: 'MULTI_USE',
idempotencyKey: 'idempotency-key',
);
var_dump($agent);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx rcs:agents create \
--api-key 'My API Key' \
--brand-id brand_id \
--display-name display_name \
--use-case MULTI_USE \
--configuration configuration \
--idempotency-key idempotency-keycurl --request POST \
--url https://api.telnyx.com/v2/rcs/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"brand_id": "11111111-1111-4111-8111-111111111111",
"display_name": "Acme Order Updates",
"use_case": "TRANSACTIONAL",
"configuration": {
"basics": {
"description": "Order confirmations and delivery updates",
"logo_url": "https://www.example.com/rcs/logo.png",
"hero_url": "https://www.example.com/rcs/hero.png",
"brand_color": "#123456",
"privacy_policy_url": "https://www.example.com/privacy",
"terms_and_conditions_url": "https://www.example.com/terms",
"email": {
"address": "[email protected]",
"label": "Support"
}
}
}
}
'{
"agent_id": "22222222-2222-4222-8222-222222222222",
"brand_id": "11111111-1111-4111-8111-111111111111",
"display_name": "Acme Order Updates",
"use_case": "TRANSACTIONAL",
"status": "SUBMITTED",
"profile_id": "40000000-0000-0000-0000-000000000001",
"basics_status": "SUBMITTED",
"campaign_status": null,
"testing_status": null,
"billing_category": "NON_CONVERSATIONAL",
"hosting_region": null,
"configuration": {
"basics": {
"description": "Order confirmations and delivery updates",
"logo_url": "https://www.example.com/rcs/logo.png",
"hero_url": "https://www.example.com/rcs/hero.png",
"brand_color": "#123456",
"privacy_policy_url": "https://www.example.com/privacy",
"terms_and_conditions_url": "https://www.example.com/terms",
"email": {
"address": "[email protected]",
"label": "Support"
}
},
"campaign": null,
"testing": null
},
"carrier_approvals": [],
"test_devices": [],
"capabilities": {
"brand_entity": true,
"brand_verification": true,
"submission_sections": true,
"distinct_launch_phase": false,
"per_carrier_approval": false,
"templates": false,
"campaigns": false,
"vendor_webhooks": false,
"invite_test_devices": false
}
}{
"detail": "The requested RCS resource was not found."
}{
"detail": "The requested RCS resource was not found."
}{
"detail": "The requested RCS resource was not found."
}{
"detail": "The requested RCS resource was not found."
}{
"detail": [
{
"loc": [
"body",
"display_name"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"detail": {
"field": "configuration.basics.logo_url",
"code": "image_unavailable",
"message": "image could not be retrieved"
}
}{
"detail": "The requested RCS resource was not found."
}