Skip to content
On this page

Boards API

The Boards API is the HTTP interface external plugins use to push nodes, edges, and insights onto boards. The code plugin and custom integrations call it. The code plugin's /ground grounds documents through a different interface.

Note

This reference is for building an integration. To use an existing plugin, see the plugins guide.

Base URL: https://<your-instance>/api/code-plugin (cloud default: https://platform.provenmap.com/api/code-plugin)

Authentication

Every plugin endpoint requires two headers:

HTTP
X-CodePlugin-Token: <binding-token>
X-CodePlugin-Secret: <api-secret>
HeaderFormatDescription
X-CodePlugin-TokenBase64url stringEncoded workspace and binding ids; identifies the binding
X-CodePlugin-Secretpmap_cp_live_* stringBinding credential, issued at bind time, by /login, or by Generate new secret

An app's governing binding gets its credential from the code plugin's /login, which writes it to .provenmap/credentials.json. For a reference Code Plugin binding, open the board hub's Bindings card, choose Binding actions → Copy credentials on its row, and then Generate new secret. Each click issues a fresh credential and shows it once. Existing credentials keep working until you revoke them.

To get them programmatically, call:

HTTP
POST /code-plugin/workspaces/:workspaceId/bindings/:bindingId/credentials/generate

This request needs a user session, not the plugin headers. Its sibling, GET …/credentials, returns the same addressing fields with the secret masked, and never issues a credential.

Endpoints

Push elements

Pushes nodes and edges. Set mode to merge to upsert, or to replace to clear the board first.

HTTP
POST /code-plugin/push
JSON
{
  "boardSlug": "system-overview",
  "mode": "merge",
  "nodes": [
    {
      "slug": "api-gateway",
      "name": "API Gateway",
      "description": "Main entry point for all client requests",
      "primitiveType": "node",
      "archetypeName": "System",
      "parentNodeSlug": null,
      "tags": ["backend", "critical-path"]
    },
    {
      "slug": "user-service",
      "name": "User Service",
      "description": "Handles authentication and user profiles",
      "primitiveType": "node",
      "archetypeName": "System",
      "parentNodeSlug": null,
      "tags": ["backend"]
    }
  ],
  "edges": [
    {
      "sourceSlug": "api-gateway",
      "targetSlug": "user-service",
      "relation": "calls",
      "detailedDescription": "REST API calls for auth and user lookup"
    }
  ]
}

Node fields:

FieldTypeRequiredDescription
slugstringYesUnique identifier within the board (1-200 chars)
namestringYesDisplay name (2-100 chars)
descriptionstringNoBrief description, up to 500 chars
primitiveTypeenumYesnode, container, region, axis, callout, leader_annotation, text, decoration
archetypeNamestringNoElement archetype (e.g., "System", "Container", "Component")
parentNodeSlugstringNoParent node for hierarchy
layerBoardSlugstringNoChild board for drill-down
tagsstring[]NoContext tags for categorization

Edge fields:

FieldTypeRequiredDescription
sourceSlugstringYesSource node slug
targetSlugstringYesTarget node slug
relationstringNoRelationship type (e.g., "calls", "depends-on")
archetypeNamestringNoEdge archetype name
tagsstring[]NoContext tags

Get archetypes

Returns the valid archetypeName values.

HTTP
GET /code-plugin/archetypes
JSON
{
  "archetypes": [
    {
      "name": "System",
      "description": "A software system or service",
      "visualPrimitiveType": "node",
      "canContain": ["Container", "Component"]
    }
  ]
}

Get elements

Returns the board's current nodes and edges.

HTTP
GET /code-plugin/elements?boardSlug=system-overview

List boards

Lists the parent and child boards in the workspace.

HTTP
GET /code-plugin/boards
JSON
{
  "boards": [
    {
      "boardSlug": "system-overview",
      "boardName": "System Overview",
      "isChildBoard": false,
      "parentBoardSlug": null,
      "parentNodeSlug": null
    }
  ]
}

Create child boards

Creates layer boards for drill-down navigation. The call skips any board that already exists.

HTTP
POST /code-plugin/boards
JSON
{
  "boards": [
    {
      "boardSlug": "api-gateway-internals",
      "boardName": "API Gateway Internals",
      "parentBoardSlug": "system-overview",
      "parentNodeSlug": "api-gateway"
    }
  ]
}

Get insight skills

Lists the available insight skills, without their instructions and references.

HTTP
GET /code-plugin/insight-skills

One skill in full:

HTTP
GET /code-plugin/insight-skills/:slug

Push insights

Pushes the results of a plugin's analysis as insights.

HTTP
POST /code-plugin/insights
JSON
{
  "boardSlug": "system-overview",
  "rootBoardSlug": "root",
  "insightSkillSlug": "security-analysis",
  "title": "Security Analysis",
  "insights": {
    "elementInsights": [
      {
        "elementSlug": "api-gateway",
        "signal": "risk",
        "priority": "high",
        "title": "No rate limiting configured",
        "description": "API Gateway has no rate limiting, vulnerable to DDoS"
      }
    ],
    "affectedElements": [],
    "paths": [],
    "graphSuggestions": []
  },
  "content": "## Security Analysis\n\nFull markdown report..."
}

Error codes

Common error responses
StatusCodeCauseFix
400Branch mismatchThe push's branch doesn't match the binding's branchPush from the branch configured in the binding
400Repo mismatchThe push comes from a different repository than the one recorded on the bindingPush from the bound repo, or bind this repo to its own board
400Invalid source typeThe bound source is not a Code Plugin sourceAdd the source as Code Plugin (type code_plugin), not a document source
400Invalid token formatX-CodePlugin-Token isn't valid base64urlRe-copy the token from the Credentials panel
401Invalid API secretThe credential was revoked, replaced by a fresh /login, or belongs to another bindingRe-run /login. For a reference binding, generate a new secret from its Copy credentials dialog
404Binding not foundThe token references a binding that was deleted or never existedRe-create the source binding
404Board not foundboardSlug doesn't match any boardList the available boards with GET /boards
404Template not foundinsightSkillSlug doesn't match any insight skillList the available skills with GET /insight-skills

Integration checklist

Before you rely on an integration, check each item:

  • A Code Plugin source exists in the workspace Sources catalog
  • The source is bound to a target board, on the correct branch
  • You've copied the credentials (X-CodePlugin-Token + X-CodePlugin-Secret)
  • GET /archetypes returns the archetype list
  • POST /push with a test node returns success: true
  • The node appears on the board in the UI
  • GET /elements?boardSlug=... returns the pushed node
Warning

Never hardcode credentials. Store X-CodePlugin-Token and X-CodePlugin-Secret in environment variables or in a gitignored config file.

What's next