Insert resources
Files
Learn how to insert files using Wetrocloud
How to Insert a File
To insert a file into a collection, make a POST
request to the /v1/resource/insert/
endpoint with the required parameters in the body and make sure you use the file
type.
To use the file
type, the resource can either be provided as URLs or if you are using our SDKs the resource can be the path to the file.
Note: File paths only work with our SDKs if you are calling our API’s directly, all files must be provided as URLs. You can consider services like Amazon S3, Cloudinary, or similar platforms to host your files and provide their URLs to the API.
Request Example (File Path)
Request Example (File as URL)
Successful Response
A successful response confirms the operation and tracks token usage.
Example Response
Field | Description |
---|---|
success | Indicates whether the resource was inserted successfully. |
tokens | Number of tokens consumed during the operation. |
resource_id | Unique ID for the resource, this is required when removing a resource |
Related Operations
- Create Collection: Start by creating a collection to hold your resources.
- Query Resources: Access and retrieve insights from the indexed resources.
- Delete Collection: Remove collections and their resources when no longer needed.