Skip to Content

Get a custom behavior

GEThttps://api.respan.ai/api/pulses/behaviors/custom/{id}/

Returns one custom behavior with its tags.

Servers

https://api.respan.ai: Respan API Server

Authentication

RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: bearer; format: Respan API key.

HTTP
Authorization: Bearer $RESPAN_API_KEY

Path parameters

Parameter Type Required Description and constraints
id string Required
Custom behavior ID.
Example: "6f1c2a9e-3b7d-4c55-9a0e-2d8f4b1c7e93"

Responses

200

The behavior.

application/json

Field Type Requirement Description and constraints
$ object and object and object Body
Reference: #/components/schemas/CustomBehaviorDetail
$ (allOf 1) object and object Schema variant
Reference: #/components/schemas/CustomBehaviorWithTags
$ (allOf 1) (allOf 1) object Schema variant
Reference: #/components/schemas/CustomBehavior
$ (allOf 1) (allOf 1).id string Required in parent
Custom behavior ID. It is also the behavior’s key in analytics, filters and span verdicts.
Example: "6f1c2a9e-3b7d-4c55-9a0e-2d8f4b1c7e93"
$ (allOf 1) (allOf 1).name string or null Required in parent
Display name. Optional and not unique; behaviors are identified by id.
Maximum length: 128
Example: "Refund promise"
$ (allOf 1) (allOf 1).description string Required in parent
The plain-language definition span-01 scores each span against. Say what counts and what doesn’t. At least 3 characters after trimming.
Example: "The assistant promises a refund, credit, or compensation that the policy in the system prompt does not allow."
$ (allOf 1) (allOf 1).polarity string Required in parent
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.
Reference: #/components/schemas/BehaviorPolarity
Allowed: "negative", "positive", "neutral"
Example: "negative"
$ (allOf 1) (allOf 1).created_at string Required in parent
Format: date-time
Example: "2026-09-28T17:41:09.512340Z"
$ (allOf 1) (allOf 1).updated_at string Required in parent
Format: date-time
Example: "2026-09-28T17:41:09.512340Z"
$ (allOf 1) (allOf 2) object Schema variant
-
$ (allOf 1) (allOf 2).tags array<object> Required in parent
Tags on the behavior.
$ (allOf 1) (allOf 2).tags[] object Array item
Reference: #/components/schemas/BehaviorTag
$ (allOf 1) (allOf 2).tags[].id string Required in parent
Tag ID.
Example: "0b7e5f0c-2a61-4d3e-9a47-5c8f1e2d3b4a"
$ (allOf 1) (allOf 2).tags[].name string Required in parent
Tag name.
Example: "Support"
$ (allOf 1) (allOf 2).tags[].color string Required in parent
Tag color.
Example: "#2563EB"
$ (allOf 1) (allOf 2).tags[].created_at string Required in parent
Format: date-time
Example: "2026-09-12T09:30:00Z"
$ (allOf 1) (allOf 2).tags[].updated_at string Required in parent
Format: date-time
Example: "2026-09-12T09:30:00Z"
$ (allOf 2) object Schema variant
-
$ (allOf 2).has_write_access boolean Required in parent
Whether the caller can edit the behavior. Always true for an API key of the behavior’s organization.
Example: true

OpenAPI response schema

{
  "$ref": "#/components/schemas/CustomBehaviorDetail"
}
Example
JSON
{ "id": "6f1c2a9e-3b7d-4c55-9a0e-2d8f4b1c7e93", "name": "Refund promise", "description": "The assistant promises a refund, credit, or compensation that the policy in the system prompt does not allow.", "polarity": "negative", "created_at": "2026-09-28T17:41:09.512340Z", "updated_at": "2026-09-28T17:41:09.512340Z", "tags": [ { "id": "0b7e5f0c-2a61-4d3e-9a47-5c8f1e2d3b4a", "name": "Support", "color": "#2563EB", "created_at": "2026-09-12T09:30:00Z", "updated_at": "2026-09-12T09:30:00Z" } ], "has_write_access": true }

403

Forbidden: the API key is missing, invalid or expired; the key doesn’t grant custom_behaviors:read (Read access does); behaviors are turned off for the organization.

application/json

Field Type Requirement Description and constraints
$ object Body
-
detail string Required in parent
-

OpenAPI response schema

