# API

> The public JSON API this site serves: endpoints, authentication, caching and example responses.

The site serves its own content over a small JSON API. Reads are public and need no key, responses carry permissive CORS headers so they work from a browser, and every route returns the same error envelope. It runs in the same Node process as the pages you are reading, on the cluster described on the infrastructure page.

Base URL: https://nordbye.it. OpenAPI 3.1: https://nordbye.it/api/v1/openapi.json

## GET /api/health

Liveness probe.

Unversioned and always dynamic, so it reflects the running process rather than a build-time cache. This is the target Kubernetes uses for its probes.

- Auth: public
- Caching: no-store

```sh
curl -s https://nordbye.it/api/health
```

## GET /api/v1

Discovery index.

The front door: a machine-readable map of every endpoint, generated from the same source as this page. Static, because the map only changes when the code does.

- Auth: public
- Caching: public, max-age=60

```sh
curl -s https://nordbye.it/api/v1
```

## GET /api/v1/openapi.json

OpenAPI 3.1 document.

The whole surface as a spec you can import into Postman, Bruno, Swagger UI or a client generator. Generated from the same endpoint definitions that render this page, so it cannot drift from the routes it describes.

- Auth: public
- Caching: public, max-age=60

```sh
curl -s https://nordbye.it/api/v1/openapi.json
```

## GET /api/v1/profile

Identity, certifications, skills and socials.

Served straight from the content modules that render the site itself, so the API and the pages can never disagree. Refreshed on each deploy.

- Auth: public
- Caching: public, max-age=60

```sh
curl -s https://nordbye.it/api/v1/profile
```

## GET /api/v1/infra

Live Talos cluster status and 30-day history.

A CronJob in the cluster writes a status ConfigMap every five minutes; it is mounted into the pod and read fresh per request. When the file is not mounted the route falls back to a baked snapshot and marks it with a source field. This is what drives the infrastructure page.

- Auth: public
- Caching: public, max-age=30

```sh
curl -s https://nordbye.it/api/v1/infra
```

## GET /api/v1/blog

Latest five posts from blog.nordbye.it.

Parses the Hugo RSS feed and revalidates hourly, which keeps the blog origin from being hit once per request. Returns 502 with the standard error envelope when the feed is unreachable.

- Auth: public
- Caching: revalidated hourly

```sh
curl -s https://nordbye.it/api/v1/blog
```

## POST /api/v1/echo

Authenticated write example.

A reference write that proves the authenticated POST seam without persisting anything. The key is compared in constant time, and writes are refused outright when no key is configured on the server. Real stateful writes build on this pattern and add a datastore.

- Auth: api key
- Caching: no-store

```sh
curl -s -X POST https://nordbye.it/api/v1/echo \
  -H 'authorization: Bearer $PORTFOLIO_API_KEY' \
  -H 'content-type: application/json' \
  -d '{"hello":"world"}'
```

## MCP server

Read-only, no key. Endpoint: https://nordbye.it/mcp (Streamable HTTP).

```sh
claude mcp add --transport http nordbye https://nordbye.it/mcp
```

Other clients: `{ "mcpServers": { "nordbye": { "type": "http", "url": "https://nordbye.it/mcp" } } }`

- `get_profile`: Morten Victor Nordbye's profile: role, summary, full work experience, education, certifications, skills and contact details.
- `list_case_studies`: List Morten's case studies with client, period, stack and summary. Optional stack filter, e.g. 'Terraform' or 'Kubernetes'.
- `get_case_study`: The full text of one case study, by slug (from list_case_studies).
- `search_blog`: Search Morten's blog posts at blog.nordbye.it by title and summary.
- `cluster_status`: Live state of the Talos Kubernetes cluster that serves nordbye.it: nodes, Argo CD sync and health, versions, certificate expiry.
