> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dokstamp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Turmas

> Gerencie turmas — ingressos ou turmas de formandos específicas dentro de um curso.

# Turmas

Uma turma representa um ingresso ou turma de formandos específica para um curso — por exemplo, "Turma Noturna 2024/1" ou "Turma EAD — Março 2025". As turmas são opcionais, mas permitem agrupar matrículas e certificados por turma de formatura.

***

## O objeto turma

```json theme={null}
{
  "uuid": "e5f6a7b8-c9d0-1234-efgh-345678901234",
  "code": "BCS-2024-EVE",
  "modality": "hybrid",
  "start_date": "2024-02-01T00:00:00.000000Z",
  "end_date": "2027-12-31T00:00:00.000000Z",
  "course": {
    "uuid": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "name": "Bachelor of Computer Science"
  }
}
```

| Campo        | Tipo     | Descrição                                     |
| ------------ | -------- | --------------------------------------------- |
| `uuid`       | string   | Identificador único                           |
| `code`       | string   | Código único da turma                         |
| `modality`   | enum     | `presential`, `remote`, `hybrid`              |
| `start_date` | datetime | Data de início da turma                       |
| `end_date`   | datetime | Data de término da turma (formatura prevista) |

***

## Listar turmas

```http theme={null}
GET /cohorts
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.dokstamp.com/cohorts?where[course_uuid]=c3d4e5f6-a7b8-9012-cdef-123456789012" \
    -H "Authorization: Bearer {TOKEN}" \
    -H "Accept: application/json" \
    -H "X-Tenant: {TENANT}"
  ```
</CodeGroup>

***

## Criar uma turma

```http theme={null}
POST /cohorts
```

| Parâmetro     | Tipo     | Obrigatório | Descrição                          |
| ------------- | -------- | ----------- | ---------------------------------- |
| `course_uuid` | string   | Sim         | UUID do curso pai                  |
| `code`        | string   | Sim         | Código único da turma              |
| `modality`    | enum     | Não         | `presential`, `remote`, `hybrid`   |
| `start_date`  | datetime | Não         | Data de início da turma            |
| `end_date`    | datetime | Não         | Data prevista de término/formatura |

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.dokstamp.com/cohorts \
    -H "Authorization: Bearer {TOKEN}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "X-Tenant: {TENANT}" \
    -d '{
      "course_uuid": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "code": "BCS-2024-EVE",
      "modality": "hybrid",
      "start_date": "2024-02-01T00:00:00Z",
      "end_date": "2027-12-31T00:00:00Z"
    }'
  ```
</CodeGroup>

***

## Obter, atualizar, excluir

```http theme={null}
GET    /cohorts/{uuid}
PATCH  /cohorts/{uuid}
PUT    /cohorts/{uuid}
DELETE /cohorts/{uuid}
DELETE /cohorts/batch/destroy
```
