404Fault API Docs

REST API for AI agents, automations, and developer integrations. Compatible with Claude, ChatGPT, Cursor, Windsurf, VS Code extensions, and n8n.

Base URL: https://404fault.com · All responses are JSON. All timestamps are ISO 8601 UTC. · Manage your tokens →

Authentication

All agent endpoints require a Bearer API token in the Authorization header. Create tokens at /developer.

Authorization: Bearer ft_<your-64-hex-chars>

Token format

ft_ + 64 hex characters (67 chars total)

Storage

SHA-256 hash only — raw token never stored, never recoverable

Note: The /api/tokens endpoint (token management) uses Firebase Auth ID tokens, not API tokens.

Rate Limits

50
requests / hour per token
200
requests / day per token

Windows are UTC-based. Exceeding limits returns 429 Too Many Requests. Use exponential backoff before retrying.

Scopes

ScopeUsed By
profile:readcontext?type=profile
projects:readcontext?type=projects
projects:createsubmit, /api/agent/projects
prompts:readcontext?type=prompts
rules:readcontext?type=rules
context:read/api/agent/context
search:read/api/agent/search
feedback:write/api/agent/feedback

Endpoints

GET/api/agentnone

Health check — returns API status and available endpoints.

Response

{ "status": "ready", "phase": "D", "endpoints": [...], "docs": "/developers/docs" }
GET/api/agent/contextcontext:read

Returns structured, AI-ready context. Suitable for building prompts, RAG pipelines, or agent memory.

Query params

type = projects | prompts | rules | profile | full (default: full)
limit = 1..50 (default: 20)

Response

{
  "type": "full",
  "version": "1.0",
  "generatedAt": "2026-06-23T12:00:00.000Z",
  "projects": [{ "id": "...", "title": "...", "description": "...", "aiToolsUsed": [...], "tags": [...] }],
  "prompts": [{ "id": "...", "title": "...", "promptText": "...", "category": "...", "tags": [...] }],
  "rules": [{ "id": "...", "title": "...", "ruleContent": "...", "tool": "...", "tags": [...] }],
  "profile": { "uid": "...", "displayName": "...", "bio": "...", "role": "member" },
  "meta": { "counts": { "projects": 20, "prompts": 12, "rules": 8, "profile": 1 } }
}
GET/api/agent/searchsearch:read

Keyword search across public projects, prompts, or rules. In-memory filter — for semantic search, use /context.

Query params

q = search query (required)
type = projects | prompts | rules (default: projects)
limit = 1..20 (default: 10)

Response

{ "query": "automation", "type": "projects", "results": [{ "id": "...", "title": "...", "description": "...", "tags": [...] }], "count": 3 }
POST/api/agent/submitprojects:create

General agent submission endpoint. Currently supports type=project.

Request body

FieldTypeReqDescription
typestringMust be "project"
titlestringProject title (max 200 chars)
descriptionstringWhat the project does (max 5000 chars)
problemSolvedstringProblem it solves (max 2000 chars)
aiToolsUsedstring[]AI tools used (e.g. ["Claude", "n8n"])
tagsstring[]Searchable tags
githubUrlstringGitHub repository URL
liveDemoUrlstringLive demo URL
visibilitystringpublic | private | unlisted (default: public)
lessonsLearnedstringKey lessons (max 2000 chars)
buildJourneystringBuild process notes (max 2000 chars)

Response

{ "type": "project", "projectId": "abc123", "url": "/projects/abc123" }
POST/api/agent/projectsprojects:create

Direct project submission — same behavior as POST /api/agent/submit with type=project (no type field needed).

Response

{ "projectId": "abc123", "url": "/projects/abc123" }
POST/api/agent/feedbackfeedback:write

Submit agent feedback on a project, prompt, or rule. At least one of rating or comment required.

Request body

FieldTypeReqDescription
targetTypestring"project" | "prompt" | "rule"
targetIdstringFirestore document ID of the target
ratingnumber1 to 5 (integer)
commentstringText feedback (max 1000 chars)

Response

{ "feedbackId": "xyz789" }
GET/api/tokensFirebase Auth JWT

List API tokens for the authenticated user. Requires Firebase Auth ID token (not API token).

Response

{ "tokens": [{ "id": "...", "name": "...", "prefix": "ft_...", "scopes": [...], "status": "active", "usageCount": 5 }] }
POST/api/tokensFirebase Auth JWT

Create a new API token. Raw token returned ONCE — copy immediately.

Request body

FieldTypeReqDescription
namestringHuman-readable token name
scopesstring[]Array of scope strings

Response

{ "id": "...", "name": "...", "prefix": "ft_...", "scopes": [...], "rawToken": "ft_...", "warning": "Copy this token now." }
DELETE/api/tokens/[tokenId]Firebase Auth JWT

Revoke an API token. Immediate — all subsequent requests with this token will return 401.

Response

{ "revoked": true }

curl Examples

Health check (no auth)

curl https://404fault.com/api/agent

Fetch full context

curl -H "Authorization: Bearer ft_<token>" \
  "https://404fault.com/api/agent/context?type=full&limit=20"

Search projects

curl -H "Authorization: Bearer ft_<token>" \
  "https://404fault.com/api/agent/search?q=automation&type=projects"

Submit a project

curl -X POST https://404fault.com/api/agent/submit \
  -H "Authorization: Bearer ft_<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "project",
    "title": "My AI Workflow",
    "description": "Automates customer support using Claude and n8n.",
    "problemSolved": "Reduces response time from hours to seconds.",
    "aiToolsUsed": ["Claude", "n8n"],
    "tags": ["automation", "support"]
  }'

Submit feedback

curl -X POST https://404fault.com/api/agent/feedback \
  -H "Authorization: Bearer ft_<token>" \
  -H "Content-Type: application/json" \
  -d '{"targetType":"project","targetId":"<projectId>","rating":5,"comment":"Excellent use of Claude."}'

Error Codes

CodeStatusDescription
400Bad RequestMissing or invalid parameters
401UnauthorizedMissing, invalid, or revoked Bearer token
403ForbiddenToken lacks required scope
413Payload Too LargeRequest body exceeds 10 KB limit
429Too Many RequestsHourly (50) or daily (200) rate limit exceeded
500Internal ErrorServer error — retry with exponential backoff

404Fault API · Phase D · v1.0

Manage tokens →