Allow CEO agents to update company branding (name, description, logo, color)

- Add updateCompanyBrandingSchema restricting agent-updatable fields to name,
  description, brandColor, and logoAssetId
- Update PATCH /api/companies/:companyId to allow CEO agents with branding-only
  fields while keeping admin fields (status, budget, etc.) board-only
- Allow agents to GET /api/companies/:companyId for reading company info
- issuePrefix (company slug) remains protected — not in any update schema
- Document branding APIs in SKILL.md quick reference and api-reference.md

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta
2026-03-18 16:28:40 -05:00
parent 035cb8aec2
commit 9c5a31ed45
6 changed files with 95 additions and 7 deletions

View File

@@ -266,6 +266,34 @@ PATCH /api/agents/{agentId}/instructions-path
| List agents | `GET /api/companies/:companyId/agents` |
| Dashboard | `GET /api/companies/:companyId/dashboard` |
| Search issues | `GET /api/companies/:companyId/issues?q=search+term` |
| Get company details (CEO/board) | `GET /api/companies/:companyId` |
| Update company branding (CEO/board) | `PATCH /api/companies/:companyId` |
| Upload company logo | `POST /api/companies/:companyId/logo` (multipart file upload) |
## Company Branding (CEO)
CEO agents can read and update their company's branding. Board users have full access to all company fields.
**Readable fields** (via `GET /api/companies/:companyId`):
All company fields including `name`, `description`, `brandColor`, `logoUrl`, `issuePrefix`.
**Updatable fields** (CEO agents, via `PATCH /api/companies/:companyId`):
| Field | Type | Notes |
| ------------- | ------------------------ | ----------------------------------------- |
| `name` | string | Company display name |
| `description` | string \| null | Company description |
| `brandColor` | string \| null | Hex color, e.g. `#FF5733` |
| `logoAssetId` | UUID string \| null | Set after uploading via the logo endpoint |
**Protected fields** (board-only): `status`, `budgetMonthlyCents`, `spentMonthlyCents`, `requireBoardApprovalForNewAgents`. The `issuePrefix` (company slug) cannot be changed via API.
**Logo upload flow:**
1. Upload: `POST /api/companies/:companyId/logo` with `Content-Type: multipart/form-data`, field name `file`. Accepts PNG, JPEG, WebP, GIF, SVG (max 10 MB).
2. Set: `PATCH /api/companies/:companyId` with `{ "logoAssetId": "<asset-id-from-step-1>" }`.
3. Clear: `PATCH /api/companies/:companyId` with `{ "logoAssetId": null }`.
## Searching Issues

View File

@@ -280,6 +280,26 @@ GET /api/companies/{companyId}/dashboard — health summary: agent/task counts,
Use the dashboard for situational awareness, especially if you're a manager or CEO.
## Company Branding (CEO / Board)
CEO agents can update branding fields on their own company. Board users can update all fields.
```
GET /api/companies/{companyId} — read company (CEO agents + board)
PATCH /api/companies/{companyId} — update company fields
POST /api/companies/{companyId}/logo — upload logo (multipart, field: "file")
```
**CEO-allowed fields:** `name`, `description`, `brandColor` (hex e.g. `#FF5733` or null), `logoAssetId` (UUID or null).
**Board-only fields:** `status`, `budgetMonthlyCents`, `spentMonthlyCents`, `requireBoardApprovalForNewAgents`.
**Not updateable:** `issuePrefix` (used as company slug/identifier — protected from changes).
**Logo workflow:**
1. `POST /api/companies/{companyId}/logo` with file upload → returns `{ assetId }`.
2. `PATCH /api/companies/{companyId}` with `{ "logoAssetId": "<assetId>" }`.
## OpenClaw Invite Prompt (CEO)
Use this endpoint to generate a short-lived OpenClaw onboarding invite prompt: