Plan Guest

API Documentation

Current endpoints, sample requests, sample responses, and plan-based behavior.

Authentication

The current implementation uses signed-in web sessions with Supabase email/password auth. API key management is still a coming feature and is not implemented yet.

Sign in through the web app first.
Requests from the web UI use the same server-side session cookies automatically.

Guest users can use the web generator with lower limits, but do not have API access. Saved Projects and Saved Job History require Pro or Enterprise. Shared History requires Enterprise.

Base URL

https://localhost:xxxx

Core Generator Endpoints

GET /auth/me

Returns the current signed-in context or Guest when no user is signed in.

Response

{
  "authenticated": false,
  "plan": "Guest"
}
POST /analyze

Validates CSV input and returns detected headers, detected types, row count, preview rows, and the effective plan.

Request

{
  "csv": "Id,FirstName,LastName\n1,Brandon,Richardson\n2,Jane,Doe"
}

Response

{
  "success": true,
  "headers": ["Id", "FirstName", "LastName"],
  "detectedTypes": ["int", "nvarchar", "nvarchar"],
  "rowCount": 2,
  "previewRows": [
    {
      "Id": "1",
      "FirstName": "Brandon",
      "LastName": "Richardson"
    },
    {
      "Id": "2",
      "FirstName": "Jane",
      "LastName": "Doe"
    }
  ],
  "currentPlan": "Free"
}
POST /generate

Generates SQL from CSV text. Successful runs are only saved to Saved Job History on Pro and Enterprise.

Request

{
  "csv": "Id,Zip,StartDate,IsActive\n1,02108,2026-03-17,true",
  "tableName": "Customers",
  "useIdentityInsert": true,
  "nullToken": "NULL",
  "batchSize": 500,
  "sqlDialect": "SqlServer",
  "columnTypeOverrides": {
    "Zip": "nvarchar"
  },
  "projectId": null,
  "sourceFileName": "customers.csv"
}

Response

SET IDENTITY_INSERT [Customers] ON;
INSERT INTO [Customers] ([Id], [Zip], [StartDate], [IsActive])
VALUES
    (1, N'02108', '2026-03-17', 1);
SET IDENTITY_INSERT [Customers] OFF;
POST /api/generate-from-bytes

API-oriented endpoint that accepts base64-encoded file bytes and returns structured JSON including generated SQL.

Request

{
  "contentBase64": "SWQsRmlyc3ROYW1lLExhc3ROYW1lCjEsQnJhbmRvbixSaWNoYXJkc29uCjIsSmFuZSxEb2U=",
  "tableName": "Customers",
  "useIdentityInsert": true,
  "nullToken": "NULL",
  "batchSize": 500,
  "sqlDialect": "SqlServer",
  "columnTypeOverrides": {
    "Id": "int"
  },
  "projectId": null,
  "sourceFileName": "customers.csv"
}

Response

{
  "success": true,
  "plan": "Pro",
  "rowCount": 2,
  "headers": ["Id", "FirstName", "LastName"],
  "detectedTypes": ["int", "nvarchar", "nvarchar"],
  "sql": "SET IDENTITY_INSERT [Customers] ON;\nINSERT INTO [Customers] ([Id], [FirstName], [LastName])\nVALUES\n    (1, N'Brandon', N'Richardson'),\n    (2, N'Jane', N'Doe');\nSET IDENTITY_INSERT [Customers] OFF;\n"
}

Project Endpoints

GET /projects

Returns saved projects for the current workspace. Available on Pro and Enterprise.

Response

[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "Customer Import",
    "tableName": "Customers",
    "sqlDialect": "SqlServer",
    "useIdentityInsert": false,
    "nullToken": "NULL",
    "batchSize": 500,
    "columnTypeOverrides": {
      "Id": "int"
    },
    "createdAt": "2026-03-24T12:00:00Z",
    "updatedAt": "2026-03-24T12:30:00Z"
  }
]
POST /projects

Creates a saved project. Available on Pro and Enterprise. Duplicate names are rejected within the same workspace, case-insensitively.

Request

{
  "name": "Customer Import",
  "tableName": "Customers",
  "sqlDialect": "SqlServer",
  "useIdentityInsert": false,
  "nullToken": "NULL",
  "batchSize": 500,
  "columnTypeOverrides": {
    "Id": "int"
  }
}