{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
Missing or invalid API key
JSON
{ "detail": "Your API key is invalid or expired, please check your API key in the platform settings." }
Key lacks the permission
JSON
{ "detail": "This API key does not have the 'custom_behaviors:read' permission." }
Behaviors are off for the organization
JSON
{ "detail": "Span Behaviors is not enabled for this organization." }

404

No custom behavior with this ID in your organization.

application/json

Field Type Requirement Description and constraints
$ object Body
-
detail string Required in parent
-

OpenAPI response schema

{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
Example
JSON
{ "detail": "No CustomBehavior matches the given query." }

429

Rate limited. This endpoint allows 30 requests per minute per organization.

application/json

Field Type Requirement Description and constraints
$ object Body
-
detail string Required in parent
-

OpenAPI response schema

{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
Example
JSON
{ "detail": "Request was throttled." }

OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

OpenAPI operation

{
  "summary": "Get a custom behavior",
  "operationId": "retrieveCustomBehavior",
  "tags": [
    "Behaviors"
  ],
  "description": "Returns one custom behavior with its tags.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "Custom behavior ID.",
      "example": "6f1c2a9e-3b7d-4c55-9a0e-2d8f4b1c7e93"
    }
  ],
  "responses": {
    "200": {
      "description": "The behavior.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CustomBehaviorDetail"
          },
          "example": {
            "id": "6f1c2a9e-3b7d-4c55-9a0e-2d8f4b1c7e93",
            "name": "Refund promise",
            "description": "The assistant promises a refund, credit, or compensation that the policy in the system prompt does not allow.",
            "polarity": "negative",
            "created_at": "2026-09-28T17:41:09.512340Z",
            "updated_at": "2026-09-28T17:41:09.512340Z",
            "tags": [
              {
                "id": "0b7e5f0c-2a61-4d3e-9a47-5c8f1e2d3b4a",
                "name": "Support",
                "color": "#2563EB",
                "created_at": "2026-09-12T09:30:00Z",
                "updated_at": "2026-09-12T09:30:00Z"
              }
            ],
            "has_write_access": true
          }
        }
      }
    },
    "403": {
      "description": "Forbidden: the API key is missing, invalid or expired; the key doesn't grant `custom_behaviors:read` (Read access does); behaviors are turned off for the organization.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "examples": {
            "invalidKey": {
              "summary": "Missing or invalid API key",
              "value": {
                "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
              }
            },
            "missingPermission": {
              "summary": "Key lacks the permission",
              "value": {
                "detail": "This API key does not have the 'custom_behaviors:read' permission."
              }
            },
            "behaviorsOff": {
              "summary": "Behaviors are off for the organization",
              "value": {
                "detail": "Span Behaviors is not enabled for this organization."
              }
            }
          }
        }
      }
    },
    "404": {
      "description": "No custom behavior with this ID in your organization.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "No CustomBehavior matches the given query."
          }
        }
      }
    },
    "429": {
      "description": "Rate limited. This endpoint allows 30 requests per minute per organization.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Request was throttled."
          }
        }
      }
    }
  },
  "security": [
    {
      "RespanApiKey": []
    }
  ]
}

OpenAPI path metadata

{}

Referenced OpenAPI components

{
  "schemas": {
    "BehaviorPolarity": {
      "type": "string",
      "enum": [
        "negative",
        "positive",
        "neutral"
      ],
      "description": "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.",
      "example": "negative"
    },
    "BehaviorTag": {
      "type": "object",
      "required": [
        "id",
        "name",
        "color",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Tag ID.",
          "example": "0b7e5f0c-2a61-4d3e-9a47-5c8f1e2d3b4a"
        },
        "name": {
          "type": "string",
          "description": "Tag name.",
          "example": "Support"
        },
        "color": {
          "type": "string",
          "description": "Tag color.",
          "example": "#2563EB"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "example": "2026-09-12T09:30:00Z"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "example": "2026-09-12T09:30:00Z"
        }
      }
    },
    "CustomBehavior": {
      "type": "object",
      "required": [
        "id",
        "name",
        "description",
        "polarity",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Custom behavior ID. It is also the behavior's key in analytics, filters and span verdicts.",
          "example": "6f1c2a9e-3b7d-4c55-9a0e-2d8f4b1c7e93"
        },
        "name": {
          "type": "string",
          "nullable": true,
          "maxLength": 128,
          "description": "Display name. Optional and not unique; behaviors are identified by `id`.",
          "example": "Refund promise"
        },
        "description": {
          "type": "string",
          "description": "The plain-language definition span-01 scores each span against. Say what counts and what doesn't. At least 3 characters after trimming.",
          "example": "The assistant promises a refund, credit, or compensation that the policy in the system prompt does not allow."
        },
        "polarity": {
          "$ref": "#/components/schemas/BehaviorPolarity"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "example": "2026-09-28T17:41:09.512340Z"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "example": "2026-09-28T17:41:09.512340Z"
        }
      }
    },
    "CustomBehaviorDetail": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CustomBehaviorWithTags"
        },
        {
          "type": "object",
          "required": [
            "has_write_access"
          ],
          "properties": {
            "has_write_access": {
              "type": "boolean",
              "description": "Whether the caller can edit the behavior. Always `true` for an API key of the behavior's organization.",
              "example": true
            }
          }
        }
      ]
    },
    "CustomBehaviorWithTags": {
      "allOf": [
        {
          "$ref": "#/components/schemas/CustomBehavior"
        },
        {
          "type": "object",
          "required": [
            "tags"
          ],
          "properties": {
            "tags": {
              "type": "array",
              "description": "Tags on the behavior.",
              "items": {
                "$ref": "#/components/schemas/BehaviorTag"
              }
            }
          }
        }
      ]
    }
  },
  "securitySchemes": {
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}