> ## 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 Options

> Get the list of available relationship types for a specific OMOP concept so you can filter, paginate, or traverse only the links you care about.

## Overview

This endpoint returns all available relationship types that exist for a specific concept. This is useful for building dynamic UI components like dropdowns and understanding what relationships are available for a concept.

## Path Parameters

**conceptId** `integer` *required*

The unique OMOP concept ID to get relationship options for

## Query Parameters

**vocab\_release** `string`

Specific vocabulary release version (e.g., "2025.1")

## Response

**success** `boolean` *required*

Indicates whether the request was successful

**data** `object` *required*

Response data containing relationship options

**data**

**concept\_id** `integer`

The concept ID that was queried

**available\_relationships** `array`

Array of available relationship types for this concept

**available\_relationships**

**id** `string`

Unique relationship type ID (e.g., "Is a", "Maps to")

**name** `string`

Human-readable relationship name

**meta** `object` *required*

Response metadata

**meta**

**request\_id** `string`

Unique request identifier

**timestamp** `string`

ISO 8601 timestamp

**vocab\_release** `string`

Vocabulary release version used

```bash cURL theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

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

concept_id = 201826  # Type 2 diabetes
url = f"https://api.omophub.com/v1/concepts/{concept_id}/relationships/options"

headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

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

print(f"Concept ID: {data['data']['concept_id']}")
print("Available relationship types:")
for rel in data['data']['available_relationships']:
    print(f"  - {rel['name']} ({rel['id']})")
```

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

// Not yet exposed as a dedicated SDK method - use the typed low-level helper.
const client = new OMOPHub();

interface RelationshipOptions {
  concept_id: number;
  available_relationships: Array<{ id: string; name: string }>;
}

const conceptId = 201826; // Type 2 diabetes
const { data } = await client.get<RelationshipOptions>(
  `/concepts/${conceptId}/relationships/options`
);

console.log(`Concept ID: ${data?.concept_id}`);
console.log('Available relationships:');
data?.available_relationships.forEach(rel => {
  console.log(`  - ${rel.name} (${rel.id})`);
});
```

```json theme={null}
{
  "success": true,
  "data": {
    "concept_id": 201826,
    "available_relationships": [
      {
        "id": "Is a",
        "name": "Is a"
      },
      {
        "id": "Maps to",
        "name": "Maps to"
      },
      {
        "id": "Mapped from",
        "name": "Mapped from"
      },
      {
        "id": "Subsumes",
        "name": "Subsumes"
      }
    ]
  },
  "meta": {
    "request_id": "req_relationship_options_123",
    "timestamp": "2024-12-22T10:00:00Z",
    "vocab_release": "2025.1"
  }
}
```

## Usage Examples

### Basic Relationship Options

Get all available relationship types for a concept:

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

### With Specific Vocabulary Version

Get relationship options for a specific vocabulary release:

```bash theme={null}
curl -X GET "https://api.omophub.com/v1/concepts/201826/relationships/options?vocab_release=2025.1" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### UI Dropdown Integration

Use in a dropdown component:

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

const client = new OMOPHub();

interface RelOption {
  id: string;
  name: string;
}

async function loadRelationshipOptions(conceptId: number) {
  const { data } = await client.get<{ available_relationships: RelOption[] }>(
    `/concepts/${conceptId}/relationships/options`
  );
  return (
    data?.available_relationships.map(rel => ({
      value: rel.id,
      label: rel.name,
    })) ?? []
  );
}

// Use in UI
const options = await loadRelationshipOptions(201826);
const selectHtml = options
  .map(opt => `<option value="${opt.value}">${opt.label}</option>`)
  .join('');
```

## Important Notes

* **Dynamic options** - Available relationship types vary by concept
* **Both directions** - Returns relationships where the concept is either source or target
* **Valid only** - Only returns relationships with valid (non-deprecated) status

## Related Endpoints

* [Get Concept Relationships](https://docs.omophub.com/api-reference/relationships/get-concept-relationships.md) - Get actual relationships for a concept
* [Get Relationship Types](https://docs.omophub.com/api-reference/relationships/get-relationship-types.md) - Get all relationship types in the system


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