> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidoc.dreamclass.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidoc.dreamclass.io/_mcp/server.

# GetStudentGuardians

GET https://api.dreamclass.io/dreamclassapi/v1/students/records/get/{studentId}/guardians

Get the guardians (parents) of a student, each with their relation to the student.

Input variables

- studentId: id of the student. Check the GetStudents call

The student must belong to your school. Each entry has the same shape as the `guardians` list in GetStudent; relation ids are those of GetRelations.

Reference: https://apidoc.dreamclass.io/dream-class-api/students/get-student-guardians

## Servers

- `https://api.dreamclass.io` (https://api.dreamclass.io, default)
- `https://your-webhook-url` (https://your-webhook-url)

## Request

### Path parameters

- `studentId` (string, required)

### Headers

- `dreamclass-secret-key` (string, optional) — Your DreamClass API key. Required on every request. Find it in the DreamClass app under Settings > Integrations.
- `tenant` (string, optional) — Your tenant code: the DreamClass subdomain you sign in at (for https://myaccount.dreamclass.io it is "myaccount"), or your full white-labelled domain. Required on every request.
- `schoolCode` (string, optional) — Your school code. Required on every request. Find it in the DreamClass app under Settings > Integrations.

## Response

### 200

OK

- `list of DreamclassapiV1StudentsRecordsGetStudentIdGuardiansGetResponsesContentApplicationJsonSchemaItems`

## Types

### DreamclassapiV1StudentsRecordsGetStudentIdGuardiansGetResponsesContentApplicationJsonSchemaItems

- `guardian` (DreamclassapiV1StudentsRecordsGetStudentIdGuardiansGetResponsesContentApplicationJsonSchemaItemsGuardian, required)
- `relation` (DreamclassapiV1StudentsRecordsGetStudentIdGuardiansGetResponsesContentApplicationJsonSchemaItemsRelation, required)

### DreamclassapiV1StudentsRecordsGetStudentIdGuardiansGetResponsesContentApplicationJsonSchemaItemsGuardian

- `id` (integer, required)
- `email` (string, required)
- `firstname` (string, required)
- `lastname` (string, required)
- `mobile` (string, required)
- `address` (string, required)
- `gender` (string, required)
- `country` (string, required)
- `city` (string, required)
- `state` (string, required)
- `zip` (string, required)
- `middlename` (any, optional)
- `telephone` (any, optional)
- `birthdate` (any, optional)
- `birthplace` (any, optional)
- `customFields` (any, optional)

### DreamclassapiV1StudentsRecordsGetStudentIdGuardiansGetResponsesContentApplicationJsonSchemaItemsRelation

- `id` (integer, required)
- `translation` (string, required)
- `institutionId` (integer, required)

## Examples

**Response**

```json
[
  {
    "guardian": {
      "id": 21,
      "email": "john.johnson@example.com",
      "firstname": "John",
      "lastname": "Johnson",
      "mobile": "+14155550123",
      "address": "801, Clement Street",
      "gender": "Male",
      "country": "United States",
      "city": "San Francisco",
      "state": "CA",
      "zip": "94118"
    },
    "relation": {
      "id": 1,
      "translation": "RELATION.FATHER",
      "institutionId": 1
    }
  }
]
```

**SDK Code**

```python GetStudentGuardians
import requests

url = "https://api.dreamclass.io/dreamclassapi/v1/students/records/get/studentId/guardians"

headers = {
    "dreamclass-secret-key": "{{apiKey}}",
    "tenant": "{{tenant}}",
    "schoolCode": "{{schoolCode}}"
}

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

print(response.json())
```

```javascript GetStudentGuardians
const url = 'https://api.dreamclass.io/dreamclassapi/v1/students/records/get/studentId/guardians';
const options = {
  method: 'GET',
  headers: {
    'dreamclass-secret-key': '{{apiKey}}',
    tenant: '{{tenant}}',
    schoolCode: '{{schoolCode}}'
  }
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go GetStudentGuardians
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.dreamclass.io/dreamclassapi/v1/students/records/get/studentId/guardians"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("dreamclass-secret-key", "{{apiKey}}")
	req.Header.Add("tenant", "{{tenant}}")
	req.Header.Add("schoolCode", "{{schoolCode}}")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby GetStudentGuardians
require 'uri'
require 'net/http'

url = URI("https://api.dreamclass.io/dreamclassapi/v1/students/records/get/studentId/guardians")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["dreamclass-secret-key"] = '{{apiKey}}'
request["tenant"] = '{{tenant}}'
request["schoolCode"] = '{{schoolCode}}'

response = http.request(request)
puts response.read_body
```

```java GetStudentGuardians
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.dreamclass.io/dreamclassapi/v1/students/records/get/studentId/guardians")
  .header("dreamclass-secret-key", "{{apiKey}}")
  .header("tenant", "{{tenant}}")
  .header("schoolCode", "{{schoolCode}}")
  .asString();
```

```php GetStudentGuardians
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.dreamclass.io/dreamclassapi/v1/students/records/get/studentId/guardians', [
  'headers' => [
    'dreamclass-secret-key' => '{{apiKey}}',
    'schoolCode' => '{{schoolCode}}',
    'tenant' => '{{tenant}}',
  ],
]);

echo $response->getBody();
```

```csharp GetStudentGuardians
using RestSharp;

var client = new RestClient("https://api.dreamclass.io/dreamclassapi/v1/students/records/get/studentId/guardians");
var request = new RestRequest(Method.GET);
request.AddHeader("dreamclass-secret-key", "{{apiKey}}");
request.AddHeader("tenant", "{{tenant}}");
request.AddHeader("schoolCode", "{{schoolCode}}");
IRestResponse response = client.Execute(request);
```

```swift GetStudentGuardians
import Foundation

let headers = [
  "dreamclass-secret-key": "{{apiKey}}",
  "tenant": "{{tenant}}",
  "schoolCode": "{{schoolCode}}"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.dreamclass.io/dreamclassapi/v1/students/records/get/studentId/guardians")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```