# Search relationships, filtering by template of child record

This join query will filter the relationships returned by the template of the child records in the relationships. The example below is getting all rights (chartypeid 3) for a deal (chartypeid 4, record id 444) where those child rights are of a specific template (templateid 1).

```
POST - https://ris.rightsline.com/v4/relationship/search
{
    "query": {
        "$and": [
            {
                "$eq": [
                    "parentchartypeid",
                    4
                ]
            },
            {
                "$eq": [
                    "parentrecordid",
                    444
                ]
            },
            {
                "$eq": [
                    "childchartypeid",
                    3
                ]
            },
            {
                "$join": [
                    3,
                    "recordid",
                    "childrecordid",
                    {
                        "$eq": [
                            "templateid",
                            1
                        ]
                    }
                ]
            }
        ]
    }
}

```


---

# 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://api-docs.rightsline.com/search/examples/search-relationships-filtering-by-template-of-child-record.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.
