Skip to main content

Create Resource

Create a new resource within a datasource. Resources are individual pieces of content like documents, web pages, files, or data that will be processed and made available for agent interactions.

Path Parameters

datasource_id
string
required
The unique identifier of the datasource

Request Body

name
string
required
Resource name or title
type
string
required
Resource type. Supported values:
  • text/plain - Plain text files
  • application/pdf - PDF documents
  • text/csv - CSV data files
  • text/markdown - Markdown documents
  • text/html - HTML content
  • WEBPAGE - Web page to be scraped
  • URL - Generic URL resource
  • audio/wav - WAV audio files
  • video/mp4 - MP4 video files
  • video/youtube - YouTube videos
  • image/png - PNG images
  • image/jpeg - JPEG images
  • image/webp - WebP images
url
string
URL to the resource content (required for web/URL resources)
content
string
Direct content (for text-based resources when not using URL)
config
object
Resource-specific configuration options (default: )
metadata
object
Resource metadata following the datasource schema (default: )
extra_info
object
Additional information about the resource (default: )
external_url
string
External reference URL
external_resource_id
string
External system resource identifier
store
boolean
Whether to store the processed content (default: true)
callback_url
string
URL to call when processing is complete
folder_id
string
ID of the folder to place this resource in

Response

id
string
Resource unique identifier
name
string
Resource name
type
string
Resource type
status
string
Processing status (IN_PROGRESS, VECTORIZING, SCRAPING, SUMMARIZING, DONE, FAILED)
url
string
URL to the resource content
content
string
Direct content (for text resources)
summary
string
Auto-generated summary of the resource
metadata
object
Resource metadata
vectors
integer
Number of vector embeddings created
size
integer
Resource size in bytes
created_at
string
When the resource was created (ISO 8601 format)
updated_at
string
When the resource was last updated (ISO 8601 format)
curl --location --request POST 'https://api.plaisolutions.com/datasources/ds_123/resources' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Product Documentation",
  "type": "WEBPAGE",
  "url": "https://example.com/docs",
  "metadata": {
    "category": "documentation",
    "priority": 1,
    "public": true
  },
  "folder_id": "folder_456"
}'

List Resources

List resources in a datasource with filtering and pagination support.

Path Parameters

datasource_id
string
required
The unique identifier of the datasource

Query Parameters

metadata_filter
string
JSON string for filtering by metadata fields
type
string
Filter by resource type
status
string
Filter by processing status (IN_PROGRESS, VECTORIZING, SCRAPING, SUMMARIZING, DONE, FAILED)
name
string
Filter by resource name (partial matching)
folder_id
string
Filter by folder ID
page
integer
Page number (default: 1)
page_size
integer
Items per page (default: 20, max: 100)

Response

count
integer
Total number of resources
page
integer
Current page number
next
string
URL for the next page
previous
string
URL for the previous page
results
array
Array of resource objects
curl --location --request GET 'https://api.plaisolutions.com/datasources/ds_123/resources?status=DONE&page=1&page_size=20' \
--header 'Authorization: Bearer YOUR_TOKEN'

Get Resource

Get detailed information about a specific resource.

Path Parameters

datasource_id
string
required
The unique identifier of the datasource
resource_id
string
required
The unique identifier of the resource

Response

Returns the complete resource object with all details.
curl --location --request GET 'https://api.plaisolutions.com/datasources/ds_123/resources/resource_456' \
--header 'Authorization: Bearer YOUR_TOKEN'

Update Resource

Update resource metadata and properties.

Path Parameters

datasource_id
string
required
The unique identifier of the datasource
resource_id
string
required
The unique identifier of the resource

Request Body

name
string
Updated resource name
summary
string
Updated resource summary
datasource_id
string
Move resource to different datasource

Response

Returns the updated resource object.
curl --location --request PATCH 'https://api.plaisolutions.com/datasources/ds_123/resources/resource_456' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Updated Documentation Title",
  "summary": "Updated comprehensive product documentation"
}'

Delete Resource

Delete a resource and all associated data.

Path Parameters

datasource_id
string
required
The unique identifier of the datasource
resource_id
string
required
The unique identifier of the resource to delete

Response

Returns a 204 status code on successful deletion.
Deleting a resource will permanently remove:
  • The resource and its content
  • All vector embeddings
  • Processing history and analytics
  • Any associated resource links
This action cannot be undone.
curl --location --request DELETE 'https://api.plaisolutions.com/datasources/ds_123/resources/resource_456' \
--header 'Authorization: Bearer YOUR_TOKEN'

Retry Resource Processing

Retry processing for a failed resource or reprocess with updated settings.

Path Parameters

datasource_id
string
required
The unique identifier of the datasource
resource_id
string
required
The unique identifier of the resource

Request Body

statuses
array
required
Array of resource statuses to retry (e.g., [“FAILED”, “IN_PROGRESS”])
date_from
string
Only retry resources created/updated after this date
date_to
string
Only retry resources created/updated before this date

Response

Returns a success confirmation.
curl --location --request POST 'https://api.plaisolutions.com/datasources/ds_123/resources/resource_456/retry' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "statuses": ["FAILED"]
}'

Download Resource

Get a download URL for the processed resource content.

Path Parameters

datasource_id
string
required
The unique identifier of the datasource
resource_id
string
required
The unique identifier of the resource

Response

download_url
string
Temporary signed URL for downloading the resource content
curl --location --request GET 'https://api.plaisolutions.com/datasources/ds_123/resources/resource_456/download' \
--header 'Authorization: Bearer YOUR_TOKEN'

Get Scraping Status

Get the scraping status for web-based resources (WEBPAGE, URL types).

Path Parameters

resource_id
string
required
The unique identifier of the resource

Response

resource_id
string
Resource unique identifier
Total number of links found during scraping
done
integer
Number of links successfully processed
in_progress
integer
Number of links currently being processed
failed
integer
Number of links that failed to process
curl --location --request GET 'https://api.plaisolutions.com/resources/resource_456/scraping-status'

Resource Processing Pipeline

Understanding how resources are processed helps you monitor and troubleshoot issues:
1

Upload/Submit

Resource is created with initial metadata and content reference
2

Content Extraction

System extracts text/data from the resource based on its type
3

Processing

Content is chunked, cleaned, and prepared for vectorization
4

Vectorization

Text chunks are converted to vector embeddings for semantic search
5

Indexing

Vectors are stored and indexed for fast retrieval
6

Completion

Resource status is updated to DONE and becomes available to agents

Resource Status Meanings

Initial processing stage - content extraction and preparation
For web resources - actively scraping content from URLs
Generating automatic summaries of the content
Converting text content to vector embeddings
Processing complete - resource is ready for agent use
Processing encountered an error - check logs and retry if needed

Content Type Support

  • PDF: Full text extraction with metadata
  • Text/Markdown: Direct processing with formatting preservation
  • HTML: Clean text extraction with structure preservation
  • CSV: Structured data processing with schema inference
Processing times vary based on resource type and size. Web scraping can take longer due to external dependencies and rate limiting.
Use the scraping status endpoint to monitor progress for web-based resources, and set up callback URLs for automatic notifications when processing completes.