{
    "info": {
        "name": "MonkeyIndexer API v1",
        "description": "Public REST API for MonkeyIndexer.\n\nSet the `api_key` collection variable to your `mi_...` key from /dashboard/api-tokens.\n\nDocs: https://monkeyindexer.com/api",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
        "_postman_id": "monkeyindexer-api-v1"
    },
    "variable": [
        {
            "key": "base_url",
            "value": "https://monkeyindexer.com",
            "type": "string",
            "description": "Base host. Change to http://localhost for local dev."
        },
        {
            "key": "api_key",
            "value": "mi_REPLACE_ME_WITH_YOUR_KEY",
            "type": "string",
            "description": "Your API key. Generate one at /dashboard/api-tokens. Treat like a password."
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{api_key}}",
                "type": "string"
            }
        ]
    },
    "item": [
        {
            "name": "Health check",
            "request": {
                "method": "GET",
                "auth": { "type": "noauth" },
                "header": [],
                "url": {
                    "raw": "{{base_url}}/api/v1",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1"]
                },
                "description": "Public health check. No authentication required. Use to verify the API is reachable + discover the version."
            },
            "response": [
                {
                    "name": "200 OK",
                    "originalRequest": {
                        "method": "GET",
                        "header": [],
                        "url": { "raw": "{{base_url}}/api/v1", "host": ["{{base_url}}"], "path": ["api", "v1"] }
                    },
                    "status": "OK",
                    "code": 200,
                    "header": [{ "key": "Content-Type", "value": "application/json" }],
                    "body": "{\n  \"success\": true,\n  \"message\": \"MonkeyIndexer API v1.0 is running\",\n  \"data\": { \"version\": \"1.0\", \"status\": \"operational\" }\n}"
                }
            ]
        },
        {
            "name": "Get account & wallet",
            "request": {
                "method": "GET",
                "header": [],
                "url": {
                    "raw": "{{base_url}}/api/v1/me",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "me"]
                },
                "description": "Returns the authenticated user's profile, credit balance, token metadata, and remaining rate-limit headroom."
            },
            "response": [
                {
                    "name": "200 OK",
                    "originalRequest": {
                        "method": "GET",
                        "header": [],
                        "url": { "raw": "{{base_url}}/api/v1/me", "host": ["{{base_url}}"], "path": ["api", "v1", "me"] }
                    },
                    "status": "OK",
                    "code": 200,
                    "header": [{ "key": "Content-Type", "value": "application/json" }],
                    "body": "{\n  \"success\": true,\n  \"message\": \"Account retrieved successfully\",\n  \"data\": {\n    \"user\": { \"id\": \"01KT...\", \"name\": \"Alice\", \"email\": \"alice@example.com\" },\n    \"credits\": { \"balance\": 249, \"reserved\": 0, \"available\": 249, \"lifetime_used\": 51, \"lifetime_purchased\": 200 },\n    \"token\": { \"created_at\": \"2026-06-05T10:00:00+05:30\", \"expires_at\": \"2026-07-05T10:00:00+05:30\", \"last_used_at\": \"2026-06-05T18:23:00+05:30\" },\n    \"rate_limit\": { \"remaining_minute\": 58, \"remaining_day\": 9847 }\n  }\n}"
                }
            ]
        },
        {
            "name": "Submit URL — single",
            "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": {
                    "mode": "raw",
                    "raw": "{\n  \"url\": \"https://example.com/page\"\n}"
                },
                "url": {
                    "raw": "{{base_url}}/api/v1/submit",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "submit"]
                },
                "description": "Submit one URL for indexing. Costs 1 credit. Returns a ULID tracking_id you can poll on /submissions."
            },
            "response": [
                {
                    "name": "200 OK",
                    "originalRequest": {
                        "method": "POST",
                        "header": [{ "key": "Content-Type", "value": "application/json" }],
                        "body": { "mode": "raw", "raw": "{\n  \"url\": \"https://example.com/page\"\n}" },
                        "url": { "raw": "{{base_url}}/api/v1/submit", "host": ["{{base_url}}"], "path": ["api", "v1", "submit"] }
                    },
                    "status": "OK",
                    "code": 200,
                    "header": [{ "key": "Content-Type", "value": "application/json" }],
                    "body": "{\n  \"success\": true,\n  \"message\": \"1 URL submitted successfully\",\n  \"data\": {\n    \"submitted\": 1,\n    \"rejected\": 0,\n    \"invalid_urls\": [],\n    \"tracking_ids\": [\"01KTAA01H8QZ7Y3M5N6P0R8V2X\"],\n    \"credits_remaining\": 248\n  }\n}"
                },
                {
                    "name": "402 Insufficient credits",
                    "originalRequest": {
                        "method": "POST",
                        "header": [{ "key": "Content-Type", "value": "application/json" }],
                        "body": { "mode": "raw", "raw": "{\n  \"url\": \"https://example.com/page\"\n}" },
                        "url": { "raw": "{{base_url}}/api/v1/submit", "host": ["{{base_url}}"], "path": ["api", "v1", "submit"] }
                    },
                    "status": "Payment Required",
                    "code": 402,
                    "header": [{ "key": "Content-Type", "value": "application/json" }],
                    "body": "{\n  \"success\": false,\n  \"message\": \"Insufficient credits to submit this URL.\",\n  \"data\": { \"submitted\": 0, \"rejected\": 1, \"tracking_ids\": [], \"credits_remaining\": 0 }\n}"
                }
            ]
        },
        {
            "name": "Submit URL — batch",
            "request": {
                "method": "POST",
                "header": [{ "key": "Content-Type", "value": "application/json" }],
                "body": {
                    "mode": "raw",
                    "raw": "{\n  \"urls\": [\n    \"https://example.com/page-1\",\n    \"https://example.com/page-2\",\n    \"https://example.com/page-3\"\n  ]\n}"
                },
                "url": {
                    "raw": "{{base_url}}/api/v1/submit",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "submit"]
                },
                "description": "Submit up to 50 URLs at once. Each costs 1 credit. Returns tracking_ids in submission order."
            },
            "response": [
                {
                    "name": "200 OK",
                    "originalRequest": {
                        "method": "POST",
                        "header": [{ "key": "Content-Type", "value": "application/json" }],
                        "body": { "mode": "raw", "raw": "{\n  \"urls\": [\"https://example.com/page-1\", \"https://example.com/page-2\"]\n}" },
                        "url": { "raw": "{{base_url}}/api/v1/submit", "host": ["{{base_url}}"], "path": ["api", "v1", "submit"] }
                    },
                    "status": "OK",
                    "code": 200,
                    "header": [{ "key": "Content-Type", "value": "application/json" }],
                    "body": "{\n  \"success\": true,\n  \"message\": \"2 URL(s) submitted successfully\",\n  \"data\": {\n    \"submitted\": 2,\n    \"rejected\": 0,\n    \"invalid_urls\": [],\n    \"errors\": [],\n    \"tracking_ids\": [\"01KTAA01...\", \"01KTAA02...\"],\n    \"credits_remaining\": 247\n  }\n}"
                }
            ]
        },
        {
            "name": "List submissions",
            "request": {
                "method": "GET",
                "header": [],
                "url": {
                    "raw": "{{base_url}}/api/v1/submissions?limit=20&page=1",
                    "host": ["{{base_url}}"],
                    "path": ["api", "v1", "submissions"],
                    "query": [
                        { "key": "limit", "value": "20", "description": "Items per page (max 100)" },
                        { "key": "page", "value": "1", "description": "Page number" },
                        { "key": "status", "value": "indexed", "disabled": true, "description": "Filter: queued | processing | submitted | indexed | not_indexed | failed | refunded" },
                        { "key": "ids", "value": "01KT...,01KT...", "disabled": true, "description": "Comma-separated tracking IDs (max 100)" },
                        { "key": "urls", "value": "https://example.com/a,https://example.com/b", "disabled": true, "description": "Comma-separated URLs (max 100)" }
                    ]
                },
                "description": "Paginated list of your submissions, newest first. Optional filters: status, ids, urls."
            },
            "response": [
                {
                    "name": "200 OK",
                    "originalRequest": {
                        "method": "GET",
                        "header": [],
                        "url": { "raw": "{{base_url}}/api/v1/submissions?limit=20", "host": ["{{base_url}}"], "path": ["api", "v1", "submissions"], "query": [{ "key": "limit", "value": "20" }] }
                    },
                    "status": "OK",
                    "code": 200,
                    "header": [{ "key": "Content-Type", "value": "application/json" }],
                    "body": "{\n  \"success\": true,\n  \"message\": \"Submissions retrieved successfully\",\n  \"data\": {\n    \"count\": 1,\n    \"total\": 1043,\n    \"page\": 1,\n    \"per_page\": 20,\n    \"items\": [\n      {\n        \"tracking_id\": \"01KTAA01H8QZ7Y3M5N6P0R8V2X\",\n        \"url\": \"https://example.com/page\",\n        \"status\": \"indexed\",\n        \"provider_status\": \"Delivered\",\n        \"submitted_at\": \"2026-06-05T10:00:00+05:30\",\n        \"crawled_at\": \"2026-06-05T11:30:00+05:30\",\n        \"created_at\": \"2026-06-05T09:59:55+05:30\"\n      }\n    ]\n  }\n}"
                }
            ]
        }
    ]
}
