Skip to main content

Student Update API

How to change an existing student's details and custom fields through the API — send only the fields you want to change, and nothing is saved if one fails.

Written by Abdullah Al-Hussein

Overview

JSON endpoint that changes an existing student's details, including custom fields. Send only the fields you want to change — everything else stays as it is.

Authentication

Authenticate with the school's API key. Pass it either way:

Header: X-API-KEY: <school_api_key>
Query: ?apikey=<school_api_key>

The key identifies the school. The student must belong to that school; there is no school_id parameter. We recommend the header form: keys passed in a URL can end up in server or proxy logs.

See Getting and using your API key if you don't have a key yet.

Endpoint

POST /api/v1/students/{id}/update

{id} is the student id returned by the Student List API or when you create a student. Send the fields as JSON in the request body.

Fields you can send

Field

Notes

fname, lname

Cannot be blank

gender

Text

registration_date

YYYY-MM-DD. The student's start date. Cannot be blank

date_of_birth

YYYY-MM-DD, not in the future. "" clears it

identification_number

Must be unique in your school. "" clears it

email_address

A valid email. "" clears it

mobile_phone_code, mobile_phone, home_phone_code, home_phone

Digits only. Codes are 1 to 4 digits, for example 44 or 1. An empty code leaves the saved code unchanged

street_name_and_number, flat_floor, area, postcode, city, country_code

country_code is 2 or 3 letters. The full address line is rebuilt for you

general_notes, medical_notes

Text

discount_type, discount_percentage

percentage (0 to 100) or numeric_value. Does not change fees that already exist

preferred_payment_method

Id of a payment method available to your school. "" clears it

custom_fields

An object of custom field name and value — see below

A field you leave out is not changed. Optional text fields sent as "" are cleared; null works the same way, except in custom_fields.

Anything else in the body is not written. Fields such as school_id, id, archived, courses or related contact fields are skipped and listed in ignored_fields in the response.

Custom fields

Use the custom field's name exactly as it appears in Teach 'n Go. Only the custom fields you send change.

Field type

Send

Text, text area

A string

Date

YYYY-MM-DD. "" clears the date

Drop-down

One of the field's options, or a list of options if the field allows several

Checkbox

true or false

Any type

null removes that value

A name that is not a student custom field of your school is rejected.

Example

curl -X POST "https://app.teachngo.com/api/v1/students/12345/update" \
-H "X-API-KEY: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"registration_date": "2026-12-01",
"email_address": "ana.silva@example.com",
"custom_fields": { "Student status": "Active", "Placement test date": "2026-11-20" }
}'

Response

Success

{
"status": "success",
"message": "student updated",
"data": {
"id": 12345,
"fname": "Ana",
"lname": "Silva",
"registration_date": "2026-12-01",
"email_address": "ana.silva@example.com",
"custom_fields": { "Student status": "Active", "Placement test date": "2026-11-20" },
"classes": [],
"related_contacts": []
}
}

data is the same student object the Student List API returns, so you can store it as it is (shortened above). If you sent fields that can't be written, the response also carries ignored_fields.

Validation error

{
"status": "fail",
"message": "validation Error.",
"errors": {
"date_of_birth": "Enter a birth date in YYYY-MM-DD format.",
"custom_fields.Student status": "Active2 is not a valid option for this field."
}
}

If one field fails, nothing is saved. Fix the fields listed in errors and send the request again.

Error codes

HTTP status

Meaning

401

Missing or wrong API key

403

write_access_requires_pro — writing through the API is part of Teach 'n Go Pro

404

Student not found — the id does not exist in your school, or is not a number

405

Use POST

422

Nothing was saved — No fields to update, or a validation error with an errors object

429

rate_limit_exceeded — the daily API limit for your plan is used up. It resets at midnight UTC

200 with status: fail

Your subscription has expired (Subscriptions expired. Please renew your plan.)

Things to know

  • Archived students — can be updated

  • Email changes — do not change the student's portal login email, and no email is sent to the student

  • Email change limit — a student's email can only be changed a few times per hour; past that you get a 422 on email_address

  • Edits at the same time — if you and a staff member save the same student at the same moment, the last save wins

To find students that changed since your last sync, use the updated_since parameter of the Student List API.

Did this answer your question?