Manage your students via our API


Creating a Student

For information on creating a student, see Creating a Student

Searching for Students

You can easily query your entire list of students using via the List Students Endpoint.

If you know the ID of a specific student, you can retrieve their details using the Retrieve Students Details Endpoint.

If you want to search your list of students, you can use the List Students Endpoint endpoint in conjunction with the 'q' parameter. This optional parameter is used to query students based on their properties. For example ?q[property_matcher]=query, where property_matcher takes the form of {property name}_{query matcher}.

Property matching query examples:

  • ?q[email_eq]=test@example.com - returns students where email equals 'test@example.com'.
  • ?q[mobile_eq]=61412123123 - returns students where mobile equals '61412123123'.
  • ?q[passport_number_eq]=A1231234 - returns students where passport number equals 'A1231234'.
  • ?q[home_country_eq]=IN - returns students where home country is India
  • ?q[destination_country_eq]=AU - returns students where the destination country is Australia
  • ?q[branch_id_eq]=2 - returns students where the branch_id is 2
  • ?q[given_name_cont]=john - returns students where given name contains 'john', i.e. this would return students with given names john, johnny, johnathon etc.
  • ?q[family_name_cont]=smith - returns students where family name contains 'smith', i.e. this would return students with last names smith, smithers, hammersmith etc.

Updating Students

You can update a given student's details via the Update Student Details Endpoint.

NOTE: You only have to provide the fields you want to update. All existing data will remain unchanged.

An example of this may look like:

curl \
  -u '<api-user-email@cohortgo.com>:<api-user-token>' \
  -d '{
    "student":{
       "title": "Mrs",
       "given_name": "Mary",
       "family_name": "Popping",
      }
    }' \
  -H "Content-Type: application/json" \
  -XPUT \
  https://demo.s.portal.cohortgo.com/api/v1/students/1234

This will responsd with a payload with updated student's data:

{
  "id": 12345,
  "portal_url": "https://demo.s.portal.cohortgo.com/students/12345",
  "title": "Mrs",
  "given_name": "Mary",
  "family_name": "Popping",
  "gender": "female",
  "email": "user@example.com",
  "home_country": "CN",
  "destination_country": "AU",
  "dob": "1990-05-20",
  "mobile": "61 412 123 123",
  "passport_number": "A1231234",
  "language_preference": "en"
}

Managing Custom Data

For information on managing custom data for a student, see Managing Student Custom Data.

If you wish to unset a custom data's field (i.e. clear the value), simply pass through the key with the value null. The example below shows an example of clearing the referral-source custom data value, effectively removing this custom data field from the student record.

curl \
  -u '<api-user-email@cohortgo.com>:<api-user-token>' \
  -d '{
    "student":{
       "additional_information": {
         "referral-source": null
       }
    }' \
  -H "Content-Type: application/json" \
  -XPUT \
  https://demo.s.portal.cohortgo.com/api/v1/students/1234

NOTE: When updating a student's custom data - you only have to provide the fields you want to update. All existing custom data will remain unchanged.