> For the complete documentation index, see [llms.txt](https://docs.simplephysx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.simplephysx.com/reference/api-v3-reference.md). Agents can also search and read this documentation through its [MCP server](https://docs.simplephysx.com/~gitbook/mcp).

# Server API (v3)

Use the SPX Server API v3 reference for authentication, hierarchy routes and the OpenAPI specification of the released server.

The baseline is SPX Server **v1.0.0**. Its hierarchy API is rooted at `http://localhost:8000/api/v3/system`. The existing GitBook OpenAPI integration is named `hammerheadsengineers-api`; keep this identity when importing an update. The reproducible [OpenAPI export](https://github.com/HammerHeads-Engineers/spx-docs/tree/main/api-v3-reference/openapi.json) comes from the exact server commit recorded in `sources.json` and includes public health/version routes.

## Authentication and route shapes

Send `Authorization: Bearer <SPX_PRODUCT_KEY>` for API v3 operations. Health and version discovery routes are public. Never put a real key in documentation or a query string. A missing/malformed bearer token and a rejected token can produce different 401/403 responses; inspect the status and structured diagnostics.

| Operation            | Route shape                                |
| -------------------- | ------------------------------------------ |
| Inspect root         | `GET /api/v3/system`                       |
| Inspect a node       | `GET /api/v3/system/{path}`                |
| Read a property      | `GET /api/v3/system/{path}/attr/{name}`    |
| Update a property    | `PUT /api/v3/system/{path}/attr/{name}`    |
| Update a node        | `PUT /api/v3/system/{path}`                |
| Invoke a method      | `POST /api/v3/system/{path}/method/{name}` |
| Invoke a root method | `POST /api/v3/system/method/{name}`        |
| Delete a node        | `DELETE /api/v3/system/{path}`             |

Use the schema's request bodies rather than inventing a PATCH API. Component state/properties, children and exposed methods are distinct. For an attribute's simulation value, descend to `instances/<id>/attributes/<attribute>` and choose `internal_value` or `external_value` explicitly where appropriate.

The dynamic hierarchy schema describes route templates; available component methods and payload meanings depend on the runtime tree. Inspect the node or use the matching **spx-python 1.0.0rc3** client. See [Code Examples](https://docs.simplephysx.com/reference/api-v3-reference/code-examples.md) and the [model reference](https://docs.simplephysx.com/reference/model-definition-reference.md).

## Updating the schema

Maintainers run `scripts/export_openapi.py --server <authorized-local-server-repo>` using the pinned server dependency environment. It reads the exact manifest commit and imports both actual routers. Public CI validates the committed schema and provenance without any private source access or credentials. The existing `hammerheadsengineers-api` specification imports this public file from `spx-docs/main`. GitBook checks the URL every six hours; an explicit Update can refresh it sooner. Approved schema changes therefore follow the same main review path as the portal. Verify rendered operations after each schema update.
