> For the complete documentation index, see [llms.txt](https://guide.fariaedu.com/integrations-portal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.fariaedu.com/integrations-portal/openapply/public-rest-apis/v3/relationships.md).

# Relationships

This page describes all the APIs relating to relationships.

## List All Relationships

> Retrieve all student-parent relationships in the school.\
> \
> This endpoint returns a paginated list of students with their associated parent IDs,\
> providing a mapping of family relationships within the school system.\
> \
> The response includes:\
> \- Student ID and their associated parent IDs\
> \- Pagination metadata\
> \
> This is useful for understanding family structures and parent-child relationships.<br>

```json
{"openapi":"3.0.1","info":{"title":"openapply","version":"3.0.0"},"tags":[{"name":"Relationships","description":"This page describes all the APIs relating to relationships."}],"servers":[{"url":"https://api.openapply.com","description":"CAN region auth server"},{"url":"https://api.openapply.cn","description":"CN region auth server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/api/v3/relationships":{"get":{"summary":"List All Relationships","tags":["Relationships"],"operationId":"ListRelationships","description":"Retrieve all student-parent relationships in the school.\n\nThis endpoint returns a paginated list of students with their associated parent IDs,\nproviding a mapping of family relationships within the school system.\n\nThe response includes:\n- Student ID and their associated parent IDs\n- Pagination metadata\n\nThis is useful for understanding family structures and parent-child relationships.\n","parameters":[{"name":"page","in":"query","required":false,"description":"The page number of results to return.","schema":{"type":"integer","minimum":1,"default":1}},{"name":"per_page","in":"query","required":false,"description":"Request for how many records to return.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"count","in":"query","required":false,"description":"Synonym for per_page","schema":{"type":"integer"}}],"responses":{"200":{"description":"successful","content":{"application/json":{"schema":{"type":"object","properties":{"relationships":{"type":"array","items":{"type":"object","properties":{"parent_id":{"type":"integer","description":"Unique identifier for the parent"},"student_ids":{"type":"array","items":{"type":"integer"},"description":"Array of student IDs associated with this parent"},"relationships":{"type":"array","items":{"type":"object","properties":{"student_id":{"type":"integer","description":"Student ID"},"relationship":{"type":"string","description":"Relationship role between parent and student"}}},"description":"Array of relationship objects between parent and students"}}}},"meta":{"type":"object","properties":{"pages":{"type":"integer","description":"Total number of pages available"},"per_page":{"type":"integer","description":"Number of records per page"}},"required":["pages","per_page"]}},"required":["relationships","meta"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}
```

## Get a Parent's Child Relationships

> Fetch the associated children to the given parent<br>

```json
{"openapi":"3.0.1","info":{"title":"openapply","version":"3.0.0"},"tags":[{"name":"Relationships","description":"This page describes all the APIs relating to relationships."}],"servers":[{"url":"https://api.openapply.com","description":"CAN region auth server"},{"url":"https://api.openapply.cn","description":"CN region auth server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/api/v3/relationships/parent/{id}":{"get":{"summary":"Get a Parent's Child Relationships","tags":["Relationships"],"operationId":"getParentRelationships","description":"Fetch the associated children to the given parent\n","parameters":[{"name":"id","in":"path","required":true,"description":"Serial database ID used to refer to a unique parent record in OpenApply","schema":{"type":"integer"}}],"responses":{"200":{"description":"successful","content":{"application/json":{"schema":{"type":"object","properties":{"parent_id":{"type":"integer","description":"Unique identifier for the parent"},"student_ids":{"type":"array","items":{"type":"integer"},"description":"Array of student IDs associated with this parent"},"relationships":{"type":"array","items":{"type":"object","properties":{"student_id":{"type":"integer","description":"Student ID"},"relationship":{"type":"string","description":"Relationship role between parent and student"}}},"description":"Array of relationship objects between parent and students"}}}}}},"404":{"description":"parent not found"}}}}}}
```

## Update a Parent-Student Relationship

> Update the relationships between a parent and their children. Accepts an array of relationship objects, each specifying a student\_id and an optional relationship role.<br>

```json
{"openapi":"3.0.1","info":{"title":"openapply","version":"3.0.0"},"tags":[{"name":"Relationships","description":"This page describes all the APIs relating to relationships."}],"servers":[{"url":"https://api.openapply.com","description":"CAN region auth server"},{"url":"https://api.openapply.cn","description":"CN region auth server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/api/v3/relationships/parent/{id}":{"put":{"summary":"Update a Parent-Student Relationship","tags":["Relationships"],"operationId":"updateParentRelationships","description":"Update the relationships between a parent and their children. Accepts an array of relationship objects, each specifying a student_id and an optional relationship role.\n","parameters":[{"name":"id","in":"path","required":true,"description":"Serial database ID used to refer to a unique parent record in OpenApply","schema":{"type":"integer"}}],"responses":{"200":{"description":"successful","content":{"application/json":{"schema":{"type":"object","properties":{"student_ids":{"type":"array","items":{"type":"integer"},"description":"Array of student IDs associated with this parent"},"relationships":{"type":"array","items":{"type":"object","properties":{"student_id":{"type":"integer","description":"Student ID"},"relationship":{"type":"string","description":"Relationship role between parent and student"}}},"description":"Array of relationship objects between parent and students"}}}}}},"422":{"description":"unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"relationships":{"type":"array","items":{"type":"object","properties":{"student_id":{"type":"integer"},"relationship":{"type":"string","nullable":true,"description":"Relationship role (optional)"}},"required":["student_id"]}}},"required":["relationships"]}}},"required":true}}}}}
```

## Get a Student's Parent Relationships

> Fetch the associated parents and relationship roles for the given student.<br>

```json
{"openapi":"3.0.1","info":{"title":"openapply","version":"3.0.0"},"tags":[{"name":"Relationships","description":"This page describes all the APIs relating to relationships."}],"servers":[{"url":"https://api.openapply.com","description":"CAN region auth server"},{"url":"https://api.openapply.cn","description":"CN region auth server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/api/v3/relationships/student/{id}":{"get":{"summary":"Get a Student's Parent Relationships","tags":["Relationships"],"operationId":"getStudentRelationships","description":"Fetch the associated parents and relationship roles for the given student.\n","parameters":[{"name":"id","in":"path","required":true,"description":"Serial database ID used to refer to a unique student record in OpenApply","schema":{"type":"integer"}}],"responses":{"200":{"description":"successful","content":{"application/json":{"schema":{"type":"object","properties":{"parent_id":{"type":"integer","description":"Unique identifier for the parent"},"student_ids":{"type":"array","items":{"type":"integer"},"description":"Array of student IDs associated with this parent"},"relationships":{"type":"array","items":{"type":"object","properties":{"student_id":{"type":"integer","description":"Student ID"},"relationship":{"type":"string","description":"Relationship role between parent and student"}}},"description":"Array of relationship objects between parent and students"}}}}}},"404":{"description":"student not found"}}}}}}
```
