---
title: "Create a source classification rule"
method: POST
path: "/api/mcp/projects/{projectId}/sources/rules"
tags: ["Sources"]
---

# Create a source classification rule

`POST /api/mcp/projects/{projectId}/sources/rules`

## Request

- Base URL: `https://app.searchable.com`
- URL: `https://app.searchable.com/api/mcp/projects/{projectId}/sources/rules`
- Auth: HTTP bearer

Classify part of a cited domain: every citation under `scope` (a subdomain or a path, like `business.linkedin.com` or `linkedin.com/help`, or a URL) takes `citationType`; a `competitor` rule also names `competitorId`. With `withinDomain`, a scope outside that domain is refused with 400 `host_outside_domain`. Other refusals: 400 `invalid_scope`, `invalid_citation_type`, `missing_competitor`, `unknown_competitor`; 409 `duplicate_scope`, `rule_limit`. Requires the `source:classify` capability, and your own project role must allow managing the project (otherwise 403 `forbidden`). A pitch project that is not currently active refuses with 409 `INACTIVE_PITCH_PROMPT_MUTATION`. Numbers refresh within a few minutes: the answer carries `status.applying: true`, so poll `GET /projects/{projectId}/sources/rules` until `status.applying` is `false`. Use `POST .../sources/rules/preview` first to see what the rule would change. Supports `Idempotency-Key` replay; a reused key with a different body returns 409 `idempotency_conflict`.

## Path parameters

- `projectId` string, uuid, required

## Headers

- `Idempotency-Key` string

## Request body

- SourceClassificationRuleInput
  - `scope` string, required: A subdomain or a path of a domain, like `business.linkedin.com` or `linkedin.com/help`, or a URL.
  - `withinDomain` string: The domain the scope belongs to; a scope outside it is refused.
  - `citationType` 'brand' | 'competitor' | 'editorial' | 'social' | 'forum' | 'review' | 'institutional' | 'third_party' | 'other', required: A Source Type. `brand` is the app's Owned.
  - `competitorId` string, nullable: Required for a `competitor` rule; ignored for any other type.

## Response `200`

The rule was saved.

- SourceClassificationRuleChangeResponse: A saved rule change.
  - `rule` SourceClassificationRule, required
    - `id` string, required
    - `scope` string, required: The rule's scope as people read it, like `linkedin.com/help`.
    - `rootDomain` string, required
    - `host` string, nullable, required: The subdomain the rule covers; null for every host under `rootDomain`.
    - `pathPrefix` string, nullable, required: The path the rule covers; null for every path.
    - `citationType` 'brand' | 'competitor' | 'editorial' | 'social' | 'forum' | 'review' | 'institutional' | 'third_party' | 'other', required: A Source Type. `brand` is the app's Owned.
    - `competitorId` string, nullable, required
    - `competitorName` string, nullable, required
    - `createdBy` SourceClassificationPerson, required: A person named in the rules or their log.
      - `id` string, required
      - `name` string, nullable, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
  - `removed` integer, required: Rules a removal deleted.
  - `impact` SourceClassificationImpact, required: What a rule change does to the citations already stored.
    - `rowsChanged` integer, required: Stored citations whose Source Type (or competitor) would change.
    - `answersChanged` integer, required: AI answers those citations belong to.
    - `transitions` object[], required: The moves from type to type, most citations first.
      - `from` 'brand' | 'competitor' | 'editorial' | 'social' | 'forum' | 'review' | 'institutional' | 'third_party' | 'other', required: A Source Type. `brand` is the app's Owned.
      - `to` 'brand' | 'competitor' | 'editorial' | 'social' | 'forum' | 'review' | 'institutional' | 'third_party' | 'other', required: A Source Type. `brand` is the app's Owned.
      - `rows` integer, required
  - `status` object, required
    - `rulesVersion` integer, required
    - `applying` boolean, required: True until the numbers have refreshed; poll `GET .../sources/rules` until it is false.
  - `success` boolean, required: Always `true` — injected on every success response by this endpoint family's response wrapper.

## Other responses

- `400`: Error response. `code` is the machine-readable reason — see the [error reference](/api/errors) for the full catalog and remediation per code.
- `401`: Error response. `code` is the machine-readable reason — see the [error reference](/api/errors) for the full catalog and remediation per code.
- `403`: Error response. `code` is the machine-readable reason — see the [error reference](/api/errors) for the full catalog and remediation per code.
- `404`: Error response. `code` is the machine-readable reason — see the [error reference](/api/errors) for the full catalog and remediation per code.
- `409`: Another request with the same `Idempotency-Key` is still executing. `Retry-After` (5 seconds) is always present — retry with the SAME key once it elapses.
- `429`: Rate limited. Usually the per-API-key REST limit (600 requests/minute); on Google-backed endpoints it can also relay an upstream Google rate limit. `Retry-After` (seconds) is present when the limit was applied by Searchable's own rate limiter; it may be absent when an upstream provider rate-limits.

## Changes

- **2026-11-03** `28a5e2a65cd3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/searchable/apis/searchable-rest-api/changes/api/mcp/projects/:projectId/sources/rules/post.md)

---

[API](https://skmtc.dev/searchable/apis/searchable-rest-api.md) - [All operations](https://skmtc.dev/searchable/apis/searchable-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/searchable/apis/searchable-rest-api/revisions/a1cc70e46e73?raw)
