# Relationship search

## Relationship search

<mark style="color:green;">`POST`</mark> `https://ris.rightsline.com/v4/relationship/search`

This endpoint allows you to search for a specific relationship between entities.

#### Headers

| Name           | Type   | Description             |
| -------------- | ------ | ----------------------- |
| x-api-key      | string | Your company's API key. |
| Authentication | string | Authentication token.   |

#### Request Body

| Name       | Type   | Description                       |
| ---------- | ------ | --------------------------------- |
| query      | string | The search query.                 |
| sortOrders | array  | The order to sort the result set. |

{% tabs %}
{% tab title="200 A result set of relationships that match the search query." %}

```javascript
{
  "numFound": 1,
  "entities": [
    {
      "id": 401961455,
      "relationshipType": {
        "relationshipTypeId": 0,
        "relationshipTypeName": "Default"
      },
      "createdById": 1,
      "createdDate": "2020-06-03T02:09:48.970Z",
      "lastUpdatedById": 1,
      "lastUpdatedDate": "2020-06-03T02:09:48.970Z",
      "parentCharTypeId": 4,
      "parentRecordId": 1000,
      "parentTemplate": {
        "templateId": 1,
        "templateName": "Rights In"
      },
      "parentStatus": {
        "statusId": 1,
        "statusName": "Active"
      },
      "childCharTypeId": 1,
      "childRecordId": 1,
      "childTemplate": {
        "templateId": 1,
        "templateName": "Feature"
      },
      "childStatus": {
      "statusId": 1,
        "statusName": "Active"
      },
      "sequenceNumber": 1482159542272
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Example Request

#### Request all relationships between deal ID #4 and child rights, sorted by most recently created date.

```javascript
{
    "query": {
        "$and":[
            {"$eq":["parentrecordid", 4]},
            {"$eq":["parentchartypeid", 4]},
            {"$eq":["childchartypeid", 3]}
        ]
    },
    "sortOrders": [
        "created desc"
    ]
}

```


---

# 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/search-rel.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.
