API Reference
Referencestable

API Reference

Complete REST API documentation for programmatic access to SimFusion

API Reference

Complete reference for the SimFusion REST API. Base URL: https://api.simfusion.io/v1

Authentication

All API requests require authentication using an API key:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.simfusion.io/v1/projects

Obtaining an API Key

  1. Go to Settings → API Keys in the dashboard
  2. Click "Generate New Key"
  3. Copy and store securely (keys are only shown once)

Projects

List Projects

GET /projects

Query Parameters:

ParameterTypeDescription
limitintegerMax results (default: 20, max: 100)
offsetintegerPagination offset
visibilitystringpublic, private, or all

Response:

{
  "projects": [
    {
      "id": "proj_123456",
      "name": "Signal Analysis",
      "visibility": "private",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-20T14:22:00Z",
      "owner": "user_789"
    }
  ],
  "total": 42,
  "limit": 20,
  "offset": 0
}

Create Project

POST /projects

Request Body:

{
  "name": "My New Project",
  "visibility": "private",
  "template": "blank"
}

Get Project

GET /projects/{project_id}

Update Project

PATCH /projects/{project_id}

Delete Project

DELETE /projects/{project_id}

Models

Export Model

GET /projects/{project_id}/models/{model_id}/export

Query Parameters:

ParameterDescription
formatjson, python, cpp
include_dataInclude embedded data files

Response:

{
  "format": "python",
  "code": "import numpy as np...",
  "filename": "model_export.py"
}

Run Simulation

POST /projects/{project_id}/simulate

Request Body:

{
  "duration": 10.0,
  "sample_rate": 1000,
  "parameters": {
    "frequency": 100
  }
}

Blocks

List Available Blocks

GET /blocks

Query Parameters:

ParameterDescription
categoryFilter by category
sourcebuiltin, custom

Get Block Details

GET /blocks/{block_id}

Response:

{
  "id": "block_sine_wave",
  "name": "Sine Wave",
  "category": "Sources",
  "inputs": [],
  "outputs": [
    {
      "name": "signal",
      "type": "data",
      "description": "Generated sine wave"
    }
  ],
  "parameters": [
    {
      "name": "frequency",
      "type": "float",
      "default": 1.0,
      "min": 0.0,
      "max": 100000.0,
      "unit": "Hz"
    }
  ]
}

Data

Upload Data File

POST /data/upload
Content-Type: multipart/form-data

Form Fields:

FieldDescription
fileBinary file data
project_idAssociated project
nameDisplay name

Query Data

POST /data/query

Request Body:

{
  "data_id": "data_123456",
  "start": 0,
  "end": 1000,
  "fields": ["time", "value"]
}

Workspaces (coming soon)

Collaborative workspaces are part of SimFusion's upcoming real-time collaboration release. The endpoints below are a preview and are not yet generally available.

Create Workspace

POST /workspaces

A workspace is a collaborative editing session.

Request Body:

{
  "project_id": "proj_123456",
  "name": "Team Workspace",
  "participants": ["user_111", "user_222"]
}

Get Workspace Token

GET /workspaces/{workspace_id}/token

Returns a WebSocket token for real-time collaboration.

Error Handling

Status Codes

CodeMeaning
200Success
400Bad Request
401Unauthorized
403Forbidden
404Not Found
429Rate Limited
500Server Error

Error Response Format

{
  "error": {
    "code": "invalid_parameter",
    "message": "Frequency must be positive",
    "field": "frequency"
  }
}

Rate Limits

TierRequests/MinuteBurst
Explorer6010
Professional600100
Enterprise60001000

SDKs

Official SDKs available:

  • Python: pip install simfusion

Changelog

v1.2.0 (2024-03-01)

  • Added batch simulation endpoints
  • Improved error messages
  • Added WebSocket support for workspaces

v1.1.0 (2024-02-15)

  • Added data query API
  • New block metadata endpoints
  • Rate limiting improvements

v1.0.0 (2024-01-01)

  • Initial stable release

Help us improve

Found an issue or have a suggestion?