Training Data
Endpoints for managing training data sources used by Pylon AI.
Use Training Data to connect external knowledge sources that power Pylon’s AI.
For UI setup and behavior, see Training Data.
Endpoints
Returns all training data configurations for the organization.
Rate limit: 300 requests per minute
Authorization: Bearer
The request was invalid or could not be completed.
The request could not be authenticated for this API.
The authenticated caller or organization is not allowed to access this endpoint or operation.
The request exceeded the applicable rate limit.
An unexpected internal error occurred.
GET /training-data HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": [
{
"created_at": "2026-01-01T00:00:00.000Z",
"documents": [
{
"external_id": "text",
"file_name": "text",
"file_size": 1,
"file_type": "text",
"id": "text",
"s3_key": "text"
}
],
"exclude_from_kb_search": true,
"id": "text",
"name": "text",
"scrape_status": {
"last_scraped_at": "2026-01-01T00:00:00.000Z",
"pages_scraped": 1,
"status": "text",
"total_pages": 1
},
"type": "text",
"updated_at": "2026-01-01T00:00:00.000Z",
"visibility": "everyone"
}
],
"request_id": "text"
}Creates a new training data configuration for the organization.
Rate limit: 30 requests per minute
Authorization: Bearer
The name of the training data container.
The visibility of the training data. Defaults to "everyone". Valid values: "everyone", "user_only", "ai_agent_only"
everyoneExample: everyonePossible values: The request was invalid or could not be completed.
The request could not be authenticated for this API.
The authenticated caller or organization is not allowed to access this endpoint or operation.
The request exceeded the applicable rate limit.
An unexpected internal error occurred.
POST /training-data HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 53
{
"training_data_name": "text",
"visibility": "everyone"
}{
"data": {
"created_at": "2026-01-01T00:00:00.000Z",
"documents": [
{
"external_id": "text",
"file_name": "text",
"file_size": 1,
"file_type": "text",
"id": "text",
"s3_key": "text"
}
],
"exclude_from_kb_search": true,
"id": "text",
"name": "text",
"scrape_status": {
"last_scraped_at": "2026-01-01T00:00:00.000Z",
"pages_scraped": 1,
"status": "text",
"total_pages": 1
},
"type": "text",
"updated_at": "2026-01-01T00:00:00.000Z",
"visibility": "everyone"
},
"request_id": "text"
}Returns a single training data configuration by ID.
Rate limit: 300 requests per minute
Authorization: Bearer
The ID of the training data.
The request was invalid or could not be completed.
The request could not be authenticated for this API.
The authenticated caller or organization is not allowed to access this endpoint or operation.
The request exceeded the applicable rate limit.
An unexpected internal error occurred.
GET /training-data/{id} HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"data": {
"created_at": "2026-01-01T00:00:00.000Z",
"documents": [
{
"external_id": "text",
"file_name": "text",
"file_size": 1,
"file_type": "text",
"id": "text",
"s3_key": "text"
}
],
"exclude_from_kb_search": true,
"id": "text",
"name": "text",
"scrape_status": {
"last_scraped_at": "2026-01-01T00:00:00.000Z",
"pages_scraped": 1,
"status": "text",
"total_pages": 1
},
"type": "text",
"updated_at": "2026-01-01T00:00:00.000Z",
"visibility": "everyone"
},
"request_id": "text"
}Uploads one or more files to a training data configuration.
Rate limit: 30 requests per minute
Authorization: Bearer
External IDs for idempotent operations. Must match the number of files if provided. Used for duplicate detection and updates.
Custom names for the uploaded files. Must match the number of files if provided. If not provided, original filenames will be used.
The files to upload (minimum 1, maximum 10). Supported types: PDF, plain text, markdown, CSV, JSON, and images (JPEG, PNG, GIF, WebP). Maximum size: 50MB per file, 100MB total.
The ID of an existing training data container to upload files to. Required if not creating new training data.
The name of a new training data container. Required when creating new training data (if training_data_id is not provided).
Visibility of the training data. Defaults to "everyone". Valid values: "everyone", "user_only", "ai_agent_only"
everyonePossible values: The request was invalid or could not be completed.
The request could not be authenticated for this API.
The authenticated caller or organization is not allowed to access this endpoint or operation.
The request exceeded the applicable rate limit.
An unexpected internal error occurred.
POST /training-data/upload HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 142
{
"external_ids": [
"text"
],
"file_names": [
"text"
],
"files": [
"text"
],
"training_data_id": "text",
"training_data_name": "text",
"visibility": "everyone"
}{
"data": {
"created_at": "2026-01-01T00:00:00.000Z",
"documents": [
{
"external_id": "text",
"file_name": "text",
"file_size": 1,
"file_type": "text",
"id": "text",
"s3_key": "text"
}
],
"exclude_from_kb_search": true,
"id": "text",
"name": "text",
"scrape_status": {
"last_scraped_at": "2026-01-01T00:00:00.000Z",
"pages_scraped": 1,
"status": "text",
"total_pages": 1
},
"type": "text",
"updated_at": "2026-01-01T00:00:00.000Z",
"visibility": "everyone"
},
"request_id": "text"
}Uploads plain text content as a training data document.
Rate limit: 30 requests per minute
Authorization: Bearer
The text content to upload.
External ID for idempotent operations (optional).
The name for the uploaded file.
The ID of an existing training data container to upload to (optional).
The name of a new training data container (required if training_data_id not provided).
Visibility of the training data. Defaults to "everyone".
everyoneExample: everyonePossible values: The request was invalid or could not be completed.
The request could not be authenticated for this API.
The authenticated caller or organization is not allowed to access this endpoint or operation.
The request exceeded the applicable rate limit.
An unexpected internal error occurred.
POST /training-data/upload-content HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 136
{
"content": "text",
"external_id": "text",
"file_name": "text",
"training_data_id": "text",
"training_data_name": "text",
"visibility": "everyone"
}{
"data": {
"created_at": "2026-01-01T00:00:00.000Z",
"documents": [
{
"external_id": "text",
"file_name": "text",
"file_size": 1,
"file_type": "text",
"id": "text",
"s3_key": "text"
}
],
"exclude_from_kb_search": true,
"id": "text",
"name": "text",
"scrape_status": {
"last_scraped_at": "2026-01-01T00:00:00.000Z",
"pages_scraped": 1,
"status": "text",
"total_pages": 1
},
"type": "text",
"updated_at": "2026-01-01T00:00:00.000Z",
"visibility": "everyone"
},
"request_id": "text"
}Removes documents from a training data configuration by document ID or external ID.
Rate limit: 30 requests per minute
Authorization: Bearer
The ID of the training data.
Document IDs to delete.
External IDs to delete.
The request was invalid or could not be completed.
The request could not be authenticated for this API.
The authenticated caller or organization is not allowed to access this endpoint or operation.
The request exceeded the applicable rate limit.
An unexpected internal error occurred.
DELETE /training-data/{id}/documents HTTP/1.1
Host: api.usepylon.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"deleted_count": 1,
"request_id": "text"
}Last updated
Was this helpful?

