API Reference / Strategy - Initiative Ownership

Preview pattern matches

post https://api.intelig.ai/api/v1/intelig/strategy/initiatives/{initiativeId}/ownership-patterns/preview

Auth: Authorization: ApiKey <key> (an API key sent as Bearer is rejected) or Authorization: Bearer <jwt> for a dashboard session. operationId: previewPattern

Preview what files or branches a pattern would match before saving it. Returns sample matches, counts, and potential overlaps with existing patterns. `isValid` reports whether the glob is a spelling this engine supports, not merely whether the string is non-empty: negation (`!`), brace expansion (`{a,b}`), comma lists and character classes are rejected with a reason. A supported pattern with `matchedFileCount: 0` is a legitimate answer — the pattern is correct and no code has landed under it yet.

Example request

curl -X POST "https://api.intelig.ai/api/v1/intelig/strategy/initiatives/1/ownership-patterns/preview" \
  -H "Authorization: ApiKey $INTELIG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "repositoryId": 10,
    "patternType": "FILE_GLOB",
    "pattern": "src/main/java/com/example/**"
  }'

Path parameters

NameTypeRequiredDescription
initiativeId integer (int64) yes Initiative ID (context only)

Request body

application/json

FieldTypeRequiredDescription
repositoryId integer (int64) yes ID of the repository to match against Example: 10
patternType string yes Type of ownership pattern One of: FILE_GLOB, REPOSITORY, BRANCH_PREFIX Example: FILE_GLOB
pattern string no Glob or regex pattern to preview Example: src/main/java/com/example/**

Response 200

application/json · ApiResponsePatternMatchPreviewDto

FieldTypeDescription
success boolean
message string
data PatternMatchPreviewDto Preview of what an ownership pattern would match before saving

Status codes

  • 200 — Preview results
  • 401 — —
  • 429 — —

Every response is wrapped in { success, message, data }. A 4xx means the request is wrong — do not retry it unchanged. A 429 carries Retry-After in seconds.