Skip to content

API Endpoints

Base URL: http://localhost:8787/api (dev) or https://os.supershyft.capital/api (prod)

Companies

List Companies

http
GET /api/companies?limit=50&offset=0&search=acme&status=active

Query Parameters:

  • limit - Results per page (default: 50)
  • offset - Pagination offset (default: 0)
  • status - Filter by status
  • country_code - Filter by country
  • industry_category - Filter by industry
  • search - Text search in name/description

Response:

json
{
  "data": [...],
  "pagination": {
    "total": 150,
    "limit": 50,
    "offset": 0,
    "hasMore": true
  }
}
http
GET /api/companies/search/semantic?q=AI+infrastructure&limit=20

Query Parameters:

  • q - Search query (required)
  • limit - Results per page (default: 20)
  • offset - Pagination offset
  • status - Filter by status
  • country_code - Filter by country

Uses Workers AI + Vectorize for semantic similarity matching.

Get Company Detail

http
GET /api/companies/:id

Response:

json
{
  "data": {
    "company": {
      "id": "cmp_abc123",
      "name": "Acme Corp",
      "country": "Belgium",
      "revenue_eur": 25.5,
      "llm_score_overall": 7500,
      "executives": [...],
      "enriched_data": {...}
    },
    "dealflow": {...},
    "recent_activity": [...]
  }
}

Includes:

  • Parsed JSON fields (executives, financials)
  • Associated dealflow record
  • Recent activity (last 10)
  • R2 enrichment profile (if available)

Create Company

http
POST /api/companies
Content-Type: application/json

{
  "name": "New Company",
  "country": "Belgium",
  "country_code": "BE",
  "hq_city": "Brussels",
  "industry_category": "Technology",
  "activity_description": "Software development"
}

Update Company

http
PATCH /api/companies/:id
Content-Type: application/json

{
  "name": "Updated Name",
  "status": "active",
  "thesis_id": "th_xyz"
}

Theses

List Theses

http
GET /api/theses

Response:

json
{
  "data": [
    {
      "id": "th_xyz",
      "code": "TH-001",
      "title": "European SaaS Scale-Ups",
      "summary": "Targeting B2B SaaS...",
      "status": "active"
    }
  ]
}

Get Thesis

http
GET /api/theses/:id

Returns full thesis with markdown report content.

Dealflow

List Dealflow

http
GET /api/dealflow?stage=meeting

Query Parameters:

  • stage - Filter by stage
  • status - Filter by status

Create Dealflow Entry

http
POST /api/dealflow
Content-Type: application/json

{
  "company_id": "cmp_abc123",
  "stage": "initial",
  "probability": 20,
  "notes": "Initial outreach sent"
}

Update Dealflow Stage

http
PATCH /api/dealflow/:id
Content-Type: application/json

{
  "stage": "meeting",
  "probability": 40,
  "notes": "Meeting scheduled"
}

Activity

List Activity Log

http
GET /api/activity?limit=50&offset=0&entity_type=company

Query Parameters:

  • limit - Results per page (default: 50)
  • offset - Pagination offset
  • entity_type - Filter by type (company, dealflow, bulk_action)
  • entity_id - Filter by entity ID
  • user_email - Filter by user

Response:

json
{
  "data": [
    {
      "id": "act_xyz",
      "activity_type": "company_created",
      "entity_type": "company",
      "entity_id": "cmp_abc123",
      "user_email": "louis@supershyft.capital",
      "timestamp": "2025-01-15T10:00:00Z",
      "metadata": {...}
    }
  ],
  "pagination": {...}
}

Stats

Get Dashboard Metrics

http
GET /api/stats

Response:

json
{
  "data": {
    "companies_total": 150,
    "companies_active": 120,
    "dealflow_active": 25,
    "theses_active": 5
  }
}

Bulk Actions

Create Bulk Action

http
POST /api/bulk-actions
Content-Type: application/json

{
  "action_type": "generate_embeddings",
  "company_ids": ["cmp_1", "cmp_2", "cmp_3"],
  "priority_override": 80
}

Action Types:

  • generate_embeddings
  • llm_score
  • enrich_profile

Priority: 10 (background) to 95 (urgent)

Response:

json
{
  "data": {
    "id": "ba_abc123",
    "action_type": "generate_embeddings",
    "status": "pending",
    "total_companies": 3,
    "processed_companies": 0,
    "priority": 50
  }
}

List Bulk Actions

http
GET /api/bulk-actions

Returns bulk actions for current user.

Get Bulk Action Status

http
GET /api/bulk-actions/:id

Response:

json
{
  "data": {
    "id": "ba_abc123",
    "status": "running",
    "total_companies": 100,
    "processed_companies": 67,
    "failed_companies": 2,
    "error_summary": {...}
  }
}

Update Bulk Action (AI Worker)

http
PATCH /api/bulk-actions/:id
Content-Type: application/json

{
  "status": "completed",
  "processed_companies": 100,
  "completed_at": "2025-01-15T10:30:00Z"
}

Users

Get/Create User

http
GET /api/users/:email

Auto-creates user if not exists.

Response:

json
{
  "data": {
    "email": "louis@supershyft.capital",
    "name": "Louis De Cuypere",
    "role": "partner",
    "preferences": {
      "view_mode": "comfortable",
      "notifications_enabled": true
    }
  }
}

Update User Preferences

http
PATCH /api/users/:email
Content-Type: application/json

{
  "preferences": {
    "view_mode": "compact",
    "notifications_enabled": false
  }
}

Feedback

Submit Feedback

http
POST /api/feedback
Content-Type: application/json

{
  "type": "bug",
  "title": "Button not working",
  "description": "The save button doesn't respond",
  "page": "/companies",
  "user_email": "louis@supershyft.capital"
}

Creates issue in Linear workspace.

Response:

json
{
  "success": true,
  "issue_id": "SUP-123",
  "url": "https://linear.app/..."
}

R2 Assets

Get Company Artifacts

http
GET /r2/companies/:id/profile.json
GET /r2/companies/:id/source.csv

Proxied through API worker with caching.

Error Responses

json
{
  "error": "Error message",
  "details": "Additional context"
}

Status Codes:

  • 400 - Bad Request (validation failed)
  • 401 - Unauthorized
  • 404 - Not Found
  • 500 - Internal Server Error
  • 503 - Service Unavailable (e.g., Vectorize not configured)

Authentication

Dev Mode: Send X-User-Email header

bash
curl -H "X-User-Email: louis@supershyft.capital" http://localhost:8787/api/companies

Production: Cloudflare Zero Trust JWT (pending configuration)

Built for Supershyft Capital