Users
Create User
Users
Create User
Creates a User.
POST
/
users
curl --request POST \
--url https://codecombat.com/api/users \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"name": "<string>",
"email": "<string>",
"role": "student",
"preferredLanguage": "<string>",
"heroConfig": {
"thangType": "<string>"
},
"birthday": "<string>"
}'
{
"_id": "<string>",
"email": "<string>",
"name": "<string>",
"slug": "<string>",
"role": "<string>",
"stats": {
"gamesCompleted": 123,
"concepts": {},
"playTime": 123
},
"oAuthIdentities": [
{
"provider": "<string>",
"id": "<string>"
}
],
"subscription": {
"ends": "<string>",
"active": true
},
"license": {
"ends": "<string>",
"active": true
}
}
Example
url = 'https://codecombat.com/api/users'
json = { email: 'an@email.com', name: 'Some Username', role: 'student' }
request.post({ url, json, auth })
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Body
application/json
Response
200 - application/json
The created user
Subset of properties listed here
curl --request POST \
--url https://codecombat.com/api/users \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"name": "<string>",
"email": "<string>",
"role": "student",
"preferredLanguage": "<string>",
"heroConfig": {
"thangType": "<string>"
},
"birthday": "<string>"
}'
{
"_id": "<string>",
"email": "<string>",
"name": "<string>",
"slug": "<string>",
"role": "<string>",
"stats": {
"gamesCompleted": 123,
"concepts": {},
"playTime": 123
},
"oAuthIdentities": [
{
"provider": "<string>",
"id": "<string>"
}
],
"subscription": {
"ends": "<string>",
"active": true
},
"license": {
"ends": "<string>",
"active": true
}
}