---
title: "Extract relationships from input"
method: POST
path: "/relationships"
tags: ["relationships"]
---

# Extract relationships from input

`POST /relationships`

## Request

- Base URL: `https://api.rosette.com/rest/v1`
- URL: `https://api.rosette.com/rest/v1/relationships`
- Auth: API key in header `X-RosetteAPI-Key`

Returns the relationships between entities in the input text. <br><br> The response is a list of extracted relationships. A relationship contains <br><br> predicate - usually the main verb, property or action that is expressed by the text<br> arg1 - usually the subject, agent or main actor of the relationship<br> arg1Id [optional] - the entity ID to link an entity to a knowledgebase <br> arg2 [optional] - complements the predicate and is usually the object, theme or patient of the relationship<br> arg2Id [optional] - the entity ID to link an entity to a knowledgebase<br> confidence - a measure of quality of relationship extraction, between 0 - 1

## Request body

- union
  - object
    - `content` string
    - `language` string: 3 letter code of language.
  - object
    - `contentUri` string
    - `language` string: 3 letter code of language.

## Response `200`

OK

- object
  - `relationships` RelationshipResponse[]
    - `arg1` string: relationship arg1
    - `arg1id` string: relationship arg1 id
    - `arg2` string: relationship arg2
    - `arg2id` string: relationship arg2 id
    - `confidence` number: a measure of the quality of relationship extraction
    - `predicate` string: relationship type or predicate

---

[API](https://skmtc.dev/babelstreet/apis/rosette-text-analytics.md) · [All operations](https://skmtc.dev/babelstreet/apis/rosette-text-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/babelstreet/apis/rosette-text-analytics/revisions/7c1d1497a5dd?raw)
