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/runHeaders
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <api-key> |
Content-Type | Yes | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
provider | string | Yes | Provider slug (e.g., "apify") |
endpoint | string | Yes | Endpoint path (e.g., "/apidojo/tweet-scraper") |
input | object | Yes | Input 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.
| Field | Type | Description |
|---|---|---|
runId | string | Unique run identifier (ULID) |
caller | string | Caller identifier |
provider | string | Provider slug |
providerName | string | Provider display name |
endpoint | string | Endpoint path |
status | string | "RUNNING" |
price | object | Endpoint pricing |
createdAt | string | ISO 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.