Agents

Get agent by API key

get

Fetches an agent by API key. The response includes the agent details.

Authorizations
Responses
200
Successfully retrieved the agent.
application/json
get
GET /external/agents/by-api-key HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Accept: */*
{
  "organizationId": "123e4567-e89b-12d3-a456-426614174000",
  "organizationName": "text",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "publicName": "text",
  "role": "text",
  "description": "text",
  "vectorStoreId": "vs_1234567890",
  "assistantId": "asst_1234567890",
  "avatarUrl": "https://example.com/avatar.jpg",
  "status": "active",
  "skills": [
    {
      "systemName": "AGENT_SKILL_SYSTEM_NAME",
      "status": "active",
      "email": "email@gmail.com",
      "senderName": "John Doe",
      "defaultSubject": "Subject of the email",
      "defaultEmailIntroduction": "Welcome to our service!",
      "emailSignature": "Thank you for your email!"
    }
  ]
}

Create agent webhook

post

Creates a new webhook for the agent identified by the API key.

Authorizations
Body
titlestringRequired

Title of the webhook

Example: My Webhook
descriptionstringRequired

Description of the webhook

Example: This webhook is triggered when a message is received
urlstringRequired

URL where the webhook will be sent

Example: https://api.example.com/webhook
triggerConditionstring · enumRequired

Condition that triggers the webhook

Example: each_messagePossible values:
headersobjectOptional

Optional headers to be sent with the webhook

Example: {"Authorization":"Bearer token"}
Responses
201
Successfully created the webhook.
application/json
post
POST /external/agents/webhooks HTTP/1.1
Host: api.raia2.com
Agent-Secret-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 208

{
  "title": "My Webhook",
  "description": "This webhook is triggered when a message is received",
  "url": "https://api.example.com/webhook",
  "triggerCondition": "each_message",
  "headers": {
    "Authorization": "Bearer token"
  }
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "agentId": "123e4567-e89b-12d3-a456-426614174000",
  "title": "My Webhook",
  "description": "This webhook is triggered when a message is received",
  "url": "https://api.example.com/webhook",
  "triggerCondition": "each_message",
  "headers": {
    "Authorization": "Bearer token"
  },
  "status": "active",
  "createdAt": "2024-03-20T12:00:00Z",
  "updatedAt": "2024-03-20T12:00:00Z"
}