Sources
Add and manage the training sources that power an agent.
List sources
Lists an agent's sources, newest first. Draft sources are excluded.
Scope: source:read · Rate limit: Read (120/min)
/agents/{agent}/sourcesBearer API key. Create one in your dashboard (Settings → API Keys); the full value is shown only once. Requires the organization owner on a premium or active AppSumo plan.
In: header
Path Parameters
The agent's UUID.
uuidQuery Parameters
Filter by source type.
"text" | "qa" | "url" | "file"Filter by training status.
"pending" | "processing" | "completed" | "failed"Page number.
11 <= valueItems per page.
251 <= value <= 100Response Body
curl -X GET "https://api.assistloop.ai/api/public/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/sources?type=text&status=pending&page=1&per_page=25"{
"data": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"type": "text",
"title": "string",
"status": "pending",
"is_draft": true,
"task_id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"meta": {
"current_page": 0,
"per_page": 0,
"total": 0,
"last_page": 0,
"request_id": "266ea41d-adf5-480b-af50-15b940c2b846"
},
"links": {
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}{
"message": "Unauthenticated."
}{
"error": {
"code": "insufficient_scope",
"message": "Token is missing required scope: source:create",
"details": []
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}Create a source
Creates a source and dispatches its training job. The required body depends on the type field. text, qa, and url use JSON; file uses multipart/form-data. A url request creates one source per URL and returns an array.
If the agent is disabled, returns 423 agent_unavailable. Quota overruns (text size, URL count, or document bytes) return 422 subscription_limit_exceeded.
Scope: source:create · Rate limit: Training (20/min)
/agents/{agent}/sourcesBearer API key. Create one in your dashboard (Settings → API Keys); the full value is shown only once. Requires the organization owner on a premium or active AppSumo plan.
In: header
Path Parameters
The agent's UUID.
uuidThe text to train on.
length <= 50000Optional; auto-generated from the content when omitted.
length <= 255Response Body
curl -X POST "https://api.assistloop.ai/api/public/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/sources" \ -H "Content-Type: application/json" \ -d '{ "type": "text", "title": "Refund policy", "content": "Customers may request a refund within 30 days of purchase..." }'{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"type": "text",
"title": "string",
"status": "pending",
"is_draft": true,
"task_id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
},
"meta": {
"request_id": "266ea41d-adf5-480b-af50-15b940c2b846"
}
}{
"message": "Unauthenticated."
}{
"error": {
"code": "insufficient_scope",
"message": "Token is missing required scope: source:create",
"details": []
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "validation_failed",
"message": "The content field is required.",
"details": [
{
"field": "content",
"message": "The content field is required."
}
]
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "agent_unavailable",
"message": "Agent is currently disabled.",
"details": []
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "upstream_failure",
"message": "Could not complete the request upstream.",
"details": []
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}Retrieve a source
The source must belong to the agent, otherwise 404 resource_not_found.
Scope: source:read · Rate limit: Read (120/min)
/agents/{agent}/sources/{source}Bearer API key. Create one in your dashboard (Settings → API Keys); the full value is shown only once. Requires the organization owner on a premium or active AppSumo plan.
In: header
Path Parameters
The agent's UUID.
uuidThe source's UUID. Must belong to the agent in the path.
uuidResponse Body
curl -X GET "https://api.assistloop.ai/api/public/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/sources/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"data": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"type": "text",
"title": "string",
"status": "pending",
"is_draft": true,
"task_id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
},
"meta": {
"request_id": "266ea41d-adf5-480b-af50-15b940c2b846"
}
}{
"message": "Unauthenticated."
}{
"error": {
"code": "insufficient_scope",
"message": "Token is missing required scope: source:create",
"details": []
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "resource_not_found",
"message": "Source not found.",
"details": []
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}Delete a source
Deletes the source, removes its file from storage (for file sources), and removes its embedded document from the training index. Deleting on a disabled agent returns 423 agent_unavailable.
Scope: source:delete · Rate limit: Write (60/min)
/agents/{agent}/sources/{source}Bearer API key. Create one in your dashboard (Settings → API Keys); the full value is shown only once. Requires the organization owner on a premium or active AppSumo plan.
In: header
Path Parameters
The agent's UUID.
uuidThe source's UUID. Must belong to the agent in the path.
uuidResponse Body
curl -X DELETE "https://api.assistloop.ai/api/public/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/sources/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"message": "Unauthenticated."
}{
"error": {
"code": "insufficient_scope",
"message": "Token is missing required scope: source:create",
"details": []
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "resource_not_found",
"message": "Source not found.",
"details": []
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "agent_unavailable",
"message": "Agent is currently disabled.",
"details": []
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": "upstream_failure",
"message": "Could not complete the request upstream.",
"details": []
},
"meta": {
"request_id": "b7f0b9c2-1a2b-4c3d-8e9f-0a1b2c3d4e5f"
}
}