Organizations API
The Organizations API allows you to manage your own organization information. The organization represents your company and provides context for competitive comparisons.
Get Organization
Get the current user's organization by workspace ID.
GET /api/organizations
Response
{
"organization": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"workspaceId": "workspace-id",
"name": "My Company",
"websiteUrl": "https://mycompany.com",
"domain": "mycompany.com",
"companyProfile": {
"yearFounded": 2020,
"revenue": "$10M",
"employeeCount": "50-100",
"industry": "SaaS",
"headquarters": "San Francisco, CA"
},
"createdAt": "2024-01-01T00:00:00.000Z"
}
}
If no organization exists, returns null:
{
"organization": null
}
Update Organization
Update the current user's organization. Requires EDITOR role or higher.
PATCH /api/organizations
Request Body
All fields are optional. Only include fields you want to update:
{
"name": "Updated Company Name",
"websiteUrl": "https://updated-company.com",
"companyProfile": {
"yearFounded": 2020,
"revenue": "$10M",
"employeeCount": "50-100",
"industry": "SaaS",
"headquarters": "San Francisco, CA",
"newsFeed": [
{
"date": "2024-01-01",
"title": "Company News",
"url": "https://example.com/news",
"summary": "News summary",
"source": "Company Blog"
}
],
"pricingLinks": [
{
"label": "Pricing Page",
"url": "https://example.com/pricing",
"discoveredAt": "2024-01-01T00:00:00.000Z"
}
],
"offeringLinks": [
{
"label": "Product Page",
"url": "https://example.com/product",
"discoveredAt": "2024-01-01T00:00:00.000Z"
}
]
},
"companyStrengths": ["Strength 1", "Strength 2"],
"companyWeaknesses": ["Weakness 1"],
"referenceLinks": [
{
"label": "Reference Link",
"url": "https://example.com/reference"
}
],
"keyMessaging": ["Message 1", "Message 2"]
}
Allowed Fields
name(string) - Organization namewebsiteUrl(string) - Website URLcompanyProfile(object) - Company profile informationcompanyStrengths(array of strings) - Company strengthscompanyWeaknesses(array of strings) - Company weaknessesreferenceLinks(array of objects) - Reference linkskeyMessaging(array of strings) - Key messaging points
Response
{
"organization": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"workspaceId": "workspace-id",
"name": "Updated Company Name",
"websiteUrl": "https://updated-company.com",
"companyProfile": {},
"createdAt": "2024-01-01T00:00:00.000Z"
}
}
Get Organization by ID
Get a specific organization by ID.
GET /api/organizations/{id}
Path Parameters
id(string, required) - Organization ID
Response
{
"organization": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"workspaceId": "workspace-id",
"name": "My Company",
"websiteUrl": "https://mycompany.com",
"createdAt": "2024-01-01T00:00:00.000Z"
}
}
Refresh Organization
Trigger a refresh job for the organization to update company profile and news.
POST /api/organizations/refresh
Response
{
"jobId": "job-id-for-tracking-refresh"
}
Refresh Organization News
Trigger a news refresh for the organization.
POST /api/organizations/news/refresh
Response
{
"jobId": "job-id-for-tracking-news-refresh"
}
Get Organization Knowledge Tree
Get knowledge tree metadata for an organization.
GET /api/organizations/{id}/tree-metadata
Path Parameters
id(string, required) - Organization ID
Response
{
"metadata": {
"treeId": "tree-id",
"rootId": "root-node-id",
"nodeCount": 10,
"createdAt": "2024-01-01T00:00:00.000Z"
}
}
Get Organization Tree
Get the knowledge tree for an organization.
GET /api/organizations/tree
Response
{
"tree": {
"id": "tree-id",
"treeId": "tree-id",
"workspaceId": "workspace-id",
"entityType": "ORGANIZATION",
"entityId": "organization-id",
"version": 1,
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
}
Error Responses
400- Bad Request (invalid data)401- Unauthorized (invalid or missing API key)403- Forbidden (insufficient permissions)404- Not Found (organization doesn't exist)