BlameTrail
API Reference

Deploy Ingest API

API reference for the deploy ingest endpoint -- send deploy events from your CI/CD pipeline to BlameTrail.

The deploy ingest endpoint receives deploy events from your CI/CD pipeline and records them in BlameTrail for suspect scoring, commit enrichment, and incident correlation.

Endpoint

POST /api/ingest/deploy

Authentication

Authenticate requests using the X-Deploy-Token header. Each token is scoped to a specific service and tenant.

curl -X POST https://blametrail.com/api/ingest/deploy \
  -H "Content-Type: application/json" \
  -H "X-Deploy-Token: dpl_abc123def456" \
  -d '{ "commit_sha": "a1b2c3d" }'

Tokens are generated when you create a service. The plaintext token is shown once -- store it as a secret in your CI/CD system. You can rotate a token from the service detail page, which immediately invalidates the previous token.

Request body

FieldTypeRequiredConstraintsDescription
commit_shastringYesMax 255 charactersThe Git commit SHA that was deployed.
commit_messagestringNo--The head commit message.
branchstringNo--The branch that was deployed.
deployed_bystringNo--Who triggered the deploy.
environmentstringNo--Target environment (e.g., production, staging).
versionstringNo--A version string or tag.
descriptionstringNo--Free-text description of the deploy.
urlstringNoMax 2048 charactersLink to the deploy in your CI/CD system.
commitsarrayNoMax 100 itemsArray of commits included in the deploy.

Commits array

Each item in the commits array has the following shape:

FieldTypeRequiredDescription
shastringYesThe commit SHA.
messagestringNoThe commit message.
authorstringNoThe commit author.
timestampstringNoISO 8601 timestamp of the commit.

Request limits

LimitValue
Body size100 KB maximum. Requests exceeding this limit are rejected with 413 before any processing occurs.
Rate limit (production)60 requests per minute per IP.
Rate limit (test endpoint)10 requests per minute per IP.

Headers

HeaderRequiredDescription
Content-TypeYesMust be application/json.
X-Deploy-TokenYesThe deploy webhook token for the target service.
X-Idempotency-KeyNoA unique key for deduplication. If a request with the same idempotency key and token has already been processed, the endpoint returns a 200 with status: "duplicate" instead of creating a new deploy.

Responses

Success (200)

{
  "status": "accepted",
  "deploy_id": "d8f5a2b1-3c4e-4f6a-8b9c-1d2e3f4a5b6c"
}

Duplicate (200)

Returned when the X-Idempotency-Key matches a previously processed request:

{
  "status": "duplicate",
  "deploy_id": "d8f5a2b1-3c4e-4f6a-8b9c-1d2e3f4a5b6c"
}

Errors

StatusReason
400Validation failed. The response body includes details about which fields are invalid.
401Invalid or missing X-Deploy-Token.
413Request body exceeds the 100 KB limit.
429Rate limit exceeded. Retry after the duration specified in the Retry-After header.

Full example

curl -X POST https://blametrail.com/api/ingest/deploy \
  -H "Content-Type: application/json" \
  -H "X-Deploy-Token: dpl_abc123def456" \
  -H "X-Idempotency-Key: deploy-20260321-abcdef" \
  -d '{
    "commit_sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
    "commit_message": "fix: resolve timeout in payment processing",
    "branch": "main",
    "deployed_by": "github-actions",
    "environment": "production",
    "version": "v2.4.1",
    "url": "https://github.com/org/repo/actions/runs/123456",
    "commits": [
      {
        "sha": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
        "message": "fix: resolve timeout in payment processing",
        "author": "[email protected]",
        "timestamp": "2026-03-21T14:30:00Z"
      }
    ]
  }'

CI/CD integration examples

GitHub Actions

- name: Notify BlameTrail
  if: success()
  run: |
    curl -s -X POST "${{ secrets.BLAMETRAIL_URL }}/api/ingest/deploy" \
      -H "Content-Type: application/json" \
      -H "X-Deploy-Token: ${{ secrets.BLAMETRAIL_DEPLOY_TOKEN }}" \
      -d '{
        "commit_sha": "${{ github.sha }}",
        "commit_message": "${{ github.event.head_commit.message }}",
        "branch": "${{ github.ref_name }}",
        "deployed_by": "${{ github.actor }}",
        "environment": "production"
      }'

GitLab CI

notify_blametrail:
  stage: deploy
  script:
    - |
      curl -s -X POST "$BLAMETRAIL_URL/api/ingest/deploy" \
        -H "Content-Type: application/json" \
        -H "X-Deploy-Token: $BLAMETRAIL_DEPLOY_TOKEN" \
        -d "{
          \"commit_sha\": \"$CI_COMMIT_SHA\",
          \"commit_message\": \"$CI_COMMIT_MESSAGE\",
          \"branch\": \"$CI_COMMIT_BRANCH\",
          \"deployed_by\": \"$GITLAB_USER_LOGIN\",
          \"environment\": \"production\"
        }"

Next steps

On this page