Back to KB
Difficulty
Intermediate
Read Time
5 min

/api/admin/crawler

By Codcompass Team··5 min read

/api/admin/crawler

Overview

The /api/admin/crawler endpoint serves as the primary programmatic interface for manually triggering and monitoring web crawler jobs within the platform. It is designed for developers, DevOps engineers, and system administrators who need immediate control over content indexing workflows without relying on automated schedulers or cron jobs. The endpoint operates in two distinct modes: a POST request to enqueue and dispatch a new crawler task, and a GET request to retrieve the detailed status and metadata of an existing job.

Because this endpoint is publicly accessible (no authentication headers required), it is typically deployed in environments where network-level access controls, reverse proxy rules, or internal routing restrict external exposure. Use this endpoint when you need to:

  • Manually initiate a crawl after deploying new content or updating site architecture.
  • Integrate crawler triggers into external CI/CD pipelines or monitoring dashboards.
  • Debug or validate job execution by polling the CrawlerJob database records directly.

Endpoint Reference

  • Base Path: /api/admin/crawler
  • HTTP Methods: POST, GET
  • Authentication: Public (No authentication required)
  • Content-Type: application/json
  • Runtime: Next.js API Route (App Router compatible)
  • Dependencies: @supabase/supabase-js, @/lib/crawler-dispatch

Request Format

The endpoint handles two distinct request patterns depending on the HTTP method used.

POST Request

The POST method initiates a new crawler job. It does not require a request body or query parameters. The endpoint automatically generates a unique job identifier and dispatches the task to the underlying execution engine. According to the source implementation, this method enqueues the job and triggers the dispatch mechanism (e.g., GitHub Actions or internal queue), waiting only for the HTTP acknowledgment from the target system (default timeout ≤12 seconds). It does not block until the crawler finishes processing.

  • Headers: Standard HTTP headers. No Authorization header is required.
  • **Bo

🎉 Mid-Year Sale — Unlock Full Article

Base plan from just $4.99/mo or $49/yr

Sign in to read the full article and unlock all 635+ tutorials.

Sign In / Register — Start Free Trial

7-day free trial · Cancel anytime · 30-day money-back

Sources

  • api-reference