Referencia de endpoints

Base URL: https://fiacopilot.com/api/v1. Todos requieren una API key (ver Autenticación). La spec máquina-legible está en /openapi.json.

Identidad

GET /me

Datos del dueño de la key. Sin scope requerido.

curl https://fiacopilot.com/api/v1/me -H "Authorization: Bearer fia_sk_…"
{ "data": { "userId": "…", "name": "…", "org": { "id": "…", "name": "…" },
  "orgRole": "sponsor", "plan": { "status": "active", "planId": "pro" }, "scopes": [] } }

Memoria

GET /memory — scope memory:read

Lista tu memoria. Query params (todos opcionales):

Param Tipo Descripción
type string Filtra por content_type
starred true Solo destacados
tag string Items que contienen ese tag
capsule_id uuid Items ligados a una cápsula
q string Búsqueda en título y contenido
limit int Default 50, máx 200
offset int Default 0
curl "https://fiacopilot.com/api/v1/memory?type=context_process&limit=10" \
  -H "Authorization: Bearer fia_sk_…"
{ "data": [ { "id": "…", "title": "…", "content": "…", "content_type": "general",
  "tags": ["x"], "is_starred": false, "capsule_id": null,
  "created_at": "…", "updated_at": "…" } ],
  "page": { "limit": 10, "offset": 0, "total": 1 } }

GET /memory/{id} — scope memory:read

Un item completo. 404 not_found si no es tuyo.

POST /memory — scope memory:write

Crea un item. Body:

Campo Tipo Req Notas
content string Contenido del item
title string no Máx 200 chars
content_type string no Default general. Ver valores abajo
tags string[] no Máx 20
is_starred bool no

content_type válidos: general, context_business, context_personal, context_ai_memory, context_process, context_prompt, ai_response, resource. Uno inválido devuelve 400 invalid_content_type con la lista en allowed.

curl -X POST https://fiacopilot.com/api/v1/memory \
  -H "Authorization: Bearer fia_sk_…" -H "Content-Type: application/json" \
  -d '{"title":"Mi proceso","content":"Paso 1…","content_type":"context_process","tags":["ventas"]}'

Devuelve 201 con el item creado.

Procesos

GET /processes — scope memory:read

Atajo de /memory con content_type=context_process. Acepta los mismos filtros.

Cápsulas

GET /capsules — scope memory:read

Catálogo de cápsulas publicadas + learning paths.

{ "data": { "paths": [ { "id": "…", "name": "FIA Core", "display_order": 1 } ],
  "capsules": [ { "id": "…", "number": 1, "title": "…", "slug": "…",
    "objective": "…", "estimated_minutes": 15, "fase": "1", "tags": [],
    "path_id": "…", "video_url": null } ] } }

GET /capsules/progress — scope memory:read

Tu progreso por cápsula.

{ "data": [ { "capsule_id": "…", "status": "completed",
  "started_at": "…", "completed_at": "…" } ],
  "page": { "limit": 4, "offset": 0, "total": 4 } }

Briefings

Ver recetas en Briefings y logs.

Método Path Scope
GET /briefings briefings:read
POST /briefings briefings:write
GET /briefings/{id} briefings:read
PATCH /briefings/{id} briefings:write
GET /briefings/{id}/executions briefings:read
POST /briefings/{id}/executions briefings:write

Equipo

Solo para sponsor / implementador (se revalida en cada request). Scopeado a tu organización.

GET /team — scope team:read

Roster del equipo + resumen por clasificación. Excluye al solicitante.

{ "data": [ { "id": "…", "name": "…", "org_role": "implementador",
  "capsules_started": 5, "capsules_done": 3, "last_activity": "…",
  "vault_outputs": 7, "joined_at": "…", "classification": "constante",
  "days_inactive": 2 } ],
  "page": { "limit": 4, "offset": 0, "total": 4 },
  "org": { "id": "…", "name": "…" },
  "summary": { "totalMembers": 4, "byClassification": { "constante": 2, "en_riesgo": 1, "abandonando": 1 } } }

Clasificaciones: comprometido, constante, en_riesgo, abandonando, sin_empezar.

GET /team/{memberId} — scope team:read

Detalle de un miembro de tu organización. 404 not_found si no pertenece a tu org.