# Create Student — Teach 'n Go

> Registers a new student in Teach 'n Go. See the documentation

- Key: `teach_n_go-create-student`
- Type: Action (Write)
- Version: 0.0.2
- App: Teach 'n Go (`teach_n_go`) — https://pipedream.com/apps/teach-n-go.md
- This page (HTML): https://pipedream.com/apps/teach-n-go/actions/create-student
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/teach_n_go/actions/create-student/create-student.mjs

## Description

Registers a new student in Teach 'n Go. [See the documentation](https://intercom.help/teach-n-go/en/articles/6807235-new-student-and-class-registration-api)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `firstName` | `string` | Yes | The student's first name. |
| `lastName` | `string` | Yes | The student's last name. |
| `gender` | `string` | No | The student's gender. |
| `registrationDate` | `string` | No | The student's registration date. Format: YYYY-MM-DD |
| `dateOfBirth` | `string` | No | The student's date of birth. Format: YYYY-MM-DD |
| `identificationNumber` | `string` | No | The external number to identify the student. |
| `preferredPaymentMethod` | `integer` | No | The payment method the student want to use. |
| `discountPercentage` | `string` | No | The discount percentage on the payment amount. |
| `mobilePhoneCode` | `integer` | No | The region code of the mobile phone. Min length: 2, Max length: 4 |
| `mobilePhone` | `integer` | No | The student's mobile phone |
| `homePhoneCode` | `integer` | No | The region code of the home phone. Min length: 2, Max length: 4 |
| `homePhone` | `integer` | No | The student's home phone |
| `emailAddress` | `string` | No | The student's email address. |
| `streetNameAndNumber` | `string` | No | The student's full address. |
| `flatFloor` | `string` | No | The student's address flat floor if it exists. |
| `area` | `string` | No | The student's address area. |
| `city` | `string` | No | The student's city. |
| `postcode` | `string` | No | The student's postcode. |
| `countryCode` | `string` | No | The student's ISO 2 letter country code, e.g. (US, UK, IN). |
| `generalNotes` | `string` | No | Some student's additional notes. |
| `medicalNotes` | `string` | No | Some student's additional medical notes. |
| `courses` | `integer[]` | No | The student's course Ids. Options are loaded from the connected account. |
| `enrolmentDate` | `string` | No | The date of the student's enrolment. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "teach_n_go",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "teach_n_go-create-student",
  arguments: {
    firstName: "First Name",
    lastName: "Last Name",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "teach_n_go-create-student",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    teach_n_go: { authProvisionId: "apn_xxxxxxx" },
    firstName: "First Name",
    lastName: "Last Name",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "teach_n_go-create-student",
    "configured_props": {
      "teach_n_go": { "authProvisionId": "apn_xxxxxxx" },
      "firstName": "First Name",
      "lastName": "Last Name"
    }
  }'
```

---

- App: https://pipedream.com/apps/teach-n-go.md · All apps: https://pipedream.com/apps