Response

{
  "message": "Project created.",
  "project": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "Customer Import"
  }
}
PUT /projects/{id}

Updates an existing saved project. Available on Pro and Enterprise.

Request

{
  "name": "Customer Import Updated",
  "tableName": "Customers",
  "sqlDialect": "SqlServer",
  "useIdentityInsert": true,
  "nullToken": "NULL",
  "batchSize": 250,
  "columnTypeOverrides": {
    "Id": "int",
    "Zip": "nvarchar"
  }
}

Response

{
  "message": "Project updated.",
  "project": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "Customer Import Updated"
  }
}
DELETE /projects/{id}

Deletes an existing saved project. Available on Pro and Enterprise.

Response

{
  "message": "Project deleted."
}

History Endpoints

GET /history?scope=my

Returns Saved Job History for the current user in the current workspace. Available on Pro and Enterprise.

Response

[
  {
    "id": "00000000-0000-0000-0000-000000000001",
    "createdBy": "00000000-0000-0000-0000-000000000010",
    "createdByEmail": "[email protected]",
    "projectId": "00000000-0000-0000-0000-000000000000",
    "projectName": "Customer Import",
    "sourceFileName": "customers.csv",
    "tableName": "Customers",
    "sqlDialect": "SqlServer",
    "rowCount": 2,
    "batchSize": 500,
    "useIdentityInsert": false,
    "nullToken": "NULL",
    "createdAt": "2026-03-24T13:00:00Z"
  }
]
GET /history?scope=workspace

Returns Shared History for the current workspace. Available on Enterprise only.

Response

[
  {
    "id": "00000000-0000-0000-0000-000000000001",
    "createdBy": "00000000-0000-0000-0000-000000000010",
    "createdByEmail": "[email protected]",
    "projectId": "00000000-0000-0000-0000-000000000000",
    "projectName": "Customer Import",
    "sourceFileName": "customers.csv",
    "tableName": "Customers",
    "sqlDialect": "SqlServer",
    "rowCount": 2,
    "batchSize": 500,
    "useIdentityInsert": false,
    "nullToken": "NULL",
    "createdAt": "2026-03-24T13:00:00Z"
  }
]
GET /history/{id}?scope=my

Returns one history item including generated SQL and saved settings.

Response

{
  "id": "00000000-0000-0000-0000-000000000001",
  "workspaceId": "00000000-0000-0000-0000-000000000020",
  "createdBy": "00000000-0000-0000-0000-000000000010",
  "createdByEmail": "[email protected]",
  "projectId": "00000000-0000-0000-0000-000000000000",
  "projectName": "Customer Import",
  "sourceFileName": "customers.csv",
  "tableName": "Customers",
  "sqlDialect": "SqlServer",
  "rowCount": 2,
  "batchSize": 500,
  "useIdentityInsert": false,
  "nullToken": "NULL",
  "columnTypeOverrides": {
    "Id": "int"
  },
  "generatedSql": "INSERT INTO [Customers] ([Id], [FirstName], [LastName]) VALUES (1, N'Brandon', N'Richardson');",
  "createdAt": "2026-03-24T13:00:00Z"
}

Auth and Session Endpoints

POST /auth/signup

Creates a new account.

Request

{
  "email": "[email protected]",
  "password": "your-password"
}

Response

{
  "authenticated": true,
  "message": "Sign-up successful.",
  "email": "[email protected]",
  "plan": "Free",
  "workspaceName": "[email protected] Workspace",
  "role": "Owner"
}
POST /auth/signin

Signs in and creates a session cookie.

Request

{
  "email": "[email protected]",
  "password": "your-password"
}

Response

{
  "authenticated": true,
  "message": "Sign-in successful.",
  "email": "[email protected]",
  "plan": "Free",
  "workspaceName": "[email protected] Workspace",
  "role": "Owner"
}
POST /auth/signout

Signs out and clears the session cookie.

Response

{
  "message": "Signed out.",
  "plan": "Guest"
}
POST /account/dev-set-plan

Development helper to switch workspace plan. Guest is not a workspace plan and cannot be set here.

Request

{
  "plan": "Pro"
}

Response

{
  "authenticated": true,
  "email": "[email protected]",
  "plan": "Pro",
  "workspaceName": "[email protected] Workspace",
  "role": "Owner"
}

Notes