Endpoints

EndpointMethodDescription
/collection/create/POSTUsed to create a new collection where your resources will be organized.
/collection/all/GETReturns a list of all existing collections.
/resource/insert/POSTAllows you to add resources, such as documents or files, into a specified collection.
/collection/query/POSTEnables you to search or retrieve information from your collections based on specific prompts.
/collection/delete/DELETERemoves an entire collection and its associated resources.
/categorize/POSTCategorizes your data according to specific rules or schema definitions.

Response Formats by Endpoint

The WetroCloud API returns responses in a consistent JSON format. Each endpoint includes fields relevant to the specific operation.

Create Collection Endpoint (/collection/create/)

Used to create a new collection. The response includes the unique ID of the collection and a success status.

{
  "collection_id": "string", // A unique identifier, typically a UUID
  "success": boolean
}

Insert Endpoint (/resource/insert/)

Adds resources to a collection. The response confirms success and tracks token usage.

{
  "success": boolean,
  "tokens": integer
}

Query Endpoint (/collection/query/)

Fetches information from a collection based on a query. The response contains the result, token usage, and success status.

{
  "response": // This structure is defined by the schema
  "success": boolean,
  "tokens": integer
}

Delete Collection Endpoint (/collection/delete/)

Deletes a collection and returns the operation status with a message.

{
  "success": boolean,
  "message": "string"
}

Categorize Endpoint (/categorize/)

Categorizes data according to rules or schemas. The response provides the assigned label, token usage, and success status.

{
  "response": // This structure is defined by the schema,
  "tokens": integer,
  "success": boolean
}

Text Generation Endpoint (/text-generation/)

Generates a text response to any query (Without RAG) and supports conversational interactions. The response is the result, token usage, and success status.

{
  "response": string,
  "tokens": integer,
  "success": boolean
}

Image to Text (OCR) Endpoint (/image-to-text/)

Analyzes and fetch information from an image based on a query. The response provides the result, token usage, and success status.

{
  "response": string,
  "tokens": integer,
  "success": boolean
}

Data Extraction Endpoint (/data-extraction/)

Extracts content from websites according to rules or schemas. The response provides the result, token usage, and success status.

{
  "response": // This structure is defined by the schema,
  "tokens": integer,
  "success": boolean
}