---
title: "AutomationRule store"
method: POST
path: "/api/v1/automations"
tags: ["automations"]
---

# AutomationRule store

`POST /api/v1/automations`

## Request

- Base URL: `https://www.foxnfe.com.br`
- URL: `https://www.foxnfe.com.br/api/v1/automations`
- Auth: HTTP bearer

## Request body

- PostApiV1AutomationsRequest
  - `name` string, required
  - `trigger_event` '', required
  - `conditions` object[]
    - `field` string, required
    - `op` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'in' | 'exists' | 'not_exists', required
    - `value` unknown
  - `actions` object[], required
    - `type` 'webhook' | 'email', required
    - `url` string, uri, nullable: Obrigatório quando actions.*.type,webhook.
    - `secret` string, nullable
    - `to` string, email, nullable: Obrigatório quando actions.*.type,email.
    - `subject` string, nullable

## Response `201`

Resposta implementada pelo controlador.

- object
  - `data` object
    - `id` integer
    - `name` unknown
    - `version` integer
    - `trigger_event` unknown
    - `conditions` unknown
    - `actions` union[]
      - union
        - object
          - `has_secret` boolean
        - unknown[]
          - unknown
    - `active` boolean
    - `created_by` unknown
    - `last_run_at` string, date-time, nullable
    - `last_status` unknown
    - `last_message` unknown
    - `created_at` string, date-time, nullable

## Other responses

- `422`: Resposta implementada pelo controlador.

---

[API](https://skmtc.dev/foxnfe/apis/fox-nf-e-api.md) · [All operations](https://skmtc.dev/foxnfe/apis/fox-nf-e-api/llms.txt) · [OpenAPI document](https://skmtc.dev/foxnfe/apis/fox-nf-e-api/revisions/8820a6e016b0?raw)
