> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kodostatus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Release

> Track a new release for error correlation and regression detection

Tracking releases allows Kodo to:

* Correlate errors with specific deployments
* Detect regressions (previously resolved errors reappearing)
* Show error trends across versions
* Identify which deploy introduced new issues

## Request Body

<ParamField body="version" type="string" required>
  Semantic version or release identifier (e.g., "1.2.3", "2024-01-15-abc")
</ParamField>

<ParamField body="service_id" type="string" required>
  The service this release belongs to
</ParamField>

<ParamField body="environment" type="string" default="production">
  Deployment environment: `production`, `staging`, `development`
</ParamField>

<ParamField body="commit_sha" type="string">
  Git commit SHA for this release
</ParamField>

<ParamField body="repository" type="string">
  Repository URL for linking to commits
</ParamField>

<ParamField body="deployed_by" type="string">
  User or system that triggered the deploy
</ParamField>

## Response

Returns the created release object.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://kodostatus.com/api/v1/releases" \
    -H "X-API-Key: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "version": "1.2.3",
      "service_id": "svc_abc123",
      "environment": "production",
      "commit_sha": "a1b2c3d4e5f6g7h8",
      "repository": "https://github.com/org/repo"
    }'
  ```

  ```javascript Node.js theme={null}
  // In your CI/CD pipeline
  const response = await fetch('https://kodostatus.com/api/v1/releases', {
    method: 'POST',
    headers: {
      'X-API-Key': process.env.KODO_API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      version: process.env.VERSION || process.env.GITHUB_SHA?.slice(0, 7),
      service_id: 'svc_abc123',
      environment: process.env.ENVIRONMENT || 'production',
      commit_sha: process.env.GITHUB_SHA,
      repository: process.env.GITHUB_REPOSITORY
    })
  });
  ```

  ```yaml GitHub Actions theme={null}
  - name: Track Release in Kodo
    run: |
      curl -X POST "https://kodostatus.com/api/v1/releases" \
        -H "X-API-Key: ${{ secrets.KODO_API_KEY }}" \
        -H "Content-Type: application/json" \
        -d '{
          "version": "${{ github.ref_name }}",
          "service_id": "svc_abc123",
          "environment": "production",
          "commit_sha": "${{ github.sha }}",
          "repository": "${{ github.repository }}"
        }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "rel_abc123",
    "version": "1.2.3",
    "service_id": "svc_abc123",
    "environment": "production",
    "deployed_at": "2024-01-15T10:00:00Z",
    "commit_sha": "a1b2c3d4e5f6g7h8",
    "repository": "https://github.com/org/repo",
    "deployed_by": null,
    "error_count": 0,
    "new_errors": 0,
    "regressed_errors": 0
  }
  ```
</ResponseExample>

<Tip>
  Add release tracking to your CI/CD pipeline to automatically correlate errors with deployments. This makes it easy to identify which deploy introduced issues.
</Tip>
