Skip to main content

Key Concepts

Before you start using the API, it's important to understand some fundamental concepts about how the platform works and how requests are processed.

Request

A request is a request sent to the API to process a file or resource. It can include:

  • The file itself.

  • A reference to the resource.

  • Additional configuration parameters.

Each request initiates an internal processing flow managed by the platform.

Run

When the API receives a valid request, it becomes a run within the system.

The run represents the internal unit of processing and contains:

  • The unique process identifier.

  • The current state.

  • The reference to the file.

  • The generated results.

This decoupling ensures that receiving the request and processing it do not depend on the same synchronous process.

Queuing System

The platform uses a queuing system to manage pending processing tasks.

This allows you to:

  • Decouple the API from intensive processing.

  • Avoid blocking during peak loads.

  • Manage multiple concurrent requests.

  • Ensure no task is lost.

When a request becomes a task, it is placed in a queue and remains pending until a worker processes it.

Task State

Each task goes through different states during its lifecycle, for example:

  1. pending: queued, awaiting processing.

  2. processing: being executed by a worker.

  3. completed: successfully completed.

  4. failed: error during processing.

The API allows you to query the status to know when the result is available.

Result

The result is the output generated after processing the file. It is returned in structured format (JSON) and can include:

  • Analysis metadata.

  • AI model results.

  • Associated indicators or metrics.

  • The design of the results facilitates their integration into other systems.

Flow Summary

In simplified terms:

  1. The client sends a request to the API.

  2. The request becomes a task.

  3. The task is added to the queue.

  4. A worker processes the task.

  5. The result is available for querying.