---
title: "Create classification rule"
method: POST
path: "/classify/rules"
tags: ["Classification"]
---

# Create classification rule

`POST /classify/rules`

## Request

- Base URL: `https://frontrun.vc/v1`
- URL: `https://frontrun.vc/v1/classify/rules`
- Auth: API key in header `X-API-Key`

Create a custom classification rule. Matching entities in /follows/enriched, /classify, and /discover automatically get your custom sector, entity type, tags, and priority applied. Conditions support bio_keywords (any match), username_pattern (regex, max 100 chars, no nested quantifiers), sector_contains, and must_be_company. Free, costs 0 credits. Limit 100 rules per account (500 on Enterprise).

## Request body

- object
  - `name` string, required: Rule name.
  - `conditions` object, required: Match conditions (valid keys: bio_keywords, username_pattern, sector_contains, must_be_company).
    - `bio_keywords` string[]
    - `username_pattern` string
    - `sector_contains` string
    - `must_be_company` boolean
  - `actions` object, required: Actions applied on match (valid keys: custom_sector, custom_entity_type, tags, priority).
    - `custom_sector` string
    - `custom_entity_type` string
    - `tags` string[]
    - `priority` string

## Response `201`

Rule created.

- ClassificationRule
  - `id` string: Rule ID.
  - `name` string
  - `conditions` object
    - `bio_keywords` string[]: Match if the bio contains any of these keywords.
    - `username_pattern` string: Regex tested against the username (max 100 chars, no nested quantifiers).
    - `sector_contains` string: Match if the classified sector contains this substring.
    - `must_be_company` boolean: Require (true) or exclude (false) company-classified entities.
  - `actions` object
    - `custom_sector` string
    - `custom_entity_type` string
    - `tags` string[]
    - `priority` string
  - `active` boolean
  - `match_count` integer
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400`: Missing or invalid fields.
- `401`: Missing, invalid, inactive, or expired API key.
- `429`: Rate limit or daily credit cap reached. Retry after the indicated reset time.

---

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