---
title: "Attach rule to pipeline"
method: POST
path: "/api/v1/pipelines/{id}/rules"
tags: ["Pipelines"]
---

# Attach rule to pipeline

`POST /api/v1/pipelines/{id}/rules`

## Request

- Base URL: `https://numonic.ai`
- URL: `https://numonic.ai/api/v1/pipelines/{id}/rules`
- Auth: API key in header `x-api-key`

Attach an automation rule to a pipeline.

## Path parameters

- `id` string, required: Pipeline hash (40-char hex SHA-1)

## Request body

- AttachRuleRequest
  - `name` string, required
  - `description` string
  - `trigger_config` object, required
    - `type` 'event' | 'schedule' | 'watch', required
  - `rate_limit_config` object, required
    - `max_per_minute` integer
    - `max_per_hour` integer
  - `pipeline_vars` object

## Response `201`

Rule attached

- SuccessMessage
  - `message` string, required: Human-readable success message

## Other responses

- `404`: Pipeline not found

---

[API](https://skmtc.dev/numonic/apis/numonic-api.md) · [All operations](https://skmtc.dev/numonic/apis/numonic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/numonic/apis/numonic-api/revisions/6c559bef1e35?raw)
