Docs
API Overview

API Overview

Lamatic exposes a GraphQL API as the primary way to run Flows from your app, CLI, or backend. This page explains why we use GraphQL, how to authenticate, and where to find the full reference.

Why GraphQL?

Most developer tools use REST (POST /api/v1/flows/{id}/execute). Lamatic uses GraphQL because:

  • Dynamic schemas — The shape of inputs and outputs depends on how your Flow is configured. GraphQL lets you request exactly the fields you need and matches the response to your Flow's schema.
  • Single endpoint — One URL per project; the operation and variables are in the request body.
  • Strong typing — Queries and responses align with your Flow's input/output definitions.

If you're used to REST, you can think of "execute a Flow" as a single mutation: executeWorkflow(workflowId, payload).

Quick orientation

You want to…Go to
Get an API keyAPI Keys
Call a Flow from codeIntegration Guide
See GraphQL operationsGraphQL
Use the SDK (JS/React/Go)SDK
Webhooks / WidgetsWebhooks, Widgets

Authentication

All API requests use Bearer token authentication with an API key:

  • Header: Authorization: Bearer <YOUR_API_KEY>
  • Project scope: x-project-id: <PROJECT_ID>

Create and copy your API key from Studio → Settings → API Keys. Never commit the key; use environment variables or a secrets manager.

Minimal example

Prerequisites: <YOUR_API_KEY>, <PROJECT_ID>, <FLOW_ID>, and <PROJECT_ENDPOINT> from Studio (project settings and the Flow's Connect/API panel).

curl -X POST "<PROJECT_ENDPOINT>" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -H "x-project-id: <PROJECT_ID>" \
  -d '{
    "query": "query ExecuteWorkflow($workflowId: String!, $payload: JSON) { executeWorkflow(workflowId: $workflowId, payload: $payload) { status result } }",
    "variables": {
      "workflowId": "<FLOW_ID>",
      "payload": { "question": "Hello" }
    }
  }'

The response includes status (e.g. success) and result (your Flow's output as configured in the GraphQL Response node).

Next steps

Was this page useful?

Questions? We're here to help

Subscribe to updates