Skip to content

POST /v1/run

Execute a data endpoint. Runs are asynchronous -- the server returns a run ID immediately and processes the request in the background.

Request

POST /v1/run

Headers

HeaderRequiredDescription
AuthorizationYesBearer <api-key>
Content-TypeYesapplication/json

Body

FieldTypeRequiredDescription
providerstringYesProvider slug (e.g., "apify")
endpointstringYesEndpoint path (e.g., "/apidojo/tweet-scraper")
inputobjectYesInput parameters matching the endpoint's input schema

Example Request

bash
curl -X POST https://api.monid.ai/v1/run \
  -H "Authorization: Bearer monid_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "apify",
    "endpoint": "/apidojo/tweet-scraper",
    "input": {
      "searchTerms": ["AI"],
      "maxItems": 10
    }
  }'
typescript
const response = await fetch("https://api.monid.ai/v1/run", {
  method: "POST",
  headers: {
    "Authorization": "Bearer monid_live_...",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    provider: "apify",
    endpoint: "/apidojo/tweet-scraper",
    input: {
      searchTerms: ["AI"],
      maxItems: 10,
    },
  }),
});

// 202 Accepted
const data = await response.json();
const runId = data.runId;

// Poll for results
const poll = async () => {
  const result = await fetch(`https://api.monid.ai/v1/runs/${runId}`, {
    headers: { "Authorization": "Bearer monid_live_..." },
  });
  return result.json();
};
python
import requests
import time

# Start the run
response = requests.post(
    "https://api.monid.ai/v1/run",
    headers={
        "Authorization": "Bearer monid_live_...",
        "Content-Type": "application/json",
    },
    json={
        "provider": "apify",
        "endpoint": "/apidojo/tweet-scraper",
        "input": {
            "searchTerms": ["AI"],
            "maxItems": 10,
        },
    },
)

# 202 Accepted
data = response.json()
run_id = data["runId"]

# Poll for results
while True:
    result = requests.get(
        f"https://api.monid.ai/v1/runs/{run_id}",
        headers={"Authorization": "Bearer monid_live_..."},
    ).json()
    if result["status"] in ("COMPLETED", "FAILED"):
        break
    time.sleep(5)

Response

202 Accepted

The run has been started. Poll GET /v1/runs/:runId for results.

FieldTypeDescription
runIdstringUnique run identifier (ULID)
callerstringCaller identifier
providerstringProvider slug
providerNamestringProvider display name
endpointstringEndpoint path
statusstring"RUNNING"
priceobjectEndpoint pricing
createdAtstringISO 8601 timestamp

Example Response

json
{
  "runId": "01HXYZ1234567890ABCDEF",
  "caller": "USER#user_abc123",
  "provider": "apify",
  "providerName": "Apify",
  "endpoint": "/apidojo/tweet-scraper",
  "status": "RUNNING",
  "price": {
    "type": "PER_CALL",
    "amount": 0.003,
    "currency": "USD"
  },
  "createdAt": "2026-03-28T10:30:00.000Z"
}

Polling for Results

After starting a run, poll GET /v1/runs/:runId to check status and retrieve results. Most runs complete within 1-120 seconds.

Next Step

Use GET /v1/runs/:runId to retrieve run results.

The data layer for AI agents.