Create an RCS agent
Creates an editable RCS agent draft under a brand. 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.
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": "The requested RCS resource was not found."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
A caller-generated key containing letters, numbers, underscores, or hyphens. Reuse the same key and request body when retrying the same logical agent creation.
1 - 255^[A-Za-z0-9_-]+$Body
1 - 40MULTI_USE, PROMOTIONAL, TRANSACTIONAL, OTP Show child attributes
Show child attributes
A Messaging Profile owned by the authenticated organization. When omitted, the agent inherits the brand profile.
3632Response
The agent draft was created or replayed from the idempotency record.
MULTI_USE, PROMOTIONAL, TRANSACTIONAL, OTP CREATED, SUBMITTED, VERIFYING, VERIFIED, LAUNCHING, LAUNCHED, LIVE, REJECTED, FAILED SUBMITTED, APPROVED, REJECTED SUBMITTED, APPROVED, REJECTED SUBMITTED, APPROVED, REJECTED NON_CONVERSATIONAL, CONVERSATIONAL Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
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": "The requested RCS resource was not found."
}