---
title: "Create a custom behavior"
method: POST
path: "/api/pulses/behaviors/custom/"
tags: ["Behaviors"]
---

# Create a custom behavior

`POST /api/pulses/behaviors/custom/`

## Request

- Base URL: `https://api.respan.ai`
- URL: `https://api.respan.ai/api/pulses/behaviors/custom/`
- Auth: HTTP bearer

Creates a behavior from a plain-language definition. New spans are scored against it from then on; past spans are not rescored.

## Request body

- CustomBehaviorCreateRequest
  - `description` string, required: The plain-language definition span-01 scores each span against. Say what counts and what doesn't. At least 3 characters after trimming.
  - `name` string, nullable: Display name. Optional and not unique. Blank is stored as `null`.
  - `polarity` 'negative' | 'positive' | 'neutral': Whether the behavior firing is good or bad: `negative` (an Issue), `positive` (a Win) or `neutral` (Info). Display metadata only; it does not change how spans are scored.

## Response `201`

The created behavior.

- CustomBehavior
  - `id` string, required: Custom behavior ID. It is also the behavior's key in analytics, filters and span verdicts.
  - `name` string, nullable, required: Display name. Optional and not unique; behaviors are identified by `id`.
  - `description` string, required: The plain-language definition span-01 scores each span against. Say what counts and what doesn't. At least 3 characters after trimming.
  - `polarity` 'negative' | 'positive' | 'neutral', required: Whether the behavior firing is good or bad: `negative` (an Issue), `positive` (a Win) or `neutral` (Info). Display metadata only; it does not change how spans are scored.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Validation failed, or the project is on a legacy plan without a tier and already has 50 custom behaviors.
- `403`: Forbidden: the API key is missing, invalid or expired; the key doesn't grant `custom_behaviors:create` (Write access does); behaviors are turned off for the organization.
- `429`: Rate limited. This endpoint allows 30 requests per minute per organization.

## Changes

- **2026-10-21** `c30bcb383ee8`: 7 breaking, 5 info
  - request body became required
  - added `#/components/schemas/BehaviorPolarity` to the `polarity` request property `allOf` list
  - removed the enum value `negative` of the request property `polarity`
  - removed the enum value `neutral` of the request property `polarity`
  - …8 more
- **2026-10-02** `b830b79cfd52`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/respan/apis/respan-api/changes/api/pulses/behaviors/custom/post.md)

---

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