> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omophub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Relationship Types

> Retrieve all available OMOP relationship types - Maps to, Is a, Subsumes, and the complete set of OHDSI-defined links between medical concepts.

This endpoint returns all relationship types from the OMOP CDM RELATIONSHIP table, which defines the types of connections that can exist between concepts.

## Query Parameters

**page** `integer` (default: 1)

Page number for pagination (1-based)

**page\_size** `integer` (default: 100)

Number of relationship types to return per page. Values above 200 are clamped
to 200.

**vocab\_release** `string`

Specific vocabulary release version

**Example:** `2025.1`

## Response

**success** `boolean`

Whether relationship-type retrieval completed.

**data** `object`

Relationship type list and summary.

**data.relationship\_types** `array`

Array of relationship type objects from the OMOP CDM RELATIONSHIP table

**Relationship Type Object**

**relationship\_id** `string`

Unique identifier for the relationship type (e.g., "Is a", "Maps to")

**relationship\_name** `string`

Display name of the relationship type

**is\_hierarchical** `string`

Whether this relationship creates hierarchical structure ("0" or "1")

**defines\_ancestry** `string`

Whether this relationship is used in CONCEPT\_ANCESTOR computation ("0" or "1")

**reverse\_relationship\_id** `string`

The relationship\_id of the reverse relationship (e.g., "Subsumes" for "Is a")

**relationship\_concept\_id** `integer`

Concept ID representing this relationship type in the CONCEPT table

**meta** `object`

Response metadata including pagination

**Metadata Object**

**pagination** `object`

**page** `integer`

Current page number

**page\_size** `integer`

Items per page

**total\_items** `integer`

Total relationship types

**total\_pages** `integer`

Total number of pages

**has\_next** `boolean`

Whether next page exists

**has\_previous** `boolean`

Whether previous page exists

**request\_id** `string`

Unique request identifier

**vocab\_release** `string`

Vocabulary release version used

```bash cURL theme={null}
curl "https://api.omophub.com/v1/relationships/types?page_size=50" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python Python theme={null}
import requests

url = "https://api.omophub.com/v1/relationships/types"
params = {"page_size": 50}
headers = {"Authorization": "Bearer YOUR_API_KEY"}

response = requests.get(url, params=params, headers=headers)
data = response.json()

print(f"Total relationship types: {data['meta']['pagination']['total_items']}")
for rel_type in data['data']['relationship_types']:
    hierarchical = "Yes" if rel_type['is_hierarchical'] == '1' else "No"
    print(f"  {rel_type['relationship_id']} -> {rel_type['reverse_relationship_id']} (Hierarchical: {hierarchical})")
```

```ts TypeScript theme={null}
import { OMOPHub } from '@omophub/omophub-node';

const client = new OMOPHub();
const { data, meta } = await client.relationships.types({ pageSize: 50 });
console.log(`Found ${meta?.pagination?.total_items} relationship types`);

data?.relationship_types.forEach(type => {
  console.log(`${type.relationship_id} <-> ${type.reverse_relationship_id}`);
});
```

```json theme={null}
{
  "success": true,
  "data": {
    "relationship_types": [
      {
        "relationship_id": "Is a",
        "relationship_name": "Is a",
        "is_hierarchical": "1",
        "defines_ancestry": "1",
        "reverse_relationship_id": "Subsumes",
        "relationship_concept_id": 44818821
      },
      {
        "relationship_id": "Maps to",
        "relationship_name": "Maps to",
        "is_hierarchical": "0",
        "defines_ancestry": "0",
        "reverse_relationship_id": "Mapped from",
        "relationship_concept_id": 44818981
      },
      {
        "relationship_id": "Has finding site",
        "relationship_name": "Has finding site",
        "is_hierarchical": "0",
        "defines_ancestry": "0",
        "reverse_relationship_id": "Finding site of",
        "relationship_concept_id": 44818788
      }
    ]
  },
  "meta": {
    "request_id": "req_abc123",
    "vocab_release": "2025.1",
    "pagination": {
      "page": 1,
      "page_size": 100,
      "total_items": 642,
      "total_pages": 7,
      "has_next": true,
      "has_previous": false
    }
  }
}
```

## Usage Examples

### All Relationship Types

Get all available relationship types:

```bash theme={null}
curl "https://api.omophub.com/v1/relationships/types" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Paginated Results

Navigate through pages of relationship types:

```bash theme={null}
curl "https://api.omophub.com/v1/relationships/types?page=2&page_size=50" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Related Endpoints

* [Get Concept Relationships](https://docs.omophub.com/api-reference/relationships/get-concept-relationships.md) - Relationships for specific concepts
* [Get Concept Mappings](https://docs.omophub.com/api-reference/mappings/get-concept-mappings.md) - Cross-vocabulary mappings
* [Get Vocabularies](https://docs.omophub.com/api-reference/vocabulary/get-vocabularies) - Available vocabularies

## Notes

* Relationship types come from the OMOP CDM RELATIONSHIP table
* All relationships exist symmetrically (both directions)
* Hierarchical relationships (like "Is a") are used to build the CONCEPT\_ANCESTOR table
* The `defines_ancestry` field indicates which relationships contribute to ancestor computation
* Each relationship type has a corresponding concept in the CONCEPT table


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.