---
title: "Search for a relationship"
method: GET
path: "/OrganizationAffiliation"
---

# Search for a relationship

`GET /OrganizationAffiliation`

## Overview
Use this endpoint to search for relationship records. Most commonly you would use this endpoint to get all the relationships for a given organisation, based on its ODS code. 

A FHIR OrganizationAffiliation Resource will be returned when a valid id is provided. Refer to our [Implementation Guidance](https://simplifier.net/guide/organisation-data-services/Home/FHIR-Assets/Profiles#UKCore-OrganizationAffiliation) pages for profiles and other FHIR assets.

For relationships, this API returns the following details: 

  * related organisation ODS code 
  * relationship type and relationship name 
  * relationship legal start and end dates 
  * relationship operational start and end dates
  
you can search using various combinations of:

  * 'primary-organization' - known within the ORD products as the Source Organisation
  * 'participating-organization' - known within the ORD products as the Target Organisation
  * relationship status 
  
It is also possible to return the relevant Organization Resources in these searches using the `_include` parameter.

You can try out the sandbox using the 'Try this API' feature on this page.

Alternatively, you can try out the sandbox using our Postman collection:

[![Run in Postman](https://run.pstmn.io/button.svg)](https://documenter.getpostman.com/view/26163840/2sA3dvmD94)

## Query parameters

- `_id` string
- `primary-organization` string
- `participating-organization` string
- `active` boolean
- `_count` string
- `_include` string
- `_summary` 'count'

## Response `200`

Valid request that returns any FHIR OrganizationAffiliation resources that match the search criteria (which may be 0).

## Other responses

- `4XX` — An error occurred as follows: | HTTP Code | issue.severity | issue.code | issue.details.code | issue.details.display | |------------ |----------------|---------------|---------------------|--------------------- | |400 |error |invalid |HAPI-1940 |Invalid Date/Time/Quantity format | |400 |error |invalid |HAPI-0524 |Unknown Search Parameter| |404 |error |invalid |HAPI-2001 |Organization not found | |405 |error |method not allowed|HAPI-0427 |Method Not Allowed |

---

[API](https://skmtc.net/nhs/apis/organisation-data-terminology-api-2.md) · [All operations](https://skmtc.net/nhs/apis/organisation-data-terminology-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nhs/organisation-data-terminology-api-2/versions/c2df8e70fcf4/schema)
