API REFERENCE

ThruWire API Service

ThruWire is a hybrid intelligence platform for building versioned, executable reasoning graphs. The API enables programmatic access to projects, versions, blocks, compilation workflows, and agent execution streams.

Auth

post/api/v1/loginAuthenticated

Login

Verify a Thruwire auth token. Obtain an ID token from auth.thruwire.ai, then pass it in the request body.

Parameters

No parameters.

Request Fieldsapplication/json
id_tokenstring

Thruwire auth token

Request & Responses

Bodyapplication/json
Request Bodyapplication/json
{
  "id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Responses
Body200application/json
{
  "user_id": "user_123",
  "default_project_id": "b3f1c6a8-7f4a-4e3d-9b8b-2e5f9c0a1234",
  "email": "user@example.com"
}

Blocks

post/api/v1/projects/{project_id}/blocks/{block_id}/executeAuthenticated

Exectute Block

Execute a compiled block and stream results via server-sent events.

Parameters

project_idpathRequiredstring
block_idpathRequiredstring
Request Fieldsapplication/json
contextobjectnullable
inputsobjectnullable

Request & Responses

Bodyapplication/json
Request Bodyapplication/json
{
  "context": {
    "prompt": "Do the thing"
  },
  "inputs": {
    "foo": "bar"
  }
}
Responses
Body200text/event-stream
controlchannel
SSE
{
  "channel": "control",
  "data": {
    "type": "run_started"
  }
}
narrativechannel
SSE
{
  "channel": "narrative",
  "data": {
    "event": "start",
    "narrative_id": "narrative-1",
    "block_id": "overview",
    "step_id": "step-1"
  }
}
narrativechannel
SSE
{
  "channel": "narrative",
  "data": {
    "event": "delta",
    "narrative_id": "narrative-1",
    "delta": "Thinking through the next step."
  }
}
narrativechannel
SSE
{
  "channel": "narrative",
  "data": {
    "event": "end",
    "narrative_id": "narrative-1"
  }
}
artifactchannel
SSE
{
  "channel": "artifact",
  "data": {
    "event": "start",
    "id": "artifact-1"
  }
}
artifactchannel
SSE
{
  "channel": "artifact",
  "data": {
    "event": "delta",
    "id": "artifact-1",
    "content": "Hello"
  }
}
artifactchannel
SSE
{
  "channel": "artifact",
  "data": {
    "event": "end",
    "id": "artifact-1"
  }
}
resultchannel
SSE
{
  "channel": "result",
  "data": {
    "event": "delta",
    "content": "Hel"
  }
}
resultchannel
SSE
{
  "channel": "result",
  "data": {
    "event": "delta",
    "content": "lo"
  }
}
resultchannel
SSE
{
  "channel": "result",
  "data": {
    "event": "done",
    "content": {
      "text": "Hello"
    }
  }
}
error
SSE
{"error":{"code":"EXECUTION_ERROR","message":"Boom","details":{}}}
controlchannel
SSE
{
  "channel": "control",
  "data": {
    "type": "run_completed"
  }
}
post/api/v1/projects/{project_id}/blocks/{block_id}/structureAuthenticated

Structure Block

Generate or refine block structure and stream results via server-sent events.

Parameters

project_idpathRequiredstring
block_idpathRequiredstring
Request Fieldsapplication/json
contextobjectnullable
inputsobjectnullable
profilestringnullable

Scaffolding profile. Use build_foundation, refine_structure, or explore_adjacent.

Request & Responses

Bodyapplication/json
Request Bodyapplication/json
{
  "profile": "refine_structure",
  "inputs": {
    "topic": "demo"
  }
}
Responses
Body200text/event-stream
controlchannel
SSE
{
  "channel": "control",
  "data": {
    "type": "structure_started"
  }
}
narrativechannel
SSE
{
  "channel": "narrative",
  "data": {
    "event": "start",
    "narrative_id": "narrative-1",
    "block_id": "overview",
    "step_id": "step-1"
  }
}
narrativechannel
SSE
{
  "channel": "narrative",
  "data": {
    "event": "delta",
    "narrative_id": "narrative-1",
    "delta": "Planning structure adjustments."
  }
}
narrativechannel
SSE
{
  "channel": "narrative",
  "data": {
    "event": "end",
    "narrative_id": "narrative-1"
  }
}
actionchannel
SSE
{
  "channel": "action",
  "data": {
    "action_id": "action-1",
    "type": "create_block",
    "block_path": "new-notebook",
    "payload": {
      "name": "New Notebook",
      "goals": [
        "Summarize the topic"
      ],
      "context": {
        "topic": "demo"
      },
      "steps": [
        {
          "text": "Draft outline"
        },
        {
          "text": "Write summary"
        }
      ],
      "ancestors": []
    }
  }
}
actionchannel
SSE
{
  "channel": "action",
  "data": {
    "action_id": "action-2",
    "type": "update_block",
    "block_path": "overview",
    "payload": {
      "name": "Overview",
      "goals": [
        "Refine structure"
      ],
      "context": {},
      "steps": [
        {
          "text": "Update intro"
        }
      ],
      "ancestors": []
    }
  }
}
actionchannel
SSE
{
  "channel": "action",
  "data": {
    "action_id": "action-3",
    "type": "rename_block",
    "block_path": "introduction",
    "payload": {
      "old_path": "overview",
      "new_path": "introduction",
      "new_name": "Introduction"
    }
  }
}
actionchannel
SSE
{
  "channel": "action",
  "data": {
    "action_id": "action-4",
    "type": "create_block",
    "block_path": "static-checklist",
    "payload": {
      "name": "Static Checklist",
      "goals": [],
      "context": {
        "source": "static"
      },
      "steps": [
        {
          "text": "Capture must-have items"
        }
      ],
      "ancestors": []
    }
  }
}
actionchannel
SSE
{
  "channel": "action",
  "data": {
    "action_id": "action-5",
    "type": "update_block",
    "block_path": "static-checklist",
    "payload": {
      "name": "Static Checklist",
      "goals": [],
      "context": {
        "source": "static",
        "revision": "bump"
      },
      "steps": [
        {
          "text": "Refresh checklist"
        }
      ],
      "ancestors": []
    }
  }
}
error
SSE
{"error":{"code":"EXECUTION_ERROR","message":"Boom","details":{}}}
controlchannel
SSE
{
  "channel": "control",
  "data": {
    "type": "structure_completed"
  }
}
get/api/v1/projects/{project_id}/versions/{version_id}/blocksAuthenticated

List Blocks

List blocks for a version and state.

Parameters

project_idpathRequiredstring
version_idpathRequiredstring
statequeryraw | compiled
limitqueryinteger
offsetqueryinteger

Request & Responses

BodyNone
Responses
Body200application/json
{
  "items": [
    {
      "id": "overview",
      "state": "raw",
      "updated_at": "2026-02-23T12:00:00Z",
      "size": 120
    },
    {
      "id": "overview",
      "state": "compiled",
      "updated_at": "2026-02-23T12:05:00Z",
      "size": 200
    }
  ],
  "pagination": {
    "total": 2,
    "limit": 50,
    "offset": 0,
    "count": 2
  }
}
get/api/v1/projects/{project_id}/versions/{version_id}/blocks/{block_id}Authenticated

Get Block

Get a block for a version and state.

Parameters

project_idpathRequiredstring
version_idpathRequiredstring
block_idpathRequiredstring
statequery

Request & Responses

BodyNone
Responses
Body200application/json
{
  "metadata": {
    "id": "overview",
    "state": "raw",
    "updated_at": "2026-02-23T12:00:00Z",
    "size": 120
  },
  "block": {
    "name": "Overview",
    "body": "# Hello"
  }
}
put/api/v1/projects/{project_id}/versions/latest/blocks/{block_id}Authenticated

Write Block

Write a raw block to the working set.

Parameters

project_idpathRequiredstring
block_idpathRequiredstringBlock identifier (lowercase, hyphen-separated)
X-Expected-Revisionheader
Request Fieldsapplication/json
blockobject

Structured block definition as JSON

expected_revisionintegernullable

Request & Responses

Bodyapplication/json
Request Bodyapplication/json
{
  "block": {
    "name": "Overview",
    "body": "# Hello"
  },
  "expected_revision": 12
}
Responses
Body200application/json
{
  "metadata": {
    "id": "overview",
    "state": "raw",
    "updated_at": "2026-02-23T12:00:00Z",
    "size": 120
  }
}
delete/api/v1/projects/{project_id}/versions/latest/blocks/{block_id}Authenticated

Delete Block

Delete a raw block from the working set.

Parameters

project_idpathRequiredstring
block_idpathRequiredstring
X-Expected-Revisionheader
Request Fieldsapplication/json
expected_revisionintegernullable

Request & Responses

Bodyapplication/json
Request Bodyapplication/json
{
  "expected_revision": 12
}
Responses
Body200application/json
{
  "status": "deleted"
}
post/api/v1/projects/{project_id}/versions/latest/blocks/renameAuthenticated

Rename Block

Rename a raw block in the working set.

Parameters

project_idpathRequiredstring
X-Expected-Revisionheader
Request Fieldsapplication/json
old_idstring
new_idstring
expected_revisionintegernullable

Request & Responses

Bodyapplication/json
Request Bodyapplication/json
{
  "old_id": "overview",
  "new_id": "introduction",
  "expected_revision": 12
}
Responses
Body200application/json
{
  "metadata": {
    "id": "introduction",
    "state": "raw",
    "updated_at": "2026-02-23T12:00:00Z",
    "size": 120
  }
}

Compile

post/api/v1/projects/{project_id}/compileAuthenticated

Compile

Compile a project and stream results via server-sent events.

Parameters

rebuild_onlyquerybooleanIf true, rebuild DAG and block definitions without creating a new version. Requires version_id.
version_idqueryVersion ID to rebuild. Required if rebuild_only=true.

Request & Responses

BodyNone
Responses
Body200text/event-stream
data
SSE
{
  "project_id": "b3f1c6a8-7f4a-4e3d-9b8b-2e5f9c0a1234",
  "message": "Compile started"
}
error
SSE
{"error":{"code":"COMPILE_ERROR","message":"Boom","details":{}}}
data
SSE
{
  "version_id": "1b2c3d4e-1111-2222-3333-444455556666"
}

Projects

get/api/v1/projectsAuthenticated

List Projects

Parameters

limitqueryinteger
offsetqueryinteger

Request & Responses

BodyNone
Responses
Body200application/json

No example provided for this response in openapi.yaml.

post/api/v1/projectsAuthenticated

Create Project

Parameters

No parameters.

Request Fieldsapplication/json
namestringnullable

Request & Responses

Bodyapplication/json
Request Bodyapplication/json

No request example provided for this body in openapi.yaml.

Responses
Body201application/json

No example provided for this response in openapi.yaml.

put/api/v1/projects/{project_id}Authenticated

Update Project

Update a project (currently only supports renaming).

Parameters

project_idpathRequiredstring
Request Fieldsapplication/json
namestring

Request & Responses

Bodyapplication/json
Request Bodyapplication/json
{
  "name": "Renamed Project"
}
Responses
Body200application/json
{
  "id": "b3f1c6a8-7f4a-4e3d-9b8b-2e5f9c0a1234",
  "name": "Renamed Project",
  "created_at": "2026-02-23T12:00:00Z",
  "updated_at": "2026-02-23T12:00:00Z",
  "status": "active"
}
get/api/v1/projects/{project_id}Authenticated

Get Project

Return project metadata.

Parameters

project_idpathRequiredstring

Request & Responses

BodyNone
Responses
Body200application/json
{
  "id": "b3f1c6a8-7f4a-4e3d-9b8b-2e5f9c0a1234",
  "name": "Demo Project",
  "created_at": "2026-02-23T12:00:00Z",
  "updated_at": "2026-02-23T12:00:00Z",
  "status": "active"
}
delete/api/v1/projects/{project_id}Authenticated

Delete Project

Delete a project and all its associated data (versions, blocks, etc.).

Parameters

project_idpathRequiredstring

Request & Responses

BodyNone
Responses
Body204

No example provided for this response in openapi.yaml.

post/api/v1/projects/{project_id}/membersAuthenticated

Add Project Member

Parameters

project_idpathRequiredstring
Request Fieldsapplication/json
emailstring

Request & Responses

Bodyapplication/json
Request Bodyapplication/json
{
  "email": "member@example.com"
}
Responses
Body200application/json
{
  "status": "ok"
}
get/api/v1/projects/{project_id}/membersAuthenticated

List Project Members

Parameters

project_idpathRequiredstring

Request & Responses

BodyNone
Responses
Body200application/json
[
  {
    "email": "member@example.com"
  }
]
delete/api/v1/projects/{project_id}/membersAuthenticated

Remove Project Member

Parameters

project_idpathRequiredstring
Request Fieldsapplication/json
emailstring

Request & Responses

Bodyapplication/json
Request Bodyapplication/json
{
  "email": "member@example.com"
}
Responses
Body200application/json
{
  "status": "ok"
}
get/api/v1/projects/{project_id}/versionsAuthenticated

List Versions

Parameters

project_idpathRequiredstring
limitqueryinteger
offsetqueryinteger

Request & Responses

BodyNone
Responses
Body200application/json
{
  "items": [
    {
      "id": "1b2c3d4e-1111-2222-3333-444455556666",
      "name": "v3",
      "status": "compiled",
      "created_at": "2026-02-23T12:00:00Z",
      "completed_at": "2026-02-23T12:10:00Z"
    }
  ],
  "pagination": {
    "total": 2,
    "limit": 50,
    "offset": 0,
    "count": 2
  }
}
get/api/v1/projects/{project_id}/versions/{version_id}Authenticated

Get Version

Parameters

project_idpathRequiredstring
version_idpathRequiredstring

Request & Responses

BodyNone
Responses
Body200application/json
{
  "id": "1b2c3d4e-1111-2222-3333-444455556666",
  "name": "v3",
  "status": "compiled",
  "created_at": "2026-02-23T12:00:00Z",
  "completed_at": "2026-02-23T12:10:00Z"
}

Schemas

get/api/v1/schemasAuthenticated

List Schemas

Parameters

No parameters.

Request & Responses

BodyNone
Responses
Body200application/json
{
  "schemas": [
    {
      "schema": {
        "name": "block",
        "version": "1.0.0"
      },
      "runtimes": {},
      "fields": {},
      "ui": {}
    }
  ]
}
get/api/v1/schemas/{schema_ref}Authenticated

Get Schema

Parameters

schema_refpathRequiredstring

Request & Responses

BodyNone
Responses
Body200application/json
{
  "schema": {
    "name": "block",
    "version": "1.0.0"
  },
  "runtimes": {},
  "fields": {},
  "ui": {}
}

User

get/api/v1/user/current-projectAuthenticated

Get Current Project

Parameters

No parameters.

Request & Responses

BodyNone
Responses
Body200application/json

No example provided for this response in openapi.yaml.

put/api/v1/user/current-projectAuthenticated

Set Current Project

Parameters

No parameters.

Request Fieldsapplication/json
project_idstring

Request & Responses

Bodyapplication/json
Request Bodyapplication/json

No request example provided for this body in openapi.yaml.

Responses
Body200application/json

No example provided for this response in openapi.yaml.