Create Teacher User

POST /teachers

Create a new teacher user account and assign it to one or more class (as a teacher).

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

    • Provide an indetifier from an external source

  • classIds array[string(uuid)]

    Class UUID

Responses

  • 201 application/json

    Teacher 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 /teachers
curl \
 -X POST https://connect.century.tech/api/v1/teachers \
 -H "Content-Type: application/json" \
 -d '{"user":{"firstName":"John","lastName":"Doe","username":"john_doe","email":"hello@example.com","password":"string","externalId":"External_ID_123"},"classIds":["c81fd38c-03f6-4b68-8720-84a7233e89de"]}'
Request examples
{
  "user": {
    "firstName": "John",
    "lastName": "Doe",
    "username": "john_doe",
    "email": "hello@example.com",
    "password": "string",
    "externalId": "External_ID_123"
  },
  "classIds": [
    "c81fd38c-03f6-4b68-8720-84a7233e89de"
  ]
}
Response examples (201)
{
  "user": {
    "upn": "Y89421121401A",
    "roles": [
      "teacher"
    ],
    "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"
  }
}