POST

/api/users

Authorization*
curl --request POST \
  --url https://codecombat.com/api/users \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "<email>",
  "name": "<name>"
}'
{
  "_id": "string",
  "email": "string",
  "license": {
    "active": "boolean",
    "ends": "string"
  },
  "name": "string",
  "oAuthIdentities": [
    {
      "id": "string",
      "provider": "string"
    }
  ],
  "role": "string",
  "slug": "string",
  "stats": {
    "concepts": "object",
    "gamesCompleted": "number",
    "playTime": "number"
  },
  "subscription": {
    "active": "boolean",
    "ends": "string"
  }
}
Example
url = 'https://codecombat.com/api/users'
json = { email: 'an@email.com', name: 'Some Username', role: 'student' }
request.post({ url, json, auth })

Authorizations

Authenticationheaderrequired
string

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
birthday
string | null
emailrequired
string
heroConfig
object | null
namerequired
string
preferredLanguage
string | null
role
enum<string> | null

"student" or "teacher". If unset, a home user will be created, unable to join classrooms.

Available options:
student,
teacher

Response

200 - application/json
_id
string | null
email
string | null
license
object | null
name
string | null
oAuthIdentities
object[] | null
role
string | null

Usually either 'teacher' or 'student'

slug
string | null
stats
object | null
subscription
object | null