Last updated June 25, 2026
Boards API
The Boards API lets external plugins push structured architecture data — nodes, edges, and insights — directly to your workboards. It's how the ContextDX plugins (Cdx Code and Cdx Work), the VS Code extension, and custom integrations feed architecture into your boards.
This is the API reference for building integrations. If you just want to use an existing plugin, see the ContextDX Plugins.
Base URL: https://<your-instance>/code-plugin (cloud default: https://api.contextdx.com/code-plugin)
Authentication
All plugin endpoints require two headers:
X-CodePlugin-Token: <binding-token>
X-CodePlugin-Secret: <api-secret>| Header | Format | Description |
|---|---|---|
X-CodePlugin-Token | Base64url string | Encoded orgId:bindingId — identifies the workspace and binding |
X-CodePlugin-Secret | ck_cp_live_* string | API secret generated when the Code Plugin source was created |
Get credentials from the UI: Sources → your Code Plugin source → Binding → Copy Credentials.
Or programmatically:
GET /code-plugin/workspaces/:workspaceId/bindings/:bindingId/credentialsThis requires a user session (not plugin headers).
Endpoints
Push Elements
Push nodes and edges to a workboard. Supports merge (upsert) or replace (clear then insert) modes.
POST /code-plugin/push{
"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:
| Field | Type | Required | Description |
|---|---|---|---|
slug | string | Yes | Unique identifier within the board (1-200 chars) |
name | string | Yes | Display name (2-100 chars) |
description | string | No | Brief description (max 500 chars) |
primitiveType | enum | Yes | node, container, region, axis, callout, leader_annotation, text |
archetypeName | string | No | Element archetype (e.g., "System", "Container", "Component") |
parentNodeSlug | string | No | Parent node for hierarchy |
layerBoardSlug | string | No | Child board for drill-down |
tags | string[] | No | Context tags for categorization |
Edge fields:
| Field | Type | Required | Description |
|---|---|---|---|
sourceSlug | string | Yes | Source node slug |
targetSlug | string | Yes | Target node slug |
relation | string | No | Relationship type (e.g., "calls", "depends-on") |
archetypeName | string | No | Edge archetype name |
tags | string[] | No | Context tags |
Get Archetypes
Retrieve available element archetypes so your plugin uses valid archetypeName values.
GET /code-plugin/archetypes{
"archetypes": [
{
"name": "System",
"description": "A software system or service",
"visualPrimitiveType": "node",
"canContain": ["Container", "Component"]
}
]
}Get Elements
Retrieve current nodes and edges from a board — useful for incremental updates.
GET /code-plugin/elements?boardSlug=system-overviewList Boards
Discover all boards in the workspace (parent and child).
GET /code-plugin/boards{
"boards": [
{
"boardSlug": "system-overview",
"boardName": "System Overview",
"isChildBoard": false,
"parentBoardSlug": null,
"parentNodeSlug": null
}
]
}Create Child Boards
Create layer boards for drill-down navigation. Idempotent — existing boards are skipped.
POST /code-plugin/boards{
"boards": [
{
"boardSlug": "api-gateway-internals",
"boardName": "API Gateway Internals",
"parentBoardSlug": "system-overview",
"parentNodeSlug": "api-gateway"
}
]
}Get Insight Skills
List available insight templates (lightweight — no instructions or references).
GET /code-plugin/insight-skillsGet full template with instructions for execution:
GET /code-plugin/insight-skills/:slugPush Insights
Push analysis results from a plugin to a board.
POST /code-plugin/insights{
"boardSlug": "system-overview",
"rootBoardSlug": "root",
"insightSkillSlug": "security-analysis",
"title": "Security Analysis - April 2026",
"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
| Status | Code | Cause | Fix |
|---|---|---|---|
400 | Branch mismatch | Push branch doesn't match binding config | Use the branch configured in the binding |
400 | Invalid source type | Source isn't board_builder | Create a board_builder source, not a regular one |
400 | Invalid token format | X-CodePlugin-Token isn't valid base64url | Re-copy the token from the Credentials panel |
401 | Invalid API secret | X-CodePlugin-Secret doesn't match | Regenerate the secret from the source settings |
404 | Binding not found | Token references a deleted or non-existent binding | Re-create the source binding |
404 | Board not found | boardSlug doesn't match any board | Check available boards via GET /boards |
404 | Template not found | insightSkillSlug doesn't match | Check available skills via GET /insight-skills |
Integration Checklist
Verify your integration end-to-end:
-
board_buildersource created in the workspace Sources catalog - Source is bound to a target board with the correct branch
- Credentials copied (
X-CodePlugin-Token+X-CodePlugin-Secret) -
GET /archetypesreturns valid archetype list -
POST /pushwith a test node returnssuccess: true - Node appears on the board in the UI
-
GET /elements?boardSlug=...returns the pushed node
Never hardcode credentials. Store X-CodePlugin-Token and X-CodePlugin-Secret in environment variables or a config file that's gitignored.
What's Next
Connecting Sources
Understand how Code Plugin sources fit into the broader source model.
Insight Skills
Learn about the insight templates your plugin can push results for.
ContextDX Plugins
See a working Code Plugin integration in action.
Permissions & Access
Understand who can see and edit the data your plugin pushes.

