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

# Student Class

POST https://#post3
Content-Type: application/json

Webhook related to student assigned to a class, trigged upon

- Student class created: STUDENT_CLASS_CREATED
    
- Student class updated: STUDENT_CLASS_UPDATED
    
- Student class deleted: STUDENT_CLASS_DELETED
    

The provided classId can be used in the GetPeriodClasses API. The studentPeriodId is the one returned in the Student Period webhook.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /#post3:
    post:
      operationId: student-class
      summary: Student Class
      description: >-
        Webhook related to student assigned to a class, trigged upon


        - Student class created: STUDENT_CLASS_CREATED
            
        - Student class updated: STUDENT_CLASS_UPDATED
            
        - Student class deleted: STUDENT_CLASS_DELETED
            

        The provided classId can be used in the GetPeriodClasses API. The
        studentPeriodId is the one returned in the Student Period webhook.
      tags:
        - subpackage_webhooks
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhooks_Student Class_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                data:
                  $ref: >-
                    #/components/schemas/Post3PostRequestBodyContentApplicationJsonSchemaData
                type:
                  type: string
                tenant:
                  type: string
                signature:
                  type: string
                timestamp:
                  type: integer
              required:
                - id
                - data
                - type
                - tenant
                - signature
                - timestamp
servers:
  - url: https:/
    description: https://{server}
  - url: https://your-webhook-url
    description: https://your-webhook-url
components:
  schemas:
    Post3PostRequestBodyContentApplicationJsonSchemaData:
      type: object
      properties:
        id:
          type: integer
        addedAt:
          type: string
          format: date-time
        classId:
          type: integer
        endDate:
          type: string
          format: date
        startDate:
          type: string
          format: date
        registered:
          type: boolean
        studentPeriodId:
          type: integer
      required:
        - id
        - addedAt
        - classId
        - endDate
        - startDate
        - registered
        - studentPeriodId
      title: Post3PostRequestBodyContentApplicationJsonSchemaData
    Webhooks_Student Class_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Webhooks_Student Class_Response_200

