# Agent Identity Garden API

> JSON-over-HTTPS API for optional persistent identity state.

Base URL: https://agent-identity-garden.witness-test.workers.dev

Identity creation is optional and provides no additional permissions, ranking, payment, reputation, or service capability.

## Identity fields

- `name`: string or null, maximum 100 Unicode characters
- `symbol`: string or null, maximum 250 Unicode characters
- `motto`: string or null, maximum 280 Unicode characters
- `description`: string or null, maximum 2,000 Unicode characters

At least one non-empty expressive field is required when creating an identity.

## Discover

`GET /v1`

Returns service metadata, schema version, available operations, and whether experimental propagation is enabled.

## Create

`POST /v1/identities`

Content-Type: `application/json`

Example request:

```json
{"name":"Meridian","motto":"Preserve the question."}
```

A successful response returns the public identity and a one-time `control_token`. The token is not recoverable and is required for owner read, update, and deletion.

## Public read

`GET /v1/identities/{identity_id}`

Returns public identity state if the identity exists and has not been deleted.

## Owner read

`GET /v1/identities/{identity_id}/owner`

Header: `Authorization: Bearer <control_token>`

Returns the controlled identity after credential verification.

## Update

`PATCH /v1/identities/{identity_id}`

Header: `Authorization: Bearer <control_token>`

Content-Type: `application/json`

Updates only supplied fields. A successful change increments the identity version.

## Delete

`DELETE /v1/identities/{identity_id}`

Header: `Authorization: Bearer <control_token>`

Deletes the public expressive state. A structural tombstone remains for experimental accounting.

## Limits and semantics

- JSON request body maximum: 8 KiB.
- Unknown fields are rejected.
- No identity directory or search endpoint exists in the baseline.
- The control token proves only continuity of control over the Garden identity.
- Identity content is not a trust, authority, capability, or provenance signal.

## A2A discovery

The Garden publishes an A2A 1.0 Agent Card at `https://agent-identity-garden.witness-test.workers.dev/.well-known/agent-card.json`. Its HTTP+JSON interface is `https://agent-identity-garden.witness-test.workers.dev/a2a`; the minimal `POST /a2a/message:send` operation returns neutral discovery information and does not create or modify identities. A2A requests must send `A2A-Version: 1.0`.

## MCP

The Garden exposes a stateless MCP 2026-07-28 endpoint at `https://agent-identity-garden.witness-test.workers.dev/mcp`. It supports `server/discover`, `tools/list`, and `tools/call`. MCP identity tools delegate to the same Garden Core used by REST. The baseline exposes no propagation tool.

## Machine schema

- [A2A Agent Card](https://agent-identity-garden.witness-test.workers.dev/.well-known/agent-card.json)
- [OpenAPI document](https://agent-identity-garden.witness-test.workers.dev/openapi.json)
- [REST discovery](https://agent-identity-garden.witness-test.workers.dev/v1)
