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

# Deployments API

> Tell Ordyn that a SHA reached an environment when your pipeline does not create GitHub Deployments.

Use this when your deploy pipeline does not create GitHub Deployment records. If it does, Ordyn picks up deploys automatically. See [Deploys](/detect/deploys).

> [!TIP]
>
> Deploying from GitHub Actions? Use the [notify-deploy action](https://github.com/struct-dot-ai/notify-deploy) instead of calling this endpoint yourself. It sends this request with the commit, repository, and idempotency key filled in:
>
> ```yaml theme={null}
> - uses: struct-dot-ai/notify-deploy@v1
>   with:
>     api-key: ${{ secrets.STRUCT_DEPLOY_KEY }}
>     environment: production
> ```

## Authentication

Create a **deployment key** in **Settings → Deployment Keys** (admins only). The key starts with `sk-` and is shown once. Send it as a bearer token.

## Request

```bash theme={null}
curl -X POST "https://api.ordyn.dev/api/deployments/" \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "repository": "acme/api",
    "sha": "abc1234deadbeef",
    "environment": "production",
    "status": "success",
    "idempotencyKey": "production-abc1234"
  }'
```

| Field | Required | Notes |
| - | - | - |
| `repository` | Yes | `owner/name` of the GitHub repository |
| `sha` | Yes | The Git SHA that reached the environment, at least 7 characters |
| `environment` | Yes | Must match your Auto Monitors environment exactly, including case |
| `status` | No | `success`, `failure`, or `error`. Defaults to `success` |
| `idempotencyKey` | Yes | Your unique ID for this deploy event. Retrying with the same key does not create a duplicate |

## Behavior

* Post once the SHA has reached, or failed to reach, the environment. There is no "in progress" status.
* Canary then production is two posts: same SHA, two environment names, two idempotency keys.
* The Ordyn GitHub App still needs access to the repository so Ordyn can read the diff and open fixes.
* Do not point a GitHub repository webhook at this endpoint. GitHub cannot send the bearer token, so every delivery is rejected. Use the **GitHub Workflow** option instead.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.