LogoLogo
AI TrainingUser Community
API Reference
API Reference
  • raia API
  • Users
  • Conversations
  • Prompts
  • Agents
  • Agent Files
  • Resource Usage Logs
  • Models
Powered by GitBook
On this page
Export as PDF

Agents

PreviousPromptsNextAgent Files
CtrlK
  • GETGet agent by API key
  • POSTCreate agent webhook

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
403

Invalid API key or secret key. Ensure that you are using a valid authentication key.

application/json
404

Agent not found.

application/json
500

Unexpected error occurred while processing the request. Please try again later.

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",
  "assistant": {
    "id": "asst_1234567890",
    "model": "gpt-3.5-turbo",
    "temperature": 1,
    "topP": 1,
    "instructions": "text",
    "tools": [
      {
        "type": "code_interpreter",
        "isEnabled": true
      }
    ],
    "responseFormat": "text"
  },
  "avatarUrl": "https://example.com/avatar.jpg",
  "status": "active",
  "skills": [
    {
      "systemName": "AGENT_SKILL_SYSTEM_NAME",
      "status": "active"
    }
  ]
}

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
403

Invalid API key or secret key. Ensure that you are using a valid authentication key.

application/json
404

Agent not found.

application/json
500

Unexpected error occurred while processing the request. Please try again later.

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"
}