Quickstart
From a first request to an AI agent working in your projects, in four steps.
Everything below runs against https://api.field-viewer.com. The REST API, the SDK and the MCP server are three views of the same operations, so whatever you can do in one you can do in the others.
Before you start: an API token
In Field-Viewer, open Settings → Developers → New API token. Give it a name (for example ERP sync), pick an access level and an expiry, and copy the secret: it is shown only once. The token is bound to one organisation.
1. curl
# 1. Check that the API answers (no token needed).
curl https://api.field-viewer.com/v1/status
# 2. Who is calling? Every other request needs your token.
export FV_TOKEN="fvt_…" # Settings → Developers → New API token
curl -H "Authorization: Bearer $FV_TOKEN" https://api.field-viewer.com/v1/context
# 3. List the projects in your organisation (organizationId from step 2).
export ORG_ID="org_…"
curl -H "Authorization: Bearer $FV_TOKEN" \
"https://api.field-viewer.com/v1/organizations/$ORG_ID/projects?limit=5"
When a request fails you get an RFC 9457 problem with a stable code. Every code has a page in the error catalogue:
curl -X POST -H "Authorization: Bearer $FV_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"name": ""}' \
"https://api.field-viewer.com/v1/organizations/$ORG_ID/projects"
# → 422 application/problem+json, code "validation.failed",
# errors[0].pointer "/name", plus a requestId to quote to support.
2. TypeScript SDK
The typed client @fieldviewer/sdk calls every operation by its operationId with one flat input object, and throws FvApiError (with the problem's code) when the API answers with an error.
import { createClient } from "@fieldviewer/sdk";
const fv = createClient({
baseUrl: "https://api.field-viewer.com",
getToken: () => process.env.FV_TOKEN,
});
// Who is calling, and which organisation is this token bound to?
const context = await fv.call("getApiContext", {});
console.log(context.principal, context.scopes);
// The first page of projects in that organisation.
const page = await fv.call("listProjects", {
organizationId: context.organizationId ?? "",
limit: 5,
});
for (const project of page.data) console.log(project.id, project.name);
console.log("next page cursor:", page.nextCursor);
3. Claude Code
Add the Field-Viewer MCP server, then sign in once in your browser. You choose the organisation and the access level on the consent screen.
claude mcp add --transport http fieldviewer https://api.field-viewer.com/mcp
# Then, inside Claude Code, run /mcp and pick "fieldviewer" to sign in.
For scripts and CI, where no browser is available, pass your API token instead:
claude mcp add --transport http fieldviewer https://api.field-viewer.com/mcp \
--header "Authorization: Bearer $FV_TOKEN"
4. claude.ai connector
- In claude.ai, open Settings → Connectors → Add custom connector.
- Name it Field-Viewer and enter
https://api.field-viewer.com/mcpas the URL. - Choose Connect, sign in to Field-Viewer, pick the organisation and the access level, and approve.
- Ask Claude, for example, "Which projects do I have in Field-Viewer?"
You can revoke the connection at any time under Settings → Connected apps in Field-Viewer.
Next
- API reference: every operation, with a try-it panel.
- Error catalogue and event catalogue.
- OpenAPI 3.1 document and llms.txt for tools and agents.