---
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. 

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-Organisation - known within the ORD products as the Source Organisation
  * Participating-Organisation - 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

## Query parameters

- `_id` string
- `primary-organisation` 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-service-fhir-api.md) · [All operations](https://skmtc.net/nhs/apis/organisation-data-service-fhir-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nhs/organisation-data-service-fhir-api/versions/6cf3c5d3b6d3/schema)
