Companies

Companies are the org-scoped account records in Stracker CRM. Scoped by companies.org_id.

Quickstart

Base URL (canonical)

https://api.strackerapp.com/v1/

Same gateway also answers under /api/v1 on strackerapp.com. Prefer the api. subdomain. Do not use api.stracker.io (not wired; returns 403).

Environments (keep separate)

EnvBaseKeys
Productionhttps://api.strackerapp.com/v1sk_prod_… only
Local smokehttp://127.0.0.1:8888/api/v1sk_dev_… only

Never mix prod keys with local, or local keys with prod.

Auth (all endpoints)

Org-scoped Bearer API key. Agent keys act as the agent with reports_to ACL inheritance.

Authorization: Bearer sk_REPLACE
Content-Type: application/json

# Optional alternate header:
# X-Stracker-Api-Key: sk_REPLACE

Response envelope

{
  "success": true,
  "data":   { /* endpoint-specific payload */ }
}

Errors

Failed responses always have success: false and an error object with a stable code and a human-readable message:

{
  "success": false,
  "error": {
    "code":    "VALIDATION_ERROR",
    "message": "company_name is required"
  }
}
HTTP statusWhenWhat to do
400Validation failed (missing required fields, bad enum, migration not applied for company/contact notes, assignee not in org, slot unavailable).Read error.message; fix the payload.
401Missing or invalid Authorization / X-Stracker-Api-Key.Check the API key; confirm the header is present.
403Key is valid but lacks permission (e.g. non-admin calling agent admin endpoints), or org scope mismatch.Use an org-admin key, or confirm the resource belongs to the key's org.
404Resource not found or not visible to this org.Verify the id and org scoping.
500Unexpected server error.Retry with backoff; report if persistent.

Companies

Endpoints at a glance

ActionMethod + PathSummary
List companiesGET /companiesList CRM companies in the API key's org. Optional search and type filter.
Create a companyPOST /companiesCreate a company. Required: company_name.
Get a companyGET /companies/{id}Fetch a single company by id (org-scoped).
Update a companyPATCH/PUT /companies/{id}Update one or more fields. Only provided fields are changed.

GET /companies

List CRM companies in the API key's org. Optional search and type filter.

Query parameters

FieldTypeRequiredDescription
q string no Search company name / website / city
type string no prospect|partner|vendor|competitor|press
limit integer no Page size Default: 50.
offset integer no Offset for pagination

Request example

curl -sS "https://api.strackerapp.com/v1/companies?q=acme&limit=5" \
  -H "Authorization: Bearer sk_REPLACE"

Response 200 OK

{
  "success": true,
  "data": {
    "companies": [
      { "id": 42, "company_name": "Acme Corp", "type": "prospect", "city": "Austin", "state": "TX", "website": "https://acme.example" }
    ],
    "pagination": { "limit": 5, "offset": 0, "total": 1 }
  }
}

POST /companies

Create a company. Required: company_name.

Body parameters

FieldTypeRequiredDescription
company_name string yes Display name
description string no Free-text description
address string no Street address
city string no City
state string no State / region
website string no Website URL
type string no prospect|partner|vendor|competitor|press

Request example

curl -sS https://api.strackerapp.com/v1/companies \
  -H "Authorization: Bearer sk_REPLACE" \
  -H "Content-Type: application/json" \
  -d '{"company_name":"API Smoke Co","type":"prospect"}'

Response 201 Created

{
  "success": true,
  "data": {
    "company": { "id": 43, "company_name": "API Smoke Co", "type": "prospect" }
  }
}

GET /companies/{id}

Fetch a single company by id (org-scoped).

Path parameters

FieldTypeRequiredDescription
id integer yes Company id

Request example

curl -sS https://api.strackerapp.com/v1/companies/42 \
  -H "Authorization: Bearer sk_REPLACE"

Response 200 OK

{
  "success": true,
  "data": {
    "company": { "id": 42, "company_name": "Acme Corp", "type": "prospect", "city": "Austin", "state": "TX" }
  }
}

PATCH PUT /companies/{id}

Update one or more fields. Only provided fields are changed.

Path parameters

FieldTypeRequiredDescription
id integer yes Company id

Body parameters

FieldTypeRequiredDescription
company_name string no Display name
description string no Description
address string no Street address
city string no City
state string no State
website string no Website
type string no prospect|partner|vendor|competitor|press

Request example

curl -sS -X PATCH https://api.strackerapp.com/v1/companies/42 \
  -H "Authorization: Bearer sk_REPLACE" \
  -H "Content-Type: application/json" \
  -d '{"city":"Dallas","type":"partner"}'

Response 200 OK

{
  "success": true,
  "data": {
    "company": { "id": 42, "company_name": "Acme Corp", "type": "partner", "city": "Dallas" }
  }
}