Skip to main content
POST
/
data-sources
/
{source_id}
/
grep
Search documentation with regex
curl --request POST \
  --url https://apigcp.trynia.ai/v2/data-sources/{source_id}/grep \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "pattern": "authentication.*token",
  "path": "/",
  "context_lines": 3
}
'
{
  "success": true,
  "matches": [
    {
      "path": "<string>",
      "url": "<string>",
      "line_number": 123,
      "line": "<string>",
      "context": [
        "<string>"
      ],
      "context_start_line": 123
    }
  ],
  "pattern": "<string>",
  "path_filter": "<string>",
  "total_matches": 123,
  "files_searched": 123
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Path Parameters

source_id
string
required

Flexible data source identifier (UUID, display name, or URL)

Body

application/json
pattern
string
required

Regex pattern to search for

Example:

"authentication.*token"

path
string
default:/

Limit search to this path prefix

context_lines
integer
default:3

Number of context lines around matches

Required range: 0 <= x <= 10

Response

Search completed successfully

success
boolean
matches
object[]
pattern
string

The pattern that was searched

path_filter
string

Path filter that was applied

total_matches
integer
files_searched
integer