# Review / Assignment Rules

## Query assignment rules

> Search and filter assignment rules by various criteria including target type (pool or environment)

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.9.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"ReviewPoolAssignmentDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the assignment"},"repositoryIdentifier":{"type":"string","description":"Repository identifier"},"targetType":{"type":"string","description":"Target type: pool or environment","enum":["pool","environment"]},"poolTag":{"type":"string","description":"Pool tag assigned (when targetType is pool)"},"poolType":{"type":"string","description":"Type of pool (SANDBOX or SCRATCH_ORG)","enum":["SANDBOX","SCRATCH_ORG"]},"environmentName":{"type":"string","description":"Dedicated environment name (when targetType is environment)"},"branchPattern":{"type":"string","description":"Branch pattern"},"domainPattern":{"type":"string","description":"Domain pattern - DEPRECATED: Use domainPatterns instead","deprecated":true},"domainPatterns":{"description":"Domain patterns","type":"array","items":{"type":"string"}},"priority":{"type":"number","description":"Priority for conflict resolution"},"description":{"type":"string","description":"Description of the rule"},"isActive":{"type":"boolean","description":"Whether the rule is active"},"createdAt":{"type":"string","description":"Creation timestamp"},"updatedAt":{"type":"string","description":"Last update timestamp"},"createdBy":{"type":"string","description":"User who created the assignment"},"updatedBy":{"type":"string","description":"User who last updated the assignment"},"version":{"type":"number","description":"Document version for optimistic locking"}},"required":["id","repositoryIdentifier","targetType","branchPattern","domainPatterns","priority","isActive","createdAt","updatedAt","createdBy","version"]}}},"paths":{"/sfp/api/review/pools/assign":{"get":{"operationId":"ReviewPoolAssignmentController_query","summary":"Query assignment rules","description":"Search and filter assignment rules by various criteria including target type (pool or environment)","parameters":[{"name":"repositoryIdentifier","required":false,"in":"query","description":"Filter by repository","schema":{"type":"string"}},{"name":"poolTag","required":false,"in":"query","description":"Filter by pool tag","schema":{"type":"string"}},{"name":"targetType","required":false,"in":"query","description":"Filter by target type (pool or environment)","schema":{"enum":["pool","environment"],"type":"string"}},{"name":"isActive","required":false,"in":"query","description":"Filter by active status","schema":{"type":"boolean"}},{"name":"branchPatternSearch","required":false,"in":"query","description":"Search in branch patterns","schema":{"type":"string"}},{"name":"domainPatternSearch","required":false,"in":"query","description":"Search in domain patterns","schema":{"type":"string"}}],"responses":{"200":{"description":"List of assignment rules","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReviewPoolAssignmentDto"}}}}},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Review / Assignment Rules"]}}}}
```

## Create an assignment rule

> Creates a new rule for automatically assigning a pool or dedicated environment to review environments based on branch and domain patterns. Set targetType to "pool" to assign from a pool, or "environment" to assign a dedicated environment.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.9.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"CreateReviewPoolAssignmentDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier in format owner/repo"},"targetType":{"type":"string","description":"Target type: pool (default) or environment for dedicated org assignment","enum":["pool","environment"],"default":"pool"},"poolTag":{"type":"string","description":"Tag of the pool to assign for matching patterns. Required when targetType is pool."},"poolType":{"type":"string","description":"Type of pool (SANDBOX or SCRATCH_ORG). If not specified, will be detected from the pool configuration.","enum":["SANDBOX","SCRATCH_ORG"]},"environmentName":{"type":"string","description":"Name of a dedicated environment to assign. Required when targetType is environment."},"branchPattern":{"type":"string","description":"Git branch pattern to match (supports wildcards: *, prefix/*, *suffix)"},"domainPattern":{"type":"string","description":"Domain pattern to match (supports wildcards) - DEPRECATED: Use domainPatterns instead","deprecated":true},"domainPatterns":{"description":"Domain patterns to match (supports wildcards, leave empty to match any domain)","type":"array","items":{"type":"string"}},"priority":{"type":"number","description":"Priority for conflict resolution. Higher values take precedence.","minimum":0,"maximum":1000},"description":{"type":"string","description":"Optional description explaining the assignment rule"},"isActive":{"type":"boolean","description":"Whether this assignment rule is active","default":true}},"required":["repositoryIdentifier","branchPattern","priority"]},"ReviewPoolAssignmentDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the assignment"},"repositoryIdentifier":{"type":"string","description":"Repository identifier"},"targetType":{"type":"string","description":"Target type: pool or environment","enum":["pool","environment"]},"poolTag":{"type":"string","description":"Pool tag assigned (when targetType is pool)"},"poolType":{"type":"string","description":"Type of pool (SANDBOX or SCRATCH_ORG)","enum":["SANDBOX","SCRATCH_ORG"]},"environmentName":{"type":"string","description":"Dedicated environment name (when targetType is environment)"},"branchPattern":{"type":"string","description":"Branch pattern"},"domainPattern":{"type":"string","description":"Domain pattern - DEPRECATED: Use domainPatterns instead","deprecated":true},"domainPatterns":{"description":"Domain patterns","type":"array","items":{"type":"string"}},"priority":{"type":"number","description":"Priority for conflict resolution"},"description":{"type":"string","description":"Description of the rule"},"isActive":{"type":"boolean","description":"Whether the rule is active"},"createdAt":{"type":"string","description":"Creation timestamp"},"updatedAt":{"type":"string","description":"Last update timestamp"},"createdBy":{"type":"string","description":"User who created the assignment"},"updatedBy":{"type":"string","description":"User who last updated the assignment"},"version":{"type":"number","description":"Document version for optimistic locking"}},"required":["id","repositoryIdentifier","targetType","branchPattern","domainPatterns","priority","isActive","createdAt","updatedAt","createdBy","version"]}}},"paths":{"/sfp/api/review/pools/assign":{"post":{"operationId":"ReviewPoolAssignmentController_create","summary":"Create an assignment rule","description":"Creates a new rule for automatically assigning a pool or dedicated environment to review environments based on branch and domain patterns. Set targetType to \"pool\" to assign from a pool, or \"environment\" to assign a dedicated environment.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReviewPoolAssignmentDto"}}}},"responses":{"201":{"description":"Assignment rule created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewPoolAssignmentDto"}}}},"400":{"description":"Invalid pattern or request data"},"403":{"description":"Forbidden - Requires role: owner, application"},"404":{"description":"Pool or environment not found"},"409":{"description":"Duplicate rule exists"}},"tags":["Review / Assignment Rules"]}}}}
```

## Test pattern matching

> Test which pool or environment would be assigned for a given repository, branch, and domain combination

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.9.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"TestPoolMatchDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier"},"branch":{"type":"string","description":"Branch to test"},"domains":{"description":"Domains to test (supports multiple domains)","type":"array","items":{"type":"string"}}},"required":["repositoryIdentifier","branch"]},"PoolMatchResultDto":{"type":"object","properties":{"matched":{"type":"boolean","description":"Whether a match was found"},"targetType":{"type":"string","description":"Target type of the best match","enum":["pool","environment"]},"poolTag":{"type":"string","description":"Matched pool tag (when targetType is pool)"},"environmentName":{"type":"string","description":"Matched environment name (when targetType is environment)"},"assignment":{"description":"Matched assignment details","allOf":[{"$ref":"#/components/schemas/ReviewPoolAssignmentDto"}]},"matches":{"type":"array","description":"All matching assignments with scores","items":{"type":"object","properties":{"assignment":{"$ref":"#/components/schemas/ReviewPoolAssignmentDto"},"branchScore":{"type":"number"},"domainScore":{"type":"number"},"totalScore":{"type":"number"}}}},"testParams":{"type":"object","description":"Test parameters used"}},"required":["matched","matches","testParams"]},"ReviewPoolAssignmentDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the assignment"},"repositoryIdentifier":{"type":"string","description":"Repository identifier"},"targetType":{"type":"string","description":"Target type: pool or environment","enum":["pool","environment"]},"poolTag":{"type":"string","description":"Pool tag assigned (when targetType is pool)"},"poolType":{"type":"string","description":"Type of pool (SANDBOX or SCRATCH_ORG)","enum":["SANDBOX","SCRATCH_ORG"]},"environmentName":{"type":"string","description":"Dedicated environment name (when targetType is environment)"},"branchPattern":{"type":"string","description":"Branch pattern"},"domainPattern":{"type":"string","description":"Domain pattern - DEPRECATED: Use domainPatterns instead","deprecated":true},"domainPatterns":{"description":"Domain patterns","type":"array","items":{"type":"string"}},"priority":{"type":"number","description":"Priority for conflict resolution"},"description":{"type":"string","description":"Description of the rule"},"isActive":{"type":"boolean","description":"Whether the rule is active"},"createdAt":{"type":"string","description":"Creation timestamp"},"updatedAt":{"type":"string","description":"Last update timestamp"},"createdBy":{"type":"string","description":"User who created the assignment"},"updatedBy":{"type":"string","description":"User who last updated the assignment"},"version":{"type":"number","description":"Document version for optimistic locking"}},"required":["id","repositoryIdentifier","targetType","branchPattern","domainPatterns","priority","isActive","createdAt","updatedAt","createdBy","version"]}}},"paths":{"/sfp/api/review/pools/assign/test":{"post":{"operationId":"ReviewPoolAssignmentController_testMatch","summary":"Test pattern matching","description":"Test which pool or environment would be assigned for a given repository, branch, and domain combination","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestPoolMatchDto"}}}},"responses":{"200":{"description":"Pattern matching test results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolMatchResultDto"}}}},"403":{"description":"Forbidden - Requires role: owner, application"}},"tags":["Review / Assignment Rules"]}}}}
```

## GET /sfp/api/review/pools/assign/{id}

> Get an assignment rule by ID

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.9.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"ReviewPoolAssignmentDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the assignment"},"repositoryIdentifier":{"type":"string","description":"Repository identifier"},"targetType":{"type":"string","description":"Target type: pool or environment","enum":["pool","environment"]},"poolTag":{"type":"string","description":"Pool tag assigned (when targetType is pool)"},"poolType":{"type":"string","description":"Type of pool (SANDBOX or SCRATCH_ORG)","enum":["SANDBOX","SCRATCH_ORG"]},"environmentName":{"type":"string","description":"Dedicated environment name (when targetType is environment)"},"branchPattern":{"type":"string","description":"Branch pattern"},"domainPattern":{"type":"string","description":"Domain pattern - DEPRECATED: Use domainPatterns instead","deprecated":true},"domainPatterns":{"description":"Domain patterns","type":"array","items":{"type":"string"}},"priority":{"type":"number","description":"Priority for conflict resolution"},"description":{"type":"string","description":"Description of the rule"},"isActive":{"type":"boolean","description":"Whether the rule is active"},"createdAt":{"type":"string","description":"Creation timestamp"},"updatedAt":{"type":"string","description":"Last update timestamp"},"createdBy":{"type":"string","description":"User who created the assignment"},"updatedBy":{"type":"string","description":"User who last updated the assignment"},"version":{"type":"number","description":"Document version for optimistic locking"}},"required":["id","repositoryIdentifier","targetType","branchPattern","domainPatterns","priority","isActive","createdAt","updatedAt","createdBy","version"]}}},"paths":{"/sfp/api/review/pools/assign/{id}":{"get":{"operationId":"ReviewPoolAssignmentController_findById","summary":"Get an assignment rule by ID","parameters":[{"name":"id","required":true,"in":"path","description":"Assignment rule ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Assignment rule details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewPoolAssignmentDto"}}}},"403":{"description":"Forbidden - Requires role: member, owner, application"},"404":{"description":"Assignment rule not found"}},"tags":["Review / Assignment Rules"]}}}}
```

## Update an assignment rule

> Update patterns, priority, target, or status of an existing assignment rule

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.9.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"UpdateReviewPoolAssignmentDto":{"type":"object","properties":{"poolType":{"type":"string","description":"Type of pool (SANDBOX or SCRATCH_ORG)","enum":["SANDBOX","SCRATCH_ORG"]},"branchPattern":{"type":"string","description":"Git branch pattern to match"},"domainPattern":{"type":"string","description":"Domain pattern to match - DEPRECATED: Use domainPatterns instead","deprecated":true},"domainPatterns":{"description":"Domain patterns to match (supports wildcards, leave empty to match any domain)","type":"array","items":{"type":"string"}},"environmentName":{"type":"string","description":"Name of dedicated environment (only for environment-targeted rules)"},"priority":{"type":"number","description":"Priority for conflict resolution","minimum":0,"maximum":1000},"description":{"type":"string","description":"Optional description explaining the assignment rule"},"isActive":{"type":"boolean","description":"Whether this assignment rule is active"}}},"ReviewPoolAssignmentDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the assignment"},"repositoryIdentifier":{"type":"string","description":"Repository identifier"},"targetType":{"type":"string","description":"Target type: pool or environment","enum":["pool","environment"]},"poolTag":{"type":"string","description":"Pool tag assigned (when targetType is pool)"},"poolType":{"type":"string","description":"Type of pool (SANDBOX or SCRATCH_ORG)","enum":["SANDBOX","SCRATCH_ORG"]},"environmentName":{"type":"string","description":"Dedicated environment name (when targetType is environment)"},"branchPattern":{"type":"string","description":"Branch pattern"},"domainPattern":{"type":"string","description":"Domain pattern - DEPRECATED: Use domainPatterns instead","deprecated":true},"domainPatterns":{"description":"Domain patterns","type":"array","items":{"type":"string"}},"priority":{"type":"number","description":"Priority for conflict resolution"},"description":{"type":"string","description":"Description of the rule"},"isActive":{"type":"boolean","description":"Whether the rule is active"},"createdAt":{"type":"string","description":"Creation timestamp"},"updatedAt":{"type":"string","description":"Last update timestamp"},"createdBy":{"type":"string","description":"User who created the assignment"},"updatedBy":{"type":"string","description":"User who last updated the assignment"},"version":{"type":"number","description":"Document version for optimistic locking"}},"required":["id","repositoryIdentifier","targetType","branchPattern","domainPatterns","priority","isActive","createdAt","updatedAt","createdBy","version"]}}},"paths":{"/sfp/api/review/pools/assign/{id}":{"put":{"operationId":"ReviewPoolAssignmentController_update","summary":"Update an assignment rule","description":"Update patterns, priority, target, or status of an existing assignment rule","parameters":[{"name":"id","required":true,"in":"path","description":"Assignment rule ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReviewPoolAssignmentDto"}}}},"responses":{"200":{"description":"Assignment rule updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewPoolAssignmentDto"}}}},"400":{"description":"Invalid pattern or request data"},"403":{"description":"Forbidden - Requires role: owner, application"},"404":{"description":"Assignment rule not found"},"409":{"description":"Duplicate rule would be created"}},"tags":["Review / Assignment Rules"]}}}}
```

## DELETE /sfp/api/review/pools/assign/{id}

> Delete an assignment rule

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.9.0"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/review/pools/assign/{id}":{"delete":{"operationId":"ReviewPoolAssignmentController_delete","summary":"Delete an assignment rule","parameters":[{"name":"id","required":true,"in":"path","description":"Assignment rule ID","schema":{"type":"string"}}],"responses":{"204":{"description":"Assignment rule deleted successfully"},"404":{"description":"Assignment rule not found"}},"tags":["Review / Assignment Rules"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp-server/api-reference/review-assignment-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
