Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.nometria.com/llms.txt

Use this file to discover all available pages before exploring further.

The migrations API lets you programmatically create migrations (connect an app source) and check their status.

List migrations

GET /v1/migrations
Returns all migrations in your account. Query parameters:
ParameterTypeDescription
limitintegerNumber of results (default: 20, max: 100)
cursorstringPagination cursor from previous response
statusstringFilter by status: pending, processing, complete, failed
Example request:
curl https://api.nometria.com/v1/migrations \
  -H "Authorization: Bearer <your-api-key>"
Example response:
{
  "data": [
    {
      "id": "mig_abc123",
      "project_id": "proj_xyz789",
      "source": "github",
      "repo": "your-org/your-app",
      "branch": "main",
      "framework": "react-vite",
      "status": "complete",
      "created_at": "2025-01-15T10:30:00Z",
      "completed_at": "2025-01-15T10:35:00Z"
    }
  ],
  "pagination": {
    "has_more": false,
    "next_cursor": null
  }
}

Get migration

GET /v1/migrations/{migration_id}
Returns a single migration by ID. Example request:
curl https://api.nometria.com/v1/migrations/mig_abc123 \
  -H "Authorization: Bearer <your-api-key>"
Example response:
{
  "data": {
    "id": "mig_abc123",
    "project_id": "proj_xyz789",
    "source": "github",
    "repo": "your-org/your-app",
    "branch": "main",
    "framework": "react-vite",
    "database": {
      "type": "supabase",
      "project_id": "xxxxxxxxxxxx"
    },
    "status": "complete",
    "created_at": "2025-01-15T10:30:00Z",
    "completed_at": "2025-01-15T10:35:00Z",
    "logs_url": "https://api.nometria.com/v1/migrations/mig_abc123/logs"
  }
}

Create migration

POST /v1/migrations
Start a new migration from a GitHub repository. Request body:
FieldTypeRequiredDescription
sourcestringYesConnection type: github or zip
repostringYes (github)GitHub repo in owner/repo format
branchstringNoBranch to deploy from (default: main)
frameworkstringNoOverride framework detection: react-vite, nextjs, node-express, python-fastapi
env_varsobjectNoKey-value pairs of environment variables
databaseobjectNoDatabase configuration (see below)
domainstringNoCustom domain
regionstringNoAWS region (default: us-east-1)
Database object:
{
  "type": "supabase",           // "supabase" or "appwrite"
  "action": "create",          // "create" (new project) or "connect" (existing)
  "url": "https://xxx.supabase.co",     // Required if action is "connect"
  "service_key": "eyJ..."       // Required if action is "connect"
}
Example request:
curl -X POST https://api.nometria.com/v1/migrations \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "github",
    "repo": "your-org/your-app",
    "branch": "main",
    "env_vars": {
      "NEXT_PUBLIC_SUPABASE_URL": "https://xxx.supabase.co",
      "NEXT_PUBLIC_SUPABASE_ANON_KEY": "eyJ...",
      "STRIPE_SECRET_KEY": "sk_live_..."
    },
    "database": {
      "type": "supabase",
      "action": "create"
    },
    "domain": "app.yourcompany.com",
    "region": "us-east-1"
  }'
Example response:
{
  "data": {
    "id": "mig_newone123",
    "status": "processing",
    "project_id": "proj_newproject",
    "created_at": "2025-01-15T12:00:00Z"
  }
}
The migration runs asynchronously. Poll GET /v1/migrations/{id} to check status, or use webhooks.

Migration logs

GET /v1/migrations/{migration_id}/logs
Stream build and migration logs. Example request:
curl https://api.nometria.com/v1/migrations/mig_abc123/logs \
  -H "Authorization: Bearer <your-api-key>"
Example response:
{
  "data": {
    "logs": [
      { "timestamp": "2025-01-15T10:30:01Z", "level": "info", "message": "Starting migration..." },
      { "timestamp": "2025-01-15T10:30:05Z", "level": "info", "message": "Framework detected: React + Vite" },
      { "timestamp": "2025-01-15T10:30:10Z", "level": "info", "message": "Provisioning EC2 instance in us-east-1..." },
      { "timestamp": "2025-01-15T10:31:45Z", "level": "info", "message": "Instance ready. Running build..." },
      { "timestamp": "2025-01-15T10:33:20Z", "level": "info", "message": "Build complete. Starting app..." },
      { "timestamp": "2025-01-15T10:34:00Z", "level": "success", "message": "App healthy. Migration complete." }
    ]
  }
}

Migration statuses

StatusDescription
pendingMigration is queued
processingInfrastructure being provisioned, app being built
completeMigration finished, app is live
failedMigration failed — check logs for details