AgentsRetrain agent

Retrain agent

Queues website retraining and re-processes uploaded documents for an agent. Costs 10 credits. The API does not accept selected pages; website discovery is automatic.

curl -X POST "https://api.sendkit.ai/v1/agents/example_string/retrain" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY"
{
  "success": true,
  "data": {
    "_id": "example_string",
    "name": "John Doe",
    "companyInfo": {
      "name": "John Doe",
      "domain": "example_string",
      "industry": "example_string",
      "description": "example_string"
    },
    "persona": {
      "tone": "professional",
      "role": "example_string",
      "communicationStyle": "example_string",
      "customInstructions": "example_string"
    },
    "autonomousMode": {
      "enabled": true,
      "confidenceThreshold": 3.14,
      "maxAutoRepliesPerLead": 42,
      "onlyPositiveReplies": true,
      "skipOOO": true,
      "workingHours": {
        "enabled": true,
        "startHour": 42,
        "endHour": 42,
        "timezone": "example_string"
      },
      "escalationEmail": "user@example.com",
      "cooldownMinutes": 42,
      "mode": "ai",
      "template": "example_string"
    },
    "followupSettings": {
      "enabled": true,
      "maxFollowups": 42,
      "intervalDays": 42,
      "mode": "ai",
      "templates": [
        "example_string"
      ]
    },
    "uploadedDocuments": [
      {
        "fileName": "John Doe",
        "fileKey": "example_string",
        "fileUrl": "example_string",
        "fileType": "pdf",
        "fileSize": 42,
        "uploadedAt": "2024-12-25T10:00:00Z",
        "status": "processing"
      }
    ],
    "trainingStatus": "pending",
    "trainingProgress": 3.14,
    "trainingError": "example_string",
    "knowledgeBase": {
      "totalPages": 25,
      "totalChunks": 42,
      "lastScrapedAt": "2024-12-25T10:00:00Z",
      "domain": "example_string"
    },
    "isDefault": true,
    "isActive": true,
    "usage": {},
    "createdAt": "2024-12-25T10:00:00Z"
  },
  "meta": {
    "creditsCharged": 3.14,
    "jobs": [
      {
        "id": "example_string",
        "type": "example_string"
      }
    ]
  }
}
POST
/v1/agents/{agentId}/retrain
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-Api-Key)
X-Api-Keystring
Required

Platform API key (sk_user_...) or Workspace API key (sk_...)

Platform API key (sk_user_...) or Workspace API key (sk_...)
Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-Api-Keystring
Required

API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)

Path Parameters

Responses

successboolean
dataobject
metaobject