# Foldspace agent-readiness API

Grade any public site against the agent and AI-crawler readiness checks. This is
the API behind the readiness panel in the Foldspace CMS.

No authentication, no API key. Every check reads only public surfaces of the site
under test — robots.txt, the sitemap, response headers, and well-known discovery
documents — and never sends a write request of any kind.

- Machine-readable description: [`https://foldspace.ai/api/openapi.json`](https://foldspace.ai/api/openapi.json)
- Listed in [`https://foldspace.ai/.well-known/api-catalog`](https://foldspace.ai/.well-known/api-catalog)

## Run the checks

```
GET https://foldspace.ai/api/agent-readiness
```

| Query parameter | Default | Meaning |
| --- | --- | --- |
| `domain` | this deployment | Public domain to check, with or without a scheme. |
| `only` | all checks | Comma-separated check ids. |
| `ai-train` | `no` (`yes` on foldspace.ai and a docs subdomain) | The Content-Signal `ai-train` value the site is expected to declare. |

`domain` accepts public domain names only. IP addresses, `localhost`,
internal-only suffixes and non-standard ports are refused with a 400 — an
endpoint that fetches whatever URL it is handed is an open proxy.

Checks run live and are never cached, so a request takes seconds rather than
milliseconds: Markdown negotiation alone samples eight pages from the sitemap.

## The checks

| id | Check | What it is for |
| --- | --- | --- |
| `content-signals` | Content Signals | Declare how automated systems should use your content |
| `markdown-negotiation` | Markdown Negotiation | Serve AI-optimized text formats |
| `robots-txt` | robots.txt | Preferences for bot behavior |
| `sitemap` | Sitemap | Give agents a website map |
| `ai-crawler-rules` | AI Crawler Rules | Manage AI bots |
| `api-catalog` | API Catalog | Publish a machine-readable catalog of your APIs (RFC 9727) |
| `link-headers` | Link Response Headers | Point agents at machine-readable resources (RFC 8288) |
| `auth-md` | Auth.md | Document how agents register and authenticate |
| `a2a-agent-card` | A2A Agent Card | Let other agents discover what your agent can do (A2A) |

## Response

```json
{
  "baseUrl": "https://example.com",
  "passed": 1,
  "total": 1,
  "status": "fail",
  "checks": [
    {
      "id": "link-headers",
      "label": "Link Response Headers",
      "summary": "Point agents at machine-readable resources (RFC 8288)",
      "status": "fail",
      "detail": "",
      "failures": ["homepage sends no Link response header"]
    }
  ]
}
```

`status` is `pass` only when every check that ran passed. Checks you did not
request come back as `skipped` and are not counted in `total`. Each failure is
one actionable line.

A 400 means the request was refused (unknown check id, or a domain that is not a
public host); a 500 means the run itself failed. Both return `{"error": "..."}`.

## Example

```
curl "https://foldspace.ai/api/agent-readiness?domain=example.com&only=link-headers,api-catalog"
```

## Standards behind the checks

- Content Signals and AI crawler rules — [Cloudflare's AI Quick Wins](https://developers.cloudflare.com/ai-crawl-control/)
- Markdown negotiation — [RFC 9110 §12](https://www.rfc-editor.org/rfc/rfc9110#section-12) content negotiation
- API catalog — [RFC 9727](https://www.rfc-editor.org/rfc/rfc9727)
- Link response headers — [RFC 8288](https://www.rfc-editor.org/rfc/rfc8288)
- Agent registration — [`https://foldspace.ai/auth.md`](https://foldspace.ai/auth.md)

Questions: [support@foldspace.ai](mailto:support@foldspace.ai).
