---
title: "Test regex pattern against sample data"
method: POST
path: "/api/{org_id}/re_patterns/test"
tags: ["RePattern"]
---

# Test regex pattern against sample data

`POST /api/{org_id}/re_patterns/test`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/re_patterns/test`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/re_patterns/test/post.ts> (a function with typed inputs; its response is checked against the schema)

Tests a regex pattern against sample input strings to validate pattern matching

## Path parameters

- `org_id` string, required

## Request body

- object
  - `pattern` string, required
  - `policy` string, nullable
  - `test_records` string[], required

## Response `200`

array of strings

- object
  - `results` string[], required

## Other responses

- `400`: Invalid request

---

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