Friends API
Friend endpoints accept both admin and agent tokens.
List Friends
Section titled “List Friends” GET /api/friends admin
List all friends with their platform IDs and namespace info.
Response:
[ { "id": "alice", "display_name": "Alice", "discord_id": "123456789012345678", "signal": "+1-555-0100", "whatsapp": "+1-555-0100", "preferred_channel": "signal", "namespace": "friend-alice" }]Create Friend
Section titled “Create Friend” POST /api/friends admin
Create a new friend, provision their k8s namespace, and write profile.json to workspace.
Body:
{ "id": "alice", "display_name": "Alice", "discord_id": "123456789012345678", "signal": "+1-555-0100", "whatsapp": "+1-555-0100", "preferred_channel": "signal"}Only id and display_name are required.
Get Friend
Section titled “Get Friend” GET /api/friends/:id admin
Get friend details including profile and agent relationships.
Update Friend
Section titled “Update Friend” PUT /api/friends/:id admin
Update friend profile fields (display_name, platform IDs, preferred_channel).
Secrets
Section titled “Secrets” GET /api/friends/:id/secrets admin
List secrets in the friend's namespace.
Namespace Management
Section titled “Namespace Management” POST /api/friends/:id/namespace/provision admin
Provision (or re-provision) the friend's k8s namespace with quotas and policies.
POST /api/friends/:id/namespace/apply admin
Apply k8s manifests to the friend's namespace. Allowed kinds: Deployment, Service, ConfigMap, Job, CronJob.
GET /api/friends/:id/namespace/pods admin
List pods in the friend's namespace.
GET /api/friends/:id/namespace/status admin
Full namespace overview: pods, services, deployments, quota.
DELETE /api/friends/:id/namespace/deployments/:name admin
Delete a deployment from the friend's namespace.
GET /api/friends/:id/namespace/logs/:pod admin
Get logs from a specific pod. Optional ?tail=N (default 100, max 500).
Service Exposure
Section titled “Service Exposure” POST /api/friends/:id/namespace/expose admin
Expose a service publicly via IngressRoute + Cloudflare DNS.
Body:
{ "name": "my-app", "service": "my-app", "port": 80, "domain": "your-domain.net"}Response:
{ "ok": true, "hostname": "my-app-alice.your-domain.net", "url": "https://my-app-alice.your-domain.net"}