{
  "name": "Blitera API",
  "version": "2026-05-19",
  "base_url_env": "BLITERA_BASE_URL",
  "api_key_env": "BLITERA_API_KEY",
  "workspace_env": "BLITERA_WORKSPACE_ID",
  "auth_modes": {
    "api_key": {
      "header": "X-API-Key",
      "intended_for": "server-to-server automation",
      "never_use_from": [
        "browser code",
        "untrusted clients",
        "public repositories"
      ]
    },
    "session_only": {
      "intended_for": "owner governance from an authenticated Blitera session",
      "forbidden_headers": [
        "X-API-Key"
      ]
    }
  },
  "scopes": [
    "links:read",
    "links:write",
    "links:delete",
    "files:read",
    "files:write",
    "files:delete",
    "collections:read",
    "collections:write",
    "collections:delete",
    "audit:read"
  ],
  "rules": [
    "Never send account_id in request bodies or query strings.",
    "Workspace access requires both the endpoint scope and an explicit API key workspace allowlist match.",
    "Treat 403 responses as authorization boundaries.",
    "Confirm with the operator before destructive operations."
  ],
  "endpoints": [
    {
      "method": "GET",
      "path": "/api/links",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "links:read",
      "safe_for_agents": true,
      "workspace_supported": true,
      "query_params": [
        "page",
        "limit",
        "status",
        "encryption_mode",
        "target_type",
        "sort_by",
        "order",
        "search",
        "workspace_id"
      ],
      "danger_level": "read",
      "example_script": "/api-agent/scripts/api/list-links.ps1",
      "example_script_bash": "/api-agent/scripts/api/list-links.sh",
      "notes": "Lists personal links by default, or workspace links when workspace_id is allowlisted."
    },
    {
      "method": "GET",
      "path": "/api/links/{share_code}",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "links:read",
      "safe_for_agents": true,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "read",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Retrieves a link visible to the key."
    },
    {
      "method": "POST",
      "path": "/api/links",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "links:write",
      "safe_for_agents": false,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "write",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Requires operator confirmation when called by an agent.",
      "requires_operator_confirmation": true
    },
    {
      "method": "PUT",
      "path": "/api/links/{share_code}",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "links:write",
      "safe_for_agents": false,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "write",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Requires operator confirmation when called by an agent.",
      "requires_operator_confirmation": true
    },
    {
      "method": "DELETE",
      "path": "/api/links/{share_code}",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "links:delete",
      "safe_for_agents": false,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "destructive",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Requires explicit operator confirmation.",
      "requires_operator_confirmation": true
    },
    {
      "method": "GET",
      "path": "/api/files",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "files:read",
      "safe_for_agents": true,
      "workspace_supported": true,
      "query_params": [
        "workspace_id"
      ],
      "danger_level": "read",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Lists file metadata visible to the key."
    },
    {
      "method": "POST",
      "path": "/api/files/preflight",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "files:write",
      "safe_for_agents": false,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "write",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Begins a file upload flow. Requires operator confirmation when called by an agent.",
      "requires_operator_confirmation": true
    },
    {
      "method": "POST",
      "path": "/api/files/upload",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "files:write",
      "safe_for_agents": false,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "write",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Uploads file content. Never log file bytes or secrets.",
      "requires_operator_confirmation": true
    },
    {
      "method": "DELETE",
      "path": "/api/files/{file_id}",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "files:delete",
      "safe_for_agents": false,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "destructive",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Requires explicit operator confirmation.",
      "requires_operator_confirmation": true
    },
    {
      "method": "GET",
      "path": "/api/collections",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "collections:read",
      "safe_for_agents": true,
      "workspace_supported": true,
      "query_params": [
        "page",
        "limit",
        "workspace_id"
      ],
      "danger_level": "read",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Collections never mix personal and workspace items."
    },
    {
      "method": "GET",
      "path": "/api/collections/{share_code}",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "collections:read",
      "safe_for_agents": true,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "read",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Retrieves a collection visible to the key."
    },
    {
      "method": "POST",
      "path": "/api/collections",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "collections:write",
      "safe_for_agents": false,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "write",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Requires operator confirmation when called by an agent.",
      "requires_operator_confirmation": true
    },
    {
      "method": "PUT",
      "path": "/api/collections/{share_code}",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "collections:write",
      "safe_for_agents": false,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "write",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Requires operator confirmation when called by an agent.",
      "requires_operator_confirmation": true
    },
    {
      "method": "DELETE",
      "path": "/api/collections/{share_code}",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "collections:delete",
      "safe_for_agents": false,
      "workspace_supported": true,
      "query_params": [],
      "danger_level": "destructive",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Requires explicit operator confirmation.",
      "requires_operator_confirmation": true
    },
    {
      "method": "GET",
      "path": "/api/links/audit/log",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "audit:read",
      "safe_for_agents": true,
      "workspace_supported": false,
      "query_params": [
        "share_code",
        "start_date",
        "end_date",
        "limit",
        "offset",
        "search"
      ],
      "danger_level": "read",
      "example_script": "/api-agent/scripts/api/list-audit-logs.ps1",
      "example_script_bash": "/api-agent/scripts/api/list-audit-logs.sh",
      "notes": "Public access audit, not API key activity."
    },
    {
      "method": "GET",
      "path": "/api/links/audit/export",
      "auth_mode": "api_key",
      "api_key_allowed": true,
      "required_scope": "audit:read",
      "safe_for_agents": true,
      "workspace_supported": false,
      "query_params": [
        "share_code",
        "start_date",
        "end_date",
        "search"
      ],
      "danger_level": "export",
      "example_script": "/api-agent/scripts/api/export-audit-logs.ps1",
      "example_script_bash": "/api-agent/scripts/api/export-audit-logs.sh",
      "notes": "CSV export may require a plan feature gate."
    },
    {
      "method": "GET",
      "path": "/api/keys",
      "auth_mode": "session_only",
      "api_key_allowed": false,
      "required_scope": null,
      "safe_for_agents": false,
      "workspace_supported": false,
      "query_params": [],
      "danger_level": "owner_governance",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Lists API keys for the authenticated owner session.",
      "forbidden_headers": [
        "X-API-Key"
      ],
      "expected_api_key_response": 403
    },
    {
      "method": "POST",
      "path": "/api/keys",
      "auth_mode": "session_only",
      "api_key_allowed": false,
      "required_scope": null,
      "safe_for_agents": false,
      "workspace_supported": false,
      "query_params": [],
      "danger_level": "owner_governance_write",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Creates an API key. The secret is shown once.",
      "forbidden_headers": [
        "X-API-Key"
      ],
      "expected_api_key_response": 403
    },
    {
      "method": "PUT",
      "path": "/api/keys/{prefix}",
      "auth_mode": "session_only",
      "api_key_allowed": false,
      "required_scope": null,
      "safe_for_agents": false,
      "workspace_supported": false,
      "query_params": [],
      "danger_level": "owner_governance_write",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Updates API key metadata, scopes, or workspace allowlist.",
      "forbidden_headers": [
        "X-API-Key"
      ],
      "expected_api_key_response": 403
    },
    {
      "method": "DELETE",
      "path": "/api/keys/{prefix}",
      "auth_mode": "session_only",
      "api_key_allowed": false,
      "required_scope": null,
      "safe_for_agents": false,
      "workspace_supported": false,
      "query_params": [],
      "danger_level": "owner_governance_destructive",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Revokes an API key. Requires explicit operator confirmation.",
      "forbidden_headers": [
        "X-API-Key"
      ],
      "expected_api_key_response": 403
    },
    {
      "method": "GET",
      "path": "/api/keys/audit/log",
      "auth_mode": "session_only",
      "api_key_allowed": false,
      "required_scope": null,
      "safe_for_agents": false,
      "workspace_supported": false,
      "query_params": [
        "api_key_prefix",
        "workspace_id",
        "start_date",
        "end_date",
        "limit",
        "offset"
      ],
      "danger_level": "owner_governance",
      "example_script": null,
      "example_script_bash": null,
      "notes": "Dedicated API key activity. API keys cannot read their own activity.",
      "forbidden_headers": [
        "X-API-Key"
      ],
      "expected_api_key_response": 403
    },
    {
      "method": "GET",
      "path": "/api/keys/audit/export",
      "auth_mode": "session_only",
      "api_key_allowed": false,
      "required_scope": null,
      "safe_for_agents": false,
      "workspace_supported": false,
      "query_params": [
        "api_key_prefix",
        "workspace_id",
        "start_date",
        "end_date"
      ],
      "danger_level": "owner_governance_export",
      "example_script": null,
      "example_script_bash": null,
      "notes": "CSV export of dedicated API key activity.",
      "forbidden_headers": [
        "X-API-Key"
      ],
      "expected_api_key_response": 403
    }
  ],
  "discovery": {
    "canonical_manifest": "/api-agent/blitera-api-manifest.json",
    "agent_discovery": "/.well-known/agent.json",
    "agent_guide": "/api-agent/API_AGENT_GUIDE.md",
    "skill": "/api-agent/skills/blitera-api-agent/SKILL.md",
    "llms": "/llms.txt",
    "rule": "Use this manifest as the only endpoint catalog. Do not infer endpoints from page HTML or guessed REST routes."
  },
  "workflows": [
    {
      "id": "list_links",
      "description": "List personal links visible to the API key.",
      "required_env": [
        "BLITERA_BASE_URL",
        "BLITERA_API_KEY"
      ],
      "optional_env": [],
      "method": "GET",
      "path": "/api/links",
      "required_scope": "links:read",
      "powershell_script": "/api-agent/scripts/api/list-links.ps1",
      "bash_script": "/api-agent/scripts/api/list-links.sh"
    },
    {
      "id": "list_workspace_links",
      "description": "List links in an explicitly allowlisted workspace.",
      "required_env": [
        "BLITERA_BASE_URL",
        "BLITERA_API_KEY",
        "BLITERA_WORKSPACE_ID"
      ],
      "optional_env": [],
      "method": "GET",
      "path": "/api/links",
      "required_scope": "links:read",
      "powershell_script": "/api-agent/scripts/api/list-links.ps1",
      "bash_script": "/api-agent/scripts/api/list-links.sh"
    },
    {
      "id": "list_access_audit",
      "description": "Read paginated public access audit logs.",
      "required_env": [
        "BLITERA_BASE_URL",
        "BLITERA_API_KEY"
      ],
      "optional_env": [
        "BLITERA_SHARE_CODE"
      ],
      "method": "GET",
      "path": "/api/links/audit/log",
      "required_scope": "audit:read",
      "powershell_script": "/api-agent/scripts/api/list-audit-logs.ps1",
      "bash_script": "/api-agent/scripts/api/list-audit-logs.sh"
    },
    {
      "id": "export_access_audit",
      "description": "Export public access audit logs as CSV.",
      "required_env": [
        "BLITERA_BASE_URL",
        "BLITERA_API_KEY"
      ],
      "optional_env": [
        "BLITERA_SHARE_CODE"
      ],
      "method": "GET",
      "path": "/api/links/audit/export",
      "required_scope": "audit:read",
      "powershell_script": "/api-agent/scripts/api/export-audit-logs.ps1",
      "bash_script": "/api-agent/scripts/api/export-audit-logs.sh"
    }
  ]
}
