> For the complete documentation index, see [llms.txt](https://docs.r0app.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r0app.com/api/prm-resources/your-relationships.md).

# Your relationships

{% hint style="warning" %}
This endpoint is a BETA endpoint and not currently available in the mobile or web application.
{% endhint %}

You can add relationships with your contacts to keep track of relationship data like anniversary date and your relation to the individual. This relationship data can then be used to trigger notifications and other actions at a later date.

### View your relationships

{% hint style="danger" %}
Please note this endpoint returns a list of relationships **you create** with your contact(s). This does not return your entire contact list. To view those endpoints, [click here](/api/prm-resources/contacts.md).
{% endhint %}

## Fetch a list of a user's relationships

<mark style="color:blue;">`GET`</mark> `https://web.r0app.com/api/v1/orgs/:org_id/user_relationships`

Returns a list of relationships created for a given user. The user is determined via the owner of the token provided in the header.

#### Query Parameters

| Name       | Type    | Description                                                                                                                                                        |
| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| include\[] | String  | If set to `deleted` all active and [deleted records](/api/introduction/deleting-resources.md) will be returned in the response.                                    |
| page       | Integer | For more info, see the [pagination section ](/api/introduction/getting-started.md#pagination)in the [Getting started](/api/introduction/getting-started.md) guide. |
| limit      | Integer | For more info, see the [pagination section ](/api/introduction/getting-started.md#pagination)in the [Getting started](/api/introduction/getting-started.md) guide. |

#### Example request

{% tabs %}
{% tab title="curl" %}

```sh
curl https://web.r0app.com/api/v1/orgs/:org_id/user_relationships \
    -X GET \
    -H 'Authorization: Bearer <token>'
```

{% endtab %}
{% endtabs %}

### View an individual relationship

## Fetch an individual user relationship record

<mark style="color:blue;">`GET`</mark> `https://web.r0app.com/api/v1/orgs/:org_id/user_relationships/:user_relationship_id`

#### Example request

{% tabs %}
{% tab title="curl" %}

```sh
curl https://web.r0app.com/api/v1/orgs/:org_id/user_relationships/:user_relationship_id \
    -X GET \
    -H 'Authorization: Bearer <token>'
```

{% endtab %}
{% endtabs %}

### Create a relationship

## Create a user relationship record

<mark style="color:green;">`POST`</mark> `https://web.r0app.com/api/v1/orgs/:org_id/user_relationships`

Creates a relationship record with the token bearer and a given contact.

#### Request Body

| Name                                                                    | Type   | Description                                                                            |
| ----------------------------------------------------------------------- | ------ | -------------------------------------------------------------------------------------- |
| user\_relationship\[contact\_id]<mark style="color:red;">\*</mark>      | String | UUID for [the contact](/api/prm-resources/contacts.md) in the relationship.            |
| user\_relationship\[anniversary\_date]                                  |        | yyyy-mm-dd format. [Learn more](/api/introduction/getting-started.md#dates-and-times). |
| user\_relationship\[relationship\_id]<mark style="color:red;">\*</mark> | String | ID of the type of relationship. [Learn more](/api/account-resources/relationships.md). |

#### Example request

{% tabs %}
{% tab title="curl" %}

```sh
curl https://web.r0app.com/api/v1/orgs/:org_id/user_relationships \
    -X POST \
    -H 'Authorization: Bearer <token>' \
    -d 'user_relationship[contact_id]=17659d00-8866-44b7-bde3-ec9816652da9' \
    -d 'user_relationship[anniversary_date]=2020-07-22' \
    -d 'user_relationship[relationship_id]=85fb935d-1601-4695-9e88-3e63ff019f68'
```

{% endtab %}
{% endtabs %}

### Update a relationship

## Update a relationship record

<mark style="color:purple;">`PATCH`</mark> `https://web.r0app.com/api/v1/orgs/:org_id/user_relationships/:user_relationship_id`

#### Path Parameters

| Name                                                      | Type   | Description                                                  |
| --------------------------------------------------------- | ------ | ------------------------------------------------------------ |
| :user\_relationship\_id<mark style="color:red;">\*</mark> | String | When editing the UUID should be included as a path parameter |

#### Request Body

| Name                                                                     | Type | Description                                                                            |
| ------------------------------------------------------------------------ | ---- | -------------------------------------------------------------------------------------- |
| user\_relationship\[anniversary\_date]<mark style="color:red;">\*</mark> |      | yyyy-mm-dd format. [Learn more](/api/introduction/getting-started.md#dates-and-times). |

#### Example request

{% tabs %}
{% tab title="curl" %}

```sh
curl https://web.r0app.com/api/v1/orgs/:org_id/user_relationships/:user_relationship_id \
    -X PATCH \
    -H 'Authorization: Bearer <token>' \
    -d 'user_relationship[anniversary_date]=2019-07-22' \
```

{% endtab %}
{% endtabs %}

### Delete a relationship connection

## Delete a relationship record

<mark style="color:red;">`DELETE`</mark> `https://web.r0app.com/api/v1/orgs/:org_id/user_relationships/:user_relationship_id`

#### Path Parameters

| Name                                                      | Type   | Description                             |
| --------------------------------------------------------- | ------ | --------------------------------------- |
| :user\_relationship\_id<mark style="color:red;">\*</mark> | String | UUID of the relationship to be deleted. |

#### Example request

{% tabs %}
{% tab title="curl" %}

```sh
curl https://web.r0app.com/api/v1/orgs/:org_id/user_relationships/:user_relationship_id \
    -X DELETE \
    -H 'Authorization: Bearer <token>'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.r0app.com/api/prm-resources/your-relationships.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