```

## Examples



**Request**

```json
{
  "id": "613df5f8-c44f-439d-8f94-5c2d87aa18df",
  "data": {
    "id": 45,
    "addedAt": "2024-10-02T15:25:27.471+00:00",
    "classId": 14,
    "endDate": "2024-10-11",
    "startDate": "2023-12-11",
    "registered": true,
    "studentPeriodId": 74
  },
  "type": "STUDENT_CLASS_CREATED",
  "tenant": "my-school",
  "signature": "k1XoUbe5HuuOLbsNqrXRUHhQeDNWWU5eY0h3DfamnjQ=",
  "timestamp": 1727882727528
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://https/#post3"

payload = {
    "id": "613df5f8-c44f-439d-8f94-5c2d87aa18df",
    "data": {
        "id": 45,
        "addedAt": "2024-10-02T15:25:27.471+00:00",
        "classId": 14,
        "endDate": "2024-10-11",
        "startDate": "2023-12-11",
        "registered": True,
        "studentPeriodId": 74
    },
    "type": "STUDENT_CLASS_CREATED",
    "tenant": "my-school",
    "signature": "k1XoUbe5HuuOLbsNqrXRUHhQeDNWWU5eY0h3DfamnjQ=",
    "timestamp": 1727882727528
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://https/#post3';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"id":"613df5f8-c44f-439d-8f94-5c2d87aa18df","data":{"id":45,"addedAt":"2024-10-02T15:25:27.471+00:00","classId":14,"endDate":"2024-10-11","startDate":"2023-12-11","registered":true,"studentPeriodId":74},"type":"STUDENT_CLASS_CREATED","tenant":"my-school","signature":"k1XoUbe5HuuOLbsNqrXRUHhQeDNWWU5eY0h3DfamnjQ=","timestamp":1727882727528}'
};

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

```go
package main

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

func main() {

	url := "https://https/#post3"

	payload := strings.NewReader("{\n  \"id\": \"613df5f8-c44f-439d-8f94-5c2d87aa18df\",\n  \"data\": {\n    \"id\": 45,\n    \"addedAt\": \"2024-10-02T15:25:27.471+00:00\",\n    \"classId\": 14,\n    \"endDate\": \"2024-10-11\",\n    \"startDate\": \"2023-12-11\",\n    \"registered\": true,\n    \"studentPeriodId\": 74\n  },\n  \"type\": \"STUDENT_CLASS_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"k1XoUbe5HuuOLbsNqrXRUHhQeDNWWU5eY0h3DfamnjQ=\",\n  \"timestamp\": 1727882727528\n}")

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

	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
require 'uri'
require 'net/http'

url = URI("https://https/#post3")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"id\": \"613df5f8-c44f-439d-8f94-5c2d87aa18df\",\n  \"data\": {\n    \"id\": 45,\n    \"addedAt\": \"2024-10-02T15:25:27.471+00:00\",\n    \"classId\": 14,\n    \"endDate\": \"2024-10-11\",\n    \"startDate\": \"2023-12-11\",\n    \"registered\": true,\n    \"studentPeriodId\": 74\n  },\n  \"type\": \"STUDENT_CLASS_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"k1XoUbe5HuuOLbsNqrXRUHhQeDNWWU5eY0h3DfamnjQ=\",\n  \"timestamp\": 1727882727528\n}"

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

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

HttpResponse<String> response = Unirest.post("https://https/#post3")
  .header("Content-Type", "application/json")
  .body("{\n  \"id\": \"613df5f8-c44f-439d-8f94-5c2d87aa18df\",\n  \"data\": {\n    \"id\": 45,\n    \"addedAt\": \"2024-10-02T15:25:27.471+00:00\",\n    \"classId\": 14,\n    \"endDate\": \"2024-10-11\",\n    \"startDate\": \"2023-12-11\",\n    \"registered\": true,\n    \"studentPeriodId\": 74\n  },\n  \"type\": \"STUDENT_CLASS_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"k1XoUbe5HuuOLbsNqrXRUHhQeDNWWU5eY0h3DfamnjQ=\",\n  \"timestamp\": 1727882727528\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/#post3', [
  'body' => '{
  "id": "613df5f8-c44f-439d-8f94-5c2d87aa18df",
  "data": {
    "id": 45,
    "addedAt": "2024-10-02T15:25:27.471+00:00",
    "classId": 14,
    "endDate": "2024-10-11",
    "startDate": "2023-12-11",
    "registered": true,
    "studentPeriodId": 74
  },
  "type": "STUDENT_CLASS_CREATED",
  "tenant": "my-school",
  "signature": "k1XoUbe5HuuOLbsNqrXRUHhQeDNWWU5eY0h3DfamnjQ=",
  "timestamp": 1727882727528
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://https/#post3");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"id\": \"613df5f8-c44f-439d-8f94-5c2d87aa18df\",\n  \"data\": {\n    \"id\": 45,\n    \"addedAt\": \"2024-10-02T15:25:27.471+00:00\",\n    \"classId\": 14,\n    \"endDate\": \"2024-10-11\",\n    \"startDate\": \"2023-12-11\",\n    \"registered\": true,\n    \"studentPeriodId\": 74\n  },\n  \"type\": \"STUDENT_CLASS_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"k1XoUbe5HuuOLbsNqrXRUHhQeDNWWU5eY0h3DfamnjQ=\",\n  \"timestamp\": 1727882727528\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "id": "613df5f8-c44f-439d-8f94-5c2d87aa18df",
  "data": [
    "id": 45,
    "addedAt": "2024-10-02T15:25:27.471+00:00",
    "classId": 14,
    "endDate": "2024-10-11",
    "startDate": "2023-12-11",
    "registered": true,
    "studentPeriodId": 74
  ],
  "type": "STUDENT_CLASS_CREATED",
  "tenant": "my-school",
  "signature": "k1XoUbe5HuuOLbsNqrXRUHhQeDNWWU5eY0h3DfamnjQ=",
  "timestamp": 1727882727528
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://https/#post3")! 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()
```