Skip to content
Fresh 2026

Get custom regex rule (Tool Pack) ​

GET https://ah-api.merge.dev/api/v1/tool-packs/{tool_pack_id}/custom-regex-rules/{rule_id}/

Retrieve a single custom regex rule for a tool pack by ID.

Reference: https://docs.merge.dev/merge-agent-handler/agent-handler/custom-regex-rules/get-custom-regex-rule-tool-pack

OpenAPI Specification ​

yaml
openapi: 3.1.0
info:
  title: agent-handler
  version: 1.0.0
paths:
  /api/v1/tool-packs/{tool_pack_id}/custom-regex-rules/{rule_id}/:
    get:
      operationId: get-custom-regex-rule-tool-pack
      summary: Get custom regex rule (Tool Pack)
      description: Retrieve a single custom regex rule for a tool pack by ID.
      tags:
        - subpackage_customRegexRules
      parameters:
        - name: rule_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: tool_pack_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: Authorization
          in: header
          description: Token-based authentication with required prefix "Bearer"
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicCombinedCustomRegexRule'
servers:
  - url: https://ah-api.merge.dev
    description: Production server
components:
  schemas:
    PublicCombinedCustomRegexRule:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        regex:
          type: string
        score:
          type: number
          format: double
        context_keywords:
          description: Any type
        is_active:
          type: boolean
        outbound_action:
          type: string
        defined_at:
          type: string
      required:
        - id
        - name
        - regex
        - score
        - context_keywords
        - is_active
        - outbound_action
        - defined_at
      description: Custom regex rule with effective configuration for a tool pack.
      title: PublicCombinedCustomRegexRule
  securitySchemes:
    tokenAuth:
      type: http
      scheme: bearer
      description: Token-based authentication with required prefix "Bearer"

Examples ​

Response

json
{
  "id": "string",
  "name": "string",
  "regex": "string",
  "score": 1.1,
  "is_active": true,
  "outbound_action": "string",
  "defined_at": "string"
}

SDK Code

python
import requests

url = "https://ah-api.merge.dev/api/v1/tool-packs/tool_pack_id/custom-regex-rules/rule_id/"

headers = {"Authorization": "Bearer "}

response = requests.get(url, headers=headers)

print(response.json())
javascript
const url = 'https://ah-api.merge.dev/api/v1/tool-packs/tool_pack_id/custom-regex-rules/rule_id/';
const options = {method: 'GET', headers: {Authorization: 'Bearer '}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://ah-api.merge.dev/api/v1/tool-packs/tool_pack_id/custom-regex-rules/rule_id/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer ")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
ruby
require 'uri'
require 'net/http'

url = URI("https://ah-api.merge.dev/api/v1/tool-packs/tool_pack_id/custom-regex-rules/rule_id/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer '

response = http.request(request)
puts response.read_body
java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse response = Unirest.get("https://ah-api.merge.dev/api/v1/tool-packs/tool_pack_id/custom-regex-rules/rule_id/")
  .header("Authorization", "Bearer ")
  .asString();
php
request('GET', 'https://ah-api.merge.dev/api/v1/tool-packs/tool_pack_id/custom-regex-rules/rule_id/', [
  'headers' => [
    'Authorization' => 'Bearer ',
  ],
]);

echo $response->getBody();
csharp
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/tool-packs/tool_pack_id/custom-regex-rules/rule_id/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer ");
IRestResponse response = client.Execute(request);
swift
import Foundation

let headers = ["Authorization": "Bearer "]

let request = NSMutableURLRequest(url: NSURL(string: "https://ah-api.merge.dev/api/v1/tool-packs/tool_pack_id/custom-regex-rules/rule_id/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()

Unofficial documentation reference. Built for internal use.