# API and as code

Automate Tracix from scripts and CI with workspace API keys, detection content as code with validate, plan and apply, and webhooks for external alerts.

Automate the parts of Tracix that belong in code review and pipelines: detection content kept in Git, alerts from the tools you already run, and the credentials that go with them.

## What you can automate today

| Task                                                            | How                                                                             | Credential                                                        |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| Publish detection rules, value lists and YARA rulesets from Git | The `tracix-detections` CLI in any CI, or repository sync run by your workspace | API key of the CI type, with `security.read` or `security.manage` |
| Send alerts from Prometheus Alertmanager or your own scripts    | `POST /api/ingest/alertmanager` and `POST /api/ingest/events`                   | API key of the ingest type                                        |
| Send traces, metrics and logs from applications                 | OTLP to your workspace's OTLP endpoints                                         | Ingest key (`apm_…`)                                              |
| Describe monitors, visualizations and dashboards in Git         | `tracix.io/v1` bundles                                                          | Publishing needs a workspace admin; no API key yet                |

- [Authenticate with API keys](https://tracix.io/docs/api/authentication): Which credential to use, and how to create and send API keys

- [Monitors, dashboards and detections as code](https://tracix.io/docs/api/as-code): Repositories, bundles, and validate, plan and apply

- [Run as code in CI](https://tracix.io/docs/api/ci): GitHub Actions and other CI systems

- [Workspace API reference](https://tracix.io/docs/api/workspace-api): Every endpoint that accepts an API key

## Not available yet

* A public API for querying traces, metrics and logs. Use your workspace to explore data.
* API access to Tracix Cloud. Organizations, workspaces, users and billing are managed by people signed in to the console at `cloud.tracix.io`.
* A Terraform provider.
* Publishing monitor and dashboard bundles with an API key, and so from unattended CI.
