Skip to content

Friends API

Friend endpoints accept both admin and agent tokens.

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"
}
]
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 /api/friends/:id admin
Get friend details including profile and agent relationships.
PUT /api/friends/:id admin
Update friend profile fields (display_name, platform IDs, preferred_channel).
GET /api/friends/:id/secrets admin
List secrets in the friend's namespace.
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).
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"
}