Create Student User

POST /students

Create a new student user account and assign it to one or more classes and cohorts.

application/json

Body Required

  • user object Required

    username or email must be provided

    Hide user attributes Show user attributes object
    • firstName string Required

      The first name of the user.

    • lastName string Required

      The last name of the user.

    • username string

      The username of the user, if one is not provided it will be automatically generated

    • email string(email)

      The email address of the user.

    • password string(password)

      If no password is supplied the user will need to reset their password or sign in via SSO e.g. Google, Office 365

    • upn string

      The Unique Pupil Number (UPN) of the user.

    • Provide an indetifier from an external source

    • gender string

      The gender of the user.

      Values are male, female, other, or unknown. Default value is unknown.

    • dateOfBirth string(date)

      The date of birth of the user.

  • classIds array[string(uuid)]

    Class UUID

  • cohortIds array[string(uuid)]

    Cohort UUID

Responses

  • 201 application/json

    Student created successfully.

    Hide response attribute Show response attribute object
    • user object Required
      Hide user attributes Show user attributes object
      • userId string(uuid) Required

        User UUID

      • roles array[string]

        User roles

        Values are manager, editor, leadership, guardian, teacher, or student.

      • username string Required

        The username of the user.

      • upn string

        The Unique Pupil Number (UPN) of the user.

      • External user identifier provided during onboarding or signup

      • fullName string Required

        The full name of the user.

      • firstName string Required

        The first name of the user.

      • The middle name of the user.

      • lastName string Required

        The last name of the user.

      • emails array[string(email)]

        A list of all email addresses associated with the user.

      • gender string Required

        The gender of the user.

        Values are male, female, other, or unknown. Default value is unknown.

      • dateOfBirth string(date)

        The date of birth of the user.

      • createdAt string(date-time)

        ISO 8601 formatted datetime string

      • updatedAt string(date-time)

        ISO 8601 formatted datetime string

  • Invalid request.

  • Invalid authentication credentials

  • Not authorised to access this resource

  • User already exists.

POST /students
curl \
 -X POST https://connect.century.tech/api/v1/students \
 -H "Content-Type: application/json" \
 -d '{"user":{"firstName":"John","lastName":"Doe","username":"john_doe","email":"john_doe@example.com","password":"string","upn":"Y89421121401A","externalId":"External_ID_123","gender":"male","dateOfBirth":"2010-07-01"},"classIds":["c81fd38c-03f6-4b68-8720-84a7233e89de"],"cohortIds":["c334f818-0281-4f47-855a-3a3d0e356cfd"]}'
Request examples
{
  "user": {
    "firstName": "John",
    "lastName": "Doe",
    "username": "john_doe",
    "email": "john_doe@example.com",
    "password": "string",
    "upn": "Y89421121401A",
    "externalId": "External_ID_123",
    "gender": "male",
    "dateOfBirth": "2010-07-01"
  },
  "classIds": [
    "c81fd38c-03f6-4b68-8720-84a7233e89de"
  ],
  "cohortIds": [
    "c334f818-0281-4f47-855a-3a3d0e356cfd"
  ]
}
Response examples (201)
{
  "user": {
    "upn": "Y89421121401A",
    "roles": [
      "student"
    ],
    "emails": [
      "john.doe@email.com"
    ],
    "gender": "male",
    "userId": "68f06c66-702a-4c26-b8c5-b6dc4f81f25d",
    "fullName": "John Doe",
    "lastName": "Doe",
    "username": "john_doe",
    "createdAt": "2024-01-01T12:00:00Z",
    "firstName": "John",
    "updatedAt": "2024-01-01T12:00:00Z",
    "externalId": "External_ID_123",
    "dateOfBirth": "2010-07-01"
  }
}