Skip to main content
This guide demonstrates how to leverage UBIK’s tools to perform complex tasks. You will learn how to list available tools, execute one with the required inputs, and then poll for the execution results.
1

Discover Available Tools

First, let’s see what tools are available. We can get a list of all tools accessible to us by making a GET request to the /tools endpoint.
curl -X GET "https://app.ubik-agent.com/api/v1/tools" \
     -H "X-API-KEY: YOUR_API_KEY"
The response will be a paginated list of tools. For this guide, let’s assume we want to use a tool named “Financial Data Extractor”. Find it in the list and copy its id.
2

Execute the Tool

Now, we’ll start the tool by making a POST request to the /tools/{tool_id}/execute endpoint. You’ll need the id from the previous step. In the request body, we’ll provide the inputs that the tool requires.
curl -X POST "https://app.ubik-agent.com/api/v1/tools/YOUR_TOOL_ID/execute" \
     -H "X-API-KEY: YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
          "inputs": {
            "document_id": "YOUR_DOCUMENT_ID",
            "data_points": ["revenue", "net_income", "ebitda"]
          }
        }'
The API will respond with a 202 Accepted status, indicating that the task has been received. The response body contains an execution_id and a details_url. We will use this URL to get the final result.
3

Poll for Results

Since the tool runs asynchronously, we need to poll the details_url to check for the final result. You’ll want to check this endpoint periodically until the status changes to completed or failed.
curl -X GET "https://app.ubik-agent.com/api/v1/tool-executions/YOUR_EXECUTION_ID" \
     -H "X-API-KEY: YOUR_API_KEY"
Once the status is completed, the outputs field will contain the data extracted by the tool.
For a more responsive, real-time experience, you can stream events instead of polling. Check out our guide on Getting Real-Time Results with SSE.
You now know how to discover and execute powerful, pre-built tools to automate complex workflows with the UBIK API.