API Integration

Technical specifications for API integration.

1. Base URL

Your endpoint URL is shown on the endpoint detail page.

POST GET (list)
https://api.3minapi.com/api/v1/data/{slug}
GET (search)
https://api.3minapi.com/api/v1/data/{slug}/search
GET (poll)
https://api.3minapi.com/api/v1/data/{slug}/poll
GET / PUT / DELETE
https://api.3minapi.com/api/v1/data/{slug}/{record_id}

2. Authentication

Include your API key in the header.

HeaderDescriptionRequired
AuthorizationBearer tm_test_xxx... / Bearer tm_live_xxx...Yes
Content-Typeapplication/jsonYes
X-Webhook-CallbackWebhook URLNo
X-Webhook-AuthAuth value (e.g., Bearer token)No
X-Webhook-Auth-HeaderAuth header nameNo

3. Request Format

  • Content-Type: application/json only
  • Max Size: 100KB per request
  • Method: POST / GET (single + list + search + poll) / PUT / DELETE

CRUD Endpoints

Each endpoint automatically supports the following HTTP methods:

MethodPathDescription
POST/api/v1/data/{slug}Create a new record (async, queued)
GET/api/v1/data/{slug}/{record_id}Retrieve a record by ID
GET/api/v1/data/{slug}List recent records (cursor pagination, default 10 / max 30 per page)
GET/api/v1/data/{slug}/searchSearch records by payload text (q required, optional date range — defaults to last 30 days, cursor pagination)
GET/api/v1/data/{slug}/pollFetch records created since your last poll, oldest first (cursor pagination, default 100 / max 100 per page)
PUT/api/v1/data/{slug}/{record_id}Replace a record by ID (async, queued)
DELETE/api/v1/data/{slug}/{record_id}Delete a record by ID (async, queued)

GET (single), PUT, DELETE require a record ID returned from a previous POST response. GET (list), GET (search) and GET (poll) take no record ID.

POST — Create:

curl -X POST https://api.3minapi.com/api/v1/data/{slug} \
  -H "Authorization: Bearer tm_test_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "order_id": "ORD-2024-001",
  "amount": 45000,
  "items": ["Item A", "Item B"],
  "paid": true
}'

GET — Read:

curl https://api.3minapi.com/api/v1/data/{slug}/rec_abc123 \
  -H "Authorization: Bearer tm_test_xxx"

GET — List:

curl "https://api.3minapi.com/api/v1/data/{slug}?limit=10" \
  -H "Authorization: Bearer tm_test_xxx"

# Next page — pass the next_cursor returned in the previous response
curl "https://api.3minapi.com/api/v1/data/{slug}?limit=10&cursor=<next_cursor>" \
  -H "Authorization: Bearer tm_test_xxx"

GET — Search:

# q is required (min 3 chars). start/end are optional — defaults to last 30 days.
curl "https://api.3minapi.com/api/v1/data/{slug}/search?q=keyword&limit=10" \
  -H "Authorization: Bearer tm_test_xxx"

# Next page — pass the next_cursor returned in the previous response
curl "https://api.3minapi.com/api/v1/data/{slug}/search?q=keyword&limit=10&cursor=<next_cursor>" \
  -H "Authorization: Bearer tm_test_xxx"

GET — Poll:

# First call — no cursor. Subscribes from now on.
# Use ?since=2026-08-01T00:00:00Z (or 2026-08-01) to start from a point in time — always UTC.
curl "https://api.3minapi.com/api/v1/data/{slug}/poll?limit=100" \
  -H "Authorization: Bearer tm_test_xxx"

# Every response carries exactly one of two cursors:
#   next_cursor — a backlog remains. Call again right away with it.
#   poll_cursor — you are caught up. Save it and wait for the next cycle.
# The newest ~60 seconds are held back until the queue catches up, so those
# records arrive on a later poll instead of being skipped.

# The whole loop:
CURSOR=""
while true; do
  CODE=$(curl -s -o /tmp/poll.json -w '%{http_code}' \
    "https://api.3minapi.com/api/v1/data/{slug}/poll?limit=100&cursor=$CURSOR" \
    -H "Authorization: Bearer tm_test_xxx")

  # On any error, keep the cursor and retry. Overwriting it would lose your place.
  if [ "$CODE" != "200" ]; then
    echo "poll failed with HTTP $CODE" >&2
    sleep 60
    continue
  fi

  jq -c '.data[]' /tmp/poll.json   # oldest first — dedupe on id, retries can repeat a record

  NEXT=$(jq -r '.pagination.next_cursor // empty' /tmp/poll.json)
  if [ -n "$NEXT" ]; then CURSOR=$NEXT; continue; fi   # more waiting — no sleep

  POLL=$(jq -r '.pagination.poll_cursor // empty' /tmp/poll.json)
  if [ -n "$POLL" ]; then CURSOR=$POLL; fi             # caught up — save and wait
  sleep 60
done

PUT — Update:

curl -X PUT https://api.3minapi.com/api/v1/data/{slug}/rec_abc123 \
  -H "Authorization: Bearer tm_test_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "order_id": "ORD-2024-001",
  "amount": 50000,
  "items": ["Item A", "Item B", "Item C"],
  "paid": true
}'

DELETE — Delete:

curl -X DELETE https://api.3minapi.com/api/v1/data/{slug}/rec_abc123 \
  -H "Authorization: Bearer tm_test_xxx"

4. Response Format

Success Response (202):

{
  "success": true,
  "id": "rec_abc123",
  "message": "Request queued"
}

Error Response Example (400):

{
  "success": false,
  "error": "Validation failed",
  "details": [
    { "field": "order_id", "error": "Required field is missing" }
  ]
}

Error Responses:

CodeStatusDescription
400Bad RequestInvalid JSON or missing required fields
401UnauthorizedMissing or invalid API key, or API key deactivated by owner
403ForbiddenEndpoint inactive or expired subscription
415Unsupported Media TypeContent-Type must be application/json
429Too Many RequestsMonthly rate limit exceeded
5xxServer ErrorInternal server error (500, 502, 503, etc.)

5. Collaborator Webhook

API collaborators can receive processing results directly.

Retry Policy: Return 2xx within 15s. On failure: production 6 attempts in total over ~5 hours, sandbox 4 in total over ~12 minutes

6. Testing Tools

Test in Sandbox before going live.

  • Built-in Test Page: Access via the Test button on the endpoint detail page — no extra tools needed
  • cURL: Test from command line
  • Postman: Use the API testing tool

7. Production Console

After deploying to Production, the endpoint owner can manage production data directly from the dashboard — without external API tools or code.

How to access

Go to Endpoint Detail → Production tab → click "Open Console" to open in a new tab.

Features

  • Full CRUD support (POST / GET / PUT / DELETE) on production data
  • Production API key is pre-configured automatically — no manual entry needed
  • Requests from the console do not trigger webhooks

Owner only

Only the endpoint owner can access the Production Console. Collaborators cannot use it.