Your relationships

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

Fetch a list of a user's relationships

GET 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 will be returned in the response.

page

Integer

For more info, see the pagination section in the Getting started guide.

limit

Integer

For more info, see the pagination section in the Getting started guide.

Example request

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

View an individual relationship

Fetch an individual user relationship record

GET https://web.r0app.com/api/v1/orgs/:org_id/user_relationships/:user_relationship_id

Example request

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

Create a relationship

Create a user relationship record

POST 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]*

String

UUID for the contact in the relationship.

user_relationship[anniversary_date]

yyyy-mm-dd format. Learn more.

user_relationship[relationship_id]*

String

ID of the type of relationship. Learn more.

Example request

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'

Update a relationship

Update a relationship record

PATCH https://web.r0app.com/api/v1/orgs/:org_id/user_relationships/:user_relationship_id

Path Parameters

Name
Type
Description

:user_relationship_id*

String

When editing the UUID should be included as a path parameter

Request Body

Name
Type
Description

user_relationship[anniversary_date]*

yyyy-mm-dd format. Learn more.

Example request

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' \

Delete a relationship connection

Delete a relationship record

DELETE https://web.r0app.com/api/v1/orgs/:org_id/user_relationships/:user_relationship_id

Path Parameters

Name
Type
Description

:user_relationship_id*

String

UUID of the relationship to be deleted.

Example request

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

Last updated

Was this helpful?