Investor Tracker REST API reference. All endpoints require Bearer token auth.
All requests must include a Bearer token in the Authorization header. The token is the value of the AUTH_TOKEN environment variable.
Authorization: Bearer YOUR_TOKEN
If no AUTH_TOKEN is set on the server, auth is skipped entirely.
| Field | Type | Description |
|---|---|---|
| id | integer | Auto-incrementing primary key |
| name | string | Investor name REQUIRED |
| string | null | Email address | |
| company | string | null | Company / fund name |
| stage | string | One of: target, contacted, interested, yes, no |
| notes | string | null | Free-text notes |
| created_at | timestamp | ISO 8601 creation time |
| updated_at | timestamp | ISO 8601 last update time |
Returns all investors, ordered by most recently updated. Optionally filter by stage.
| Param | Type | Description |
|---|---|---|
| stage | string optional | Filter by stage: target, contacted, interested, yes, no |
curl -H "Authorization: Bearer TOKEN" \ https://your-app.vercel.app/api/investors?stage=interested
[
{
"id": 1,
"name": "Jane Smith",
"email": "jane@acme.vc",
"company": "Acme Capital",
"stage": "interested",
"notes": "Wants to see traction metrics",
"created_at": "2026-01-15T10:30:00.000Z",
"updated_at": "2026-02-10T14:20:00.000Z"
}
]
Creates a new investor. Only name is required. Stage defaults to target.
| Field | Type | Description |
|---|---|---|
| name | string required | Investor name |
| string optional | Email address | |
| company | string optional | Company / fund name |
| stage | string optional | Initial stage (defaults to target) |
| notes | string optional | Free-text notes |
curl -X POST https://your-app.vercel.app/api/investors \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Jane Smith", "company": "Acme Capital", "email": "jane@acme.vc"}'
{
"id": 1,
"name": "Jane Smith",
"email": "jane@acme.vc",
"company": "Acme Capital",
"stage": "target",
"notes": null,
"created_at": "2026-02-16T10:30:00.000Z",
"updated_at": "2026-02-16T10:30:00.000Z"
}
Returns a single investor by ID.
curl -H "Authorization: Bearer TOKEN" \ https://your-app.vercel.app/api/investors/1
{
"id": 1,
"name": "Jane Smith",
"email": "jane@acme.vc",
"company": "Acme Capital",
"stage": "target",
"notes": null,
"created_at": "2026-02-16T10:30:00.000Z",
"updated_at": "2026-02-16T10:30:00.000Z"
}
{ "error": "Investor not found" }
Replaces all fields on the investor. name is required. Omitted optional fields become null.
| Field | Type | Description |
|---|---|---|
| name | string required | Investor name |
| string optional | Email address | |
| company | string optional | Company / fund name |
| stage | string optional | Stage (defaults to target) |
| notes | string optional | Free-text notes |
curl -X PUT https://your-app.vercel.app/api/investors/1 \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Jane Smith", "company": "Acme Capital", "stage": "contacted"}'
Updates only the fields you send. Omitted fields keep their current values. Best way to move an investor between stages.
| Field | Type | Description |
|---|---|---|
| name | string optional | Investor name |
| string optional | Email address | |
| company | string optional | Company / fund name |
| stage | string optional | Move to stage: target, contacted, interested, yes, no |
| notes | string optional | Free-text notes |
curl -X PATCH https://your-app.vercel.app/api/investors/1 \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"stage": "interested"}'
curl -X PATCH https://your-app.vercel.app/api/investors/1 \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"notes": "Follow up next week"}'
Permanently deletes an investor by ID.
curl -X DELETE -H "Authorization: Bearer TOKEN" \ https://your-app.vercel.app/api/investors/1
{
"deleted": {
"id": 1,
"name": "Jane Smith",
...
}
}
Returns the total count and a breakdown by stage.
curl -H "Authorization: Bearer TOKEN" \ https://your-app.vercel.app/api/investors/stats
{
"total": 12,
"by_stage": [
{ "stage": "target", "count": 5 },
{ "stage": "contacted", "count": 3 },
{ "stage": "interested", "count": 2 },
{ "stage": "yes", "count": 1 },
{ "stage": "no", "count": 1 }
]
}
All errors return a JSON object with an error field.
| Status | Meaning |
|---|---|
| 400 | Bad request (missing required field, invalid stage, invalid ID) |
| 401 | Unauthorized (missing or invalid Bearer token) |
| 404 | Investor not found |
| 405 | Method not allowed |
| 500 | Internal server error |