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

# CreateStudent

POST https://dreamclassapi/v1/students/records/create
Content-Type: application/json

Add a student record

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /dreamclassapi/v1/students/records/create:
    post:
      operationId: create-student
      summary: CreateStudent
      description: Add a student record
      tags:
        - subpackage_students
      parameters:
        - name: tenant
          in: header
          required: false
          schema:
            type: string
        - name: schoolCode
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Students_CreateStudent_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                city:
                  type: string
                email:
                  type: string
                  format: email
                gender:
                  type: string
                mobile:
                  type: string
                address:
                  type: string
                country:
                  type: string
                lastname:
                  type: string
                birthdate:
                  type: string
                  format: date
                firstname:
                  type: string
                telephone:
                  type: string
                birthplace:
                  type: string
                middlename:
                  type: string
                customFields:
                  $ref: >-
                    #/components/schemas/DreamclassapiV1StudentsRecordsCreatePostRequestBodyContentApplicationJsonSchemaCustomFields
              required:
                - city
                - email
                - gender
                - mobile
                - address
                - country
                - lastname
                - birthdate
                - firstname
                - telephone
                - birthplace
                - middlename
                - customFields
servers:
  - url: https:/
    description: https://{server}
  - url: https://your-webhook-url
    description: https://your-webhook-url
components:
  schemas:
    DreamclassapiV1StudentsRecordsCreatePostRequestBodyContentApplicationJsonSchemaCustomFields:
      type: object
      properties:
        '1':
          type: string
        '2':
          type: string
      required:
        - '1'
        - '2'
      title: >-
        DreamclassapiV1StudentsRecordsCreatePostRequestBodyContentApplicationJsonSchemaCustomFields
    DreamclassapiV1StudentsRecordsCreatePostResponsesContentApplicationJsonSchemaCustomFields:
      type: object
      properties:
        '1':
          type: string
        '2':
          type: string
      required:
        - '1'
        - '2'
      title: >-
        DreamclassapiV1StudentsRecordsCreatePostResponsesContentApplicationJsonSchemaCustomFields
    Students_CreateStudent_Response_200:
      type: object
      properties:
        id:
          type: integer
        city:
          type: string
        email:
          type: string
          format: email
        gender:
          type: string
        mobile:
          type: string
        address:
          type: string
        country:
          type: string
        lastname:
          type: string
        birthdate:
          type: string
          format: date
        firstname:
          type: string
        guardians:
          description: Any type
        telephone:
          type: string
        birthplace:
          type: string
        middlename:
          type: string
        customFields:
          $ref: >-
            #/components/schemas/DreamclassapiV1StudentsRecordsCreatePostResponsesContentApplicationJsonSchemaCustomFields
        schoolPeriods:
          description: Any type
      required:
        - id
        - city
        - email
        - gender
        - mobile
        - address
        - country
        - lastname
        - birthdate
        - firstname
        - telephone
        - birthplace
        - middlename
        - customFields
      title: Students_CreateStudent_Response_200

```

## Examples



**Request**

```json
{
  "city": "Sacramento",
  "email": "test@company.com",
  "gender": "male",
  "mobile": "123456789",
  "address": "Southgate 4",
  "country": "United States",
  "lastname": "Carry",
  "birthdate": "2012-12-31",
  "firstname": "George",
  "telephone": "123456789",
  "birthplace": "Texas",
  "middlename": "John",
  "customFields": {
    "1": "value1",
    "2": "value2"
  }
}
```

**Response**

```json
{
  "id": 189,
  "city": "Sacramento",
  "email": "test@company.com",
  "gender": "Male",
  "mobile": "123456789",
  "address": "Southgate 4",
  "country": "United States",
  "lastname": "Carry",
  "birthdate": "2012-12-31",
  "firstname": "George",
  "telephone": "123456789",
  "birthplace": "Texas",
  "middlename": "John",
  "customFields": {
    "1": "value1",
    "2": "value2"
  }
}
```

**SDK Code**

```python Students_CreateStudent_example
import requests

url = "https://https/dreamclassapi/v1/students/records/create"

payload = {
    "city": "Sacramento",
    "email": "test@company.com",
    "gender": "male",
    "mobile": "123456789",
    "address": "Southgate 4",
    "country": "United States",
    "lastname": "Carry",
    "birthdate": "2012-12-31",
    "firstname": "George",
    "telephone": "123456789",
    "birthplace": "Texas",
    "middlename": "John",
    "customFields": {
        "1": "value1",
        "2": "value2"
    }
}
headers = {
    "tenant": "{{tenant}}",
    "schoolCode": "{{schoolCode}}",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Students_CreateStudent_example
const url = 'https://https/dreamclassapi/v1/students/records/create';
const options = {
  method: 'POST',
  headers: {
    tenant: '{{tenant}}',
    schoolCode: '{{schoolCode}}',
    'Content-Type': 'application/json'
  },
  body: '{"city":"Sacramento","email":"test@company.com","gender":"male","mobile":"123456789","address":"Southgate 4","country":"United States","lastname":"Carry","birthdate":"2012-12-31","firstname":"George","telephone":"123456789","birthplace":"Texas","middlename":"John","customFields":{"1":"value1","2":"value2"}}'
};

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

```go Students_CreateStudent_example
package main

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

func main() {

	url := "https://https/dreamclassapi/v1/students/records/create"

	payload := strings.NewReader("{\n  \"city\": \"Sacramento\",\n  \"email\": \"test@company.com\",\n  \"gender\": \"male\",\n  \"mobile\": \"123456789\",\n  \"address\": \"Southgate 4\",\n  \"country\": \"United States\",\n  \"lastname\": \"Carry\",\n  \"birthdate\": \"2012-12-31\",\n  \"firstname\": \"George\",\n  \"telephone\": \"123456789\",\n  \"birthplace\": \"Texas\",\n  \"middlename\": \"John\",\n  \"customFields\": {\n    \"1\": \"value1\",\n    \"2\": \"value2\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("tenant", "{{tenant}}")
	req.Header.Add("schoolCode", "{{schoolCode}}")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://https/dreamclassapi/v1/students/records/create")

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

request = Net::HTTP::Post.new(url)
request["tenant"] = '{{tenant}}'
request["schoolCode"] = '{{schoolCode}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"city\": \"Sacramento\",\n  \"email\": \"test@company.com\",\n  \"gender\": \"male\",\n  \"mobile\": \"123456789\",\n  \"address\": \"Southgate 4\",\n  \"country\": \"United States\",\n  \"lastname\": \"Carry\",\n  \"birthdate\": \"2012-12-31\",\n  \"firstname\": \"George\",\n  \"telephone\": \"123456789\",\n  \"birthplace\": \"Texas\",\n  \"middlename\": \"John\",\n  \"customFields\": {\n    \"1\": \"value1\",\n    \"2\": \"value2\"\n  }\n}"

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

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

HttpResponse<String> response = Unirest.post("https://https/dreamclassapi/v1/students/records/create")
  .header("tenant", "{{tenant}}")
  .header("schoolCode", "{{schoolCode}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"city\": \"Sacramento\",\n  \"email\": \"test@company.com\",\n  \"gender\": \"male\",\n  \"mobile\": \"123456789\",\n  \"address\": \"Southgate 4\",\n  \"country\": \"United States\",\n  \"lastname\": \"Carry\",\n  \"birthdate\": \"2012-12-31\",\n  \"firstname\": \"George\",\n  \"telephone\": \"123456789\",\n  \"birthplace\": \"Texas\",\n  \"middlename\": \"John\",\n  \"customFields\": {\n    \"1\": \"value1\",\n    \"2\": \"value2\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/dreamclassapi/v1/students/records/create', [
  'body' => '{
  "city": "Sacramento",
  "email": "test@company.com",
  "gender": "male",
  "mobile": "123456789",
  "address": "Southgate 4",
  "country": "United States",
  "lastname": "Carry",
  "birthdate": "2012-12-31",
  "firstname": "George",
  "telephone": "123456789",
  "birthplace": "Texas",
  "middlename": "John",
  "customFields": {
    "1": "value1",
    "2": "value2"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'schoolCode' => '{{schoolCode}}',
    'tenant' => '{{tenant}}',
  ],
]);

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

```csharp Students_CreateStudent_example
using RestSharp;

var client = new RestClient("https://https/dreamclassapi/v1/students/records/create");
var request = new RestRequest(Method.POST);
request.AddHeader("tenant", "{{tenant}}");
request.AddHeader("schoolCode", "{{schoolCode}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"city\": \"Sacramento\",\n  \"email\": \"test@company.com\",\n  \"gender\": \"male\",\n  \"mobile\": \"123456789\",\n  \"address\": \"Southgate 4\",\n  \"country\": \"United States\",\n  \"lastname\": \"Carry\",\n  \"birthdate\": \"2012-12-31\",\n  \"firstname\": \"George\",\n  \"telephone\": \"123456789\",\n  \"birthplace\": \"Texas\",\n  \"middlename\": \"John\",\n  \"customFields\": {\n    \"1\": \"value1\",\n    \"2\": \"value2\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Students_CreateStudent_example
import Foundation

let headers = [
  "tenant": "{{tenant}}",
  "schoolCode": "{{schoolCode}}",
  "Content-Type": "application/json"
]
let parameters = [
  "city": "Sacramento",
  "email": "test@company.com",
  "gender": "male",
  "mobile": "123456789",
  "address": "Southgate 4",
  "country": "United States",
  "lastname": "Carry",
  "birthdate": "2012-12-31",
  "firstname": "George",
  "telephone": "123456789",
  "birthplace": "Texas",
  "middlename": "John",
  "customFields": [
    "1": "value1",
    "2": "value2"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://https/dreamclassapi/v1/students/records/create")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```