---
title: "Create a suite"
method: POST
path: "/v1/suites"
tags: ["Suites"]
---

# Create a suite

`POST /v1/suites`

## Request

- Base URL: `https://api.ironfang.com/rig`
- URL: `https://api.ironfang.com/rig/v1/suites`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Creates a suite and its first version from a definition. The definition is validated in full and stored canonically; its SHA-256 identifies the version. The slug is unique within the project. Needs rig.write.

## Request body

- object
  - `definition` Definition, required: A suite's content. Resources are named identities a run receives; expectations are deterministic conditions on the run's events, stored and validated now and evaluated once the platform observes the events they name.
    - `defaults` object
      - `run_ttl` string: Default run lifetime, 1m to 24h ("30m").
    - `expectations` ExpectationSpec[]
      - `event` string, required: An event type from the catalogue, such as email.received or callback.forwarded.
      - `id` string, required
      - `match` object
      - `resource` string, required: A declared resource name.
    - `resources` object, required
    - `version` 1, required
  - `name` string, required
  - `project_id` string, uuid, required
  - `slug` string, required

## Response `201`

Suite created with version 1

- SuiteWithVersion
  - `suite` Suite, required
    - `archived_at` string, date-time
    - `created_at` string, date-time, required
    - `current_version` integer, required
    - `id` string, uuid, required
    - `name` string, required
    - `organisation_id` string, uuid, required
    - `project_id` string, uuid, required
    - `slug` string, required
  - `version` SuiteVersion, required
    - `created_at` string, date-time, required
    - `created_by` string
    - `definition` Definition, required: A suite's content. Resources are named identities a run receives; expectations are deterministic conditions on the run's events, stored and validated now and evaluated once the platform observes the events they name.
      - `defaults` object
        - `run_ttl` string: Default run lifetime, 1m to 24h ("30m").
      - `expectations` ExpectationSpec[]
        - `event` string, required: An event type from the catalogue, such as email.received or callback.forwarded.
        - `id` string, required
        - `match` object
        - `resource` string, required: A declared resource name.
      - `resources` object, required
      - `version` 1, required
    - `definition_sha256` string, required: SHA-256 of the canonical definition.
    - `id` string, uuid, required
    - `organisation_id` string, uuid, required
    - `suite_id` string, uuid, required
    - `version` integer, required

## Other responses

- `400`: The body is not one strict JSON value of the documented shape (`invalid_json`).
- `401`: No credential, an invalid one, or a delegated token where none is accepted (`unauthorized`, `invalid_api_key`, `delegated_not_allowed`).
- `403`: The credential lacks the permission or scope, or names another organisation (`forbidden`, `insufficient_scope`).
- `404`: No such object in this organisation (`not_found`).
- `409`: A name is already taken, or the target is archived (`conflict`, `archived`).
- `422`: A field is invalid; the message names it (`invalid_request`).

---

[API](https://skmtc.dev/ironfang/apis/ironfang-rig-api.md) · [All operations](https://skmtc.dev/ironfang/apis/ironfang-rig-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ironfang/apis/ironfang-rig-api/revisions/3e86a312dad1?raw)
