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 deployments API lets you trigger production deployments, check their status, and roll back to previous versions.

List deployments

GET /v1/deployments
Returns deployments across all your projects, or for a specific project. Query parameters:
ParameterTypeDescription
project_idstringFilter by project
limitintegerNumber of results (default: 20, max: 100)
cursorstringPagination cursor
statusstringFilter: queued, building, deploying, live, failed, rolled_back
Example request:
curl "https://api.nometria.com/v1/deployments?project_id=proj_abc123" \
  -H "Authorization: Bearer <your-api-key>"
Example response:
{
  "data": [
    {
      "id": "dep_latest",
      "project_id": "proj_abc123",
      "commit_sha": "a1b2c3d",
      "commit_message": "feat: add payment flow",
      "branch": "main",
      "status": "live",
      "url": "https://app.yourcompany.com",
      "created_at": "2025-01-15T14:00:00Z",
      "live_at": "2025-01-15T14:04:30Z"
    },
    {
      "id": "dep_prev",
      "project_id": "proj_abc123",
      "commit_sha": "e4f5g6h",
      "commit_message": "fix: auth redirect",
      "branch": "main",
      "status": "rolled_back",
      "url": "https://app.yourcompany.com",
      "created_at": "2025-01-14T09:00:00Z",
      "live_at": "2025-01-14T09:04:00Z"
    }
  ],
  "pagination": {
    "has_more": false,
    "next_cursor": null
  }
}

Get deployment

GET /v1/deployments/{deployment_id}
Returns a single deployment with full details. Example response:
{
  "data": {
    "id": "dep_latest",
    "project_id": "proj_abc123",
    "commit_sha": "a1b2c3d",
    "commit_message": "feat: add payment flow",
    "branch": "main",
    "status": "live",
    "url": "https://app.yourcompany.com",
    "preview_url": null,
    "region": "us-east-1",
    "instance_type": "t3.small",
    "build_duration_seconds": 87,
    "created_at": "2025-01-15T14:00:00Z",
    "live_at": "2025-01-15T14:04:30Z",
    "logs_url": "https://api.nometria.com/v1/deployments/dep_latest/logs"
  }
}

Trigger deployment

POST /v1/deployments
Manually trigger a deployment for a project. Deploys the current HEAD of the project’s connected branch. Request body:
FieldTypeRequiredDescription
project_idstringYesProject to deploy
commit_shastringNoSpecific commit to deploy (default: latest on branch)
env_varsobjectNoOverride environment variables for this deploy
Example request:
curl -X POST https://api.nometria.com/v1/deployments \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "proj_abc123"
  }'
Example response:
{
  "data": {
    "id": "dep_triggered123",
    "project_id": "proj_abc123",
    "status": "queued",
    "created_at": "2025-01-15T15:00:00Z"
  }
}
The deployment runs asynchronously. Poll GET /v1/deployments/{id} for status.

Rollback deployment

POST /v1/deployments/{deployment_id}/rollback
Roll back production to a previous deployment. The target deployment must have status: live or status: rolled_back. Example request:
curl -X POST https://api.nometria.com/v1/deployments/dep_prev/rollback \
  -H "Authorization: Bearer <your-api-key>"
Example response:
{
  "data": {
    "id": "dep_rollback789",
    "project_id": "proj_abc123",
    "rolled_back_from": "dep_latest",
    "rolled_back_to": "dep_prev",
    "status": "queued",
    "created_at": "2025-01-15T15:10:00Z"
  }
}
Nometria redeploys the exact code and environment variables from the target deployment — zero code changes needed.

Deployment logs

GET /v1/deployments/{deployment_id}/logs
Returns build and deploy logs for a deployment. Example request:
curl https://api.nometria.com/v1/deployments/dep_latest/logs \
  -H "Authorization: Bearer <your-api-key>"
Example response:
{
  "data": {
    "logs": [
      { "timestamp": "2025-01-15T14:00:01Z", "level": "info", "message": "Pulling latest commit a1b2c3d..." },
      { "timestamp": "2025-01-15T14:00:10Z", "level": "info", "message": "Building Docker image..." },
      { "timestamp": "2025-01-15T14:01:30Z", "level": "info", "message": "npm install complete (147 packages)" },
      { "timestamp": "2025-01-15T14:02:45Z", "level": "info", "message": "npm run build complete" },
      { "timestamp": "2025-01-15T14:03:00Z", "level": "info", "message": "Starting container..." },
      { "timestamp": "2025-01-15T14:04:15Z", "level": "info", "message": "Health check passed" },
      { "timestamp": "2025-01-15T14:04:30Z", "level": "success", "message": "Deployment live at https://app.yourcompany.com" }
    ]
  }
}

Deployment statuses

StatusDescription
queuedDeployment is in the queue
buildingDocker image is being built
deployingContainer is starting, health check running
liveDeployment is serving production traffic
failedDeployment failed — check logs
rolled_backDeployment was superseded by a rollback

CI/CD integration

Use the API in your GitHub Actions workflow to trigger deployments after tests pass:
name: Deploy to Production

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger Nometria deployment
        run: |
          curl -X POST https://api.nometria.com/v1/deployments \
            -H "Authorization: Bearer ${{ secrets.Nometria_API_KEY }}" \
            -H "Content-Type: application/json" \
            -d '{"project_id": "${{ secrets.Nometria_PROJECT_ID }}"}'
Store Nometria_API_KEY and Nometria_PROJECT_ID as GitHub repository secrets.