Skip to main content
Navigation

reference

API Overview

Base URL and Versioning

All Prospector API endpoints are served under the GhostStack API base URL with a versioned path prefix:

https://api.ghoststack.dev/v1/prospector

The current stable version is v1. Breaking changes are introduced in new major versions only. Minor additions (new fields, new endpoints) are added to the current version without bumping the major number.

Authentication

API requests require a Bearer token in the Authorization header. Generate an API token in the GhostStack dashboard under Settings > API Tokens. Tokens are scoped to specific tools, so make sure your token includes the prospector scope.

curl -H "Authorization: Bearer gsk_your_token_here" \
  https://api.ghoststack.dev/v1/prospector/leads

Tokens do not expire by default, but you can set an expiration date when creating them. Revoked tokens return a 401 Unauthorized response immediately.

Core Endpoints

Leads

MethodPathDescription
GET/leadsList scored leads with optional filters
GET/leads/:idGet a single lead with full score breakdown
POST/leads/scanTrigger an on-demand scan
PATCH/leads/:idUpdate lead status or tags
# List leads scored above 70, sorted by score descending
curl -H "Authorization: Bearer gsk_..." \
  "https://api.ghoststack.dev/v1/prospector/leads?min_score=70&sort=-score"

Proposals

MethodPathDescription
GET/proposalsList proposals with status filter
GET/proposals/:idGet proposal details including draft text
POST/proposalsGenerate a proposal for a lead
PATCH/proposals/:idUpdate proposal text or status
POST/proposals/:id/submitSubmit a proposal to the platform

Contracts

MethodPathDescription
GET/contractsList active and completed contracts
GET/contracts/:idGet contract details with milestones
PATCH/contracts/:id/milestones/:midUpdate milestone status

Scoring

MethodPathDescription
GET/scoring/configGet current scoring weights and parameters
PUT/scoring/configUpdate scoring configuration
POST/scoring/backtestRun a backtest with proposed config

Request and Response Format

All endpoints accept and return JSON. Request bodies should use Content-Type: application/json. Responses include a top-level data key for the resource and a meta key for pagination info where applicable.

{
  "data": [
    {
      "id": "lead_3f8k2m",
      "job_title": "React Native App Development",
      "platform": "upwork",
      "score": {
        "composite": 82,
        "confidence": 0.87,
        "signals": {
          "skill_match": 90,
          "budget": 75,
          "client_history": 88,
          "competition": 70,
          "timeline": 80
        }
      },
      "status": "new",
      "created_at": "2026-04-20T14:30:00Z"
    }
  ],
  "meta": {
    "total": 47,
    "page": 1,
    "per_page": 20
  }
}

Pagination

List endpoints return paginated results. Use page and per_page query parameters to navigate. The maximum per_page value is 100. The meta object in the response includes total, page, and per_page fields.

# Page 2, 50 results per page
curl -H "Authorization: Bearer gsk_..." \
  "https://api.ghoststack.dev/v1/prospector/leads?page=2&per_page=50"

Rate Limits

API requests are rate-limited per token:

PlanRequests per minuteRequests per day
Starter605,000
Pro12025,000
Team300100,000

Rate limit headers are included in every response:

X-RateLimit-Limit: 120
X-RateLimit-Remaining: 118
X-RateLimit-Reset: 1714000000

When you exceed the limit, the API returns 429 Too Many Requests with a Retry-After header indicating how many seconds to wait.

Error Responses

Errors follow a consistent format:

{
  "error": {
    "code": "validation_error",
    "message": "min_score must be between 0 and 100",
    "details": {
      "field": "min_score",
      "value": 150
    }
  }
}

Common error codes: authentication_error (401), forbidden (403), not_found (404), validation_error (422), rate_limited (429), internal_error (500).