---
title: "Historical contract: Create Event Rule"
description: "Historical Ordering.co API contract for POST /event_rules (Create Event Rule), kept for reference. Use the current API reference for new integrations."
canonical: https://docs.ordering.co/api-reference/guides/history/create-event-rule/
---

# Historical contract: Create Event Rule

[]()

> **Historical API contract.** This page describes an earlier API contract. Methods, paths, and responses may differ from the current API.

## Historical meaning

Create Event Rule

## Current API

For new integrations, use the linked current API reference or guide.

[View the current API reference](https://docs.ordering.co/api-reference/#tag/event_rules/POST/event_rules)

## Parameters

```json
[
  {
    "name": "language",
    "in": "path",
    "schema": {
      "type": "string",
      "default": "en"
    },
    "required": true
  },
  {
    "name": "project",
    "in": "path",
    "schema": {
      "type": "string",
      "default": "<redacted-personal>"
    },
    "required": true
  },
  {
    "name": "api_version",
    "in": "path",
    "schema": {
      "type": "string",
      "default": "v400"
    },
    "required": true
  }
]
```

## Request body

```json
{
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "launch_type": {
            "type": "string",
            "default": "times"
          },
          "date": {
            "type": "string"
          },
          "times": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "default": "abandoned_cart"
          }
        }
      }
    }
  }
}
```

## Responses

```json
{
  "200": {
    "description": "200",
    "content": {
      "application/json": {
        "examples": {
          "Result": {
            "value": "{\n  \"error\": false,\n  \"result\": {\n    \"name\": \"<redacted-personal>\",\n    \"description\": \"This is a test\",\n    \"enabled\": true,\n    \"launch_type\": \"times\",\n    \"times\": [\n      60\n    ],\n    \"type\": \"abandoned_cart\",\n    \"updated_at\": \"2022-05-18 16:55:08\",\n    \"created_at\": \"2022-05-18 16:55:08\",\n    \"id\": 3\n  }\n}"
          }
        },
        "schema": {
          "type": "object",
          "properties": {
            "error": {
              "type": "boolean",
              "example": false,
              "default": true
            },
            "result": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "example": "<redacted-personal>"
                },
                "description": {
                  "type": "string",
                  "example": "This is a test"
                },
                "enabled": {
                  "type": "boolean",
                  "example": true,
                  "default": true
                },
                "launch_type": {
                  "type": "string",
                  "example": "times"
                },
                "times": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "example": 60,
                    "default": 0
                  }
                },
                "type": {
                  "type": "string",
                  "example": "abandoned_cart"
                },
                "updated_at": {
                  "type": "string",
                  "example": "2022-05-18 16:55:08"
                },
                "created_at": {
                  "type": "string",
                  "example": "2022-05-18 16:55:08"
                },
                "id": {
                  "type": "integer",
                  "example": 3,
                  "default": 0
                }
              }
            }
          }
        }
      }
    }
  },
  "400": {
    "description": "400",
    "content": {
      "application/json": {
        "examples": {
          "Result": {
            "value": "{}"
          }
        },
        "schema": {
          "type": "object",
          "properties": {}
        }
      }
    }
  }
}
```
