# CDT Formation

CDT Formation endpoints return the **schema definitions** for Custom Data Types — the structure, fields, and field types defined in Welkin Designer. Use these to understand the shape of CDT records before reading or writing data via the [Custom Data Types (CDT)](/developer-and-integration-guide/api-reference/custom-data-types.md) endpoints.

**Base path:** `/{tenantName}/{instanceName}/formation/cdts`

***

## Endpoints

### GET Get One CDT

**GET** `/{tenantName}/{instanceName}/formation/cdts/{cdtName}`

Returns the schema definition for a single Custom Data Type by name.

#### Path Parameters

| Parameter | Type   | Required | Description                            |
| --------- | ------ | -------- | -------------------------------------- |
| `cdtName` | string | Yes      | The CDT name as configured in Designer |

#### Example Request

```http
GET /acme-health/live/formation/cdts/vitals
Authorization: Bearer <token>
```

#### Example Response `200 OK`

```json
{
  "name": "vitals",
  "label": "Vitals",
  "fields": [
    { "name": "bloodPressure", "label": "Blood Pressure", "type": "STRING" },
    { "name": "heartRate", "label": "Heart Rate", "type": "NUMBER" },
    { "name": "recordedAt", "label": "Recorded At", "type": "DATETIME" }
  ]
}
```

***

### GET Get All CDTs

**GET** `/{tenantName}/{instanceName}/formation/cdts`

Returns schema definitions for all Custom Data Types configured in your Welkin instance.

#### Query Parameters

| Parameter | Type    | Default | Description      |
| --------- | ------- | ------- | ---------------- |
| `page`    | integer | `0`     | Page number      |
| `size`    | integer | `20`    | Results per page |

#### Example Request

```http
GET /acme-health/live/formation/cdts
Authorization: Bearer <token>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.welkinhealth.com/developer-and-integration-guide/api-reference/cdt-formation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
