Railhook Rules API

Event routing and filtering rules

GitHub OpenAPI

Operations 6

GET /api/v1/projects/{projectId}/rules/{id} Get rule #
PUT /api/v1/projects/{projectId}/rules/{id} Update rule #
DELETE /api/v1/projects/{projectId}/rules/{id} Delete rule #
GET /api/v1/projects/{projectId}/rules List rules #
POST /api/v1/projects/{projectId}/rules Create rule #
PATCH /api/v1/projects/{projectId}/rules/{id}/toggle Toggle rule enabled/disabled #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/railhook-io:railhook-io-rules-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

railhook-io-rules-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Railhook Rules API
  description: 'Send webhooks to the endpoints your customers register, and receive webhooks from any provider, with every attempt on record.


    ## What you can do

    - **Outgoing**: post an event once; Railhook delivers it, signed, to every subscribed endpoint and retries on its own (1m → 24h, 7 attempts). What never arrives lands in Failed Messages.

    - **Incoming**: give each provider its own ingress URL; Railhook verifies the signature and forwards the event to your destinations.

    - **Replay**: send past events again with Time Machine.


    ## Authentication

    - **API key** (`X-API-Key` header): project-scoped calls, including sending events. What the SDKs use.

    - **Bearer token**: account and organization calls made on behalf of a signed-in user.

    - **Portal session** (`Authorization: Bearer rhp_…`): the `/api/v1/portal/**` calls the embedded customer portal makes for one Consumer. Opened by your backend with an API key.


    Guides: /docs/'
  contact:
    name: Railhook
    url: https://github.com/vadymkykalo/railhook
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.0.0
servers:
- url: '{baseUrl}'
  description: Your Railhook installation — the same origin the dashboard runs on
  variables:
    baseUrl:
      description: Scheme and host of your installation, without a trailing slash
      default: http://localhost:8080
security:
- bearerAuth: []
tags:
- name: Rules
  description: Event routing and filtering rules
paths:
  /api/v1/projects/{projectId}/rules/{id}:
    get:
      tags:
      - Rules
      summary: Get rule
      description: Returns rule details with conditions, actions, and execution stats
      operationId: getRule
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RuleResponse'
      security:
      - bearerAuth: []
      - apiKey: []
    put:
      tags:
      - Rules
      summary: Update rule
      description: Updates rule conditions, actions, and settings
      operationId: updateRule
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RuleResponse'
      security:
      - bearerAuth: []
      - apiKey: []
    delete:
      tags:
      - Rules
      summary: Delete rule
      description: Removes a rule and all its actions
      operationId: deleteRule
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Rule deleted
      security:
      - bearerAuth: []
      - apiKey: []
  /api/v1/projects/{projectId}/rules:
    get:
      tags:
      - Rules
      summary: List rules
      description: Returns all rules for the project ordered by priority
      operationId: listRules
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RuleResponse'
      security:
      - bearerAuth: []
      - apiKey: []
    post:
      tags:
      - Rules
      summary: Create rule
      description: Creates a new event processing rule with conditions and actions
      operationId: createRule
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleRequest'
        required: true
      responses:
        '201':
          description: Rule created
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RuleResponse'
      security:
      - bearerAuth: []
      - apiKey: []
  /api/v1/projects/{projectId}/rules/{id}/toggle:
    patch:
      tags:
      - Rules
      summary: Toggle rule enabled/disabled
      description: A disabled rule keeps its conditions and stops being evaluated.
      operationId: toggleRule
      parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                type: boolean
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RuleResponse'
      security:
      - bearerAuth: []
      - apiKey: []
components:
  schemas:
    RuleActionRequest:
      type: object
      properties:
        type:
          type: string
          enum:
          - ROUTE
          - TRANSFORM
          - DROP
          - TAG
        endpointId:
          type: string
          format: uuid
        transformationId:
          type: string
          format: uuid
        config: {}
        sortOrder:
          type: integer
          format: int32
      required:
      - type
    Group:
      allOf:
      - $ref: '#/components/schemas/ConditionNode'
      - type: object
        properties:
          op:
            type: string
            enum:
            - AND
            - OR
            - NOT
          children:
            type: array
            items:
              oneOf:
              - $ref: '#/components/schemas/Group'
              - $ref: '#/components/schemas/Predicate'
    RuleActionResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
          - ROUTE
          - TRANSFORM
          - DROP
          - TAG
        endpointId:
          type: string
          format: uuid
        endpointUrl:
          type: string
        transformationId:
          type: string
          format: uuid
        transformationName:
          type: string
        config: {}
        sortOrder:
          type: integer
          format: int32
        createdAt:
          type: string
          format: date-time
    Predicate:
      allOf:
      - $ref: '#/components/schemas/ConditionNode'
      - type: object
        properties:
          field:
            type: string
          operator:
            type: string
            enum:
            - EQ
            - NEQ
            - CONTAINS
            - NOT_CONTAINS
            - STARTS_WITH
            - ENDS_WITH
            - IN
            - NOT_IN
            - REGEX
            - GT
            - GTE
            - LT
            - LTE
            - BETWEEN
            - EXISTS
            - NOT_EXISTS
            - IS_NULL
            - NOT_NULL
          value: {}
          valueType:
            type: string
            enum:
            - STRING
            - NUMBER
            - BOOLEAN
            - ARRAY_STRING
            - ARRAY_NUMBER
            - DATE_TIME
          caseInsensitive:
            type: boolean
    RuleResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        projectId:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        priority:
          type: integer
          format: int32
        eventTypePattern:
          type: string
        conditions:
          oneOf:
          - $ref: '#/components/schemas/Group'
          - $ref: '#/components/schemas/Predicate'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/RuleActionResponse'
        totalExecutions:
          type: integer
          format: int64
        totalMatches:
          type: integer
          format: int64
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    RuleRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 0
        description:
          type: string
        enabled:
          type: boolean
        priority:
          type: integer
          format: int32
        eventTypePattern:
          type: string
        conditions:
          oneOf:
          - $ref: '#/components/schemas/Group'
          - $ref: '#/components/schemas/Predicate'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/RuleActionRequest'
      required:
      - name
    ConditionNode:
      discriminator:
        propertyName: type
      properties:
        type:
          type: string
      required:
      - type
  securitySchemes:
    bearerAuth:
      type: http
      description: JWT token obtained from /api/v1/auth/login
      scheme: bearer
      bearerFormat: JWT
    apiKey:
      type: apiKey
      description: Project API key for event ingestion
      name: X-API-Key
      in: header
    platformAdminToken:
      type: apiKey
      description: Cluster-operator credential (PLATFORM_ADMIN_TOKEN env var), independent of tenant org membership — required for cross-tenant admin endpoints
      name: X-Platform-Admin-Token
      in: header
    portalSession:
      type: http
      description: Portal session token, returned once by POST /api/v1/projects/{projectId}/consumers/{consumerId}/portal-sessions
      scheme: bearer
      bearerFormat: rhp_…