PUT
/
users
/
{handle}
/
shorten-license
curl --request PUT \
  --url https://codecombat.com/api/users/{handle}/shorten-license \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "ends": "<string>"
}'
{
  "_id": "<string>",
  "email": "<string>",
  "license": {
    "active": true,
    "ends": "<string>"
  },
  "name": "<string>",
  "oAuthIdentities": [
    {
      "id": "<string>",
      "provider": "<string>"
    }
  ],
  "role": "<string>",
  "slug": "<string>",
  "stats": {
    "concepts": {},
    "gamesCompleted": 123,
    "playTime": 123
  },
  "subscription": {
    "active": true,
    "ends": "<string>"
  }
}
url = `https://codecombat.com/api/users/${userID}/shorten-license`
json = { ends: new Date().toISOString() }
request.put({ url, json, auth }, (err, res) => {
  console.log(res.body.license.active) // false
})

Authorizations

Authorization
string
headerrequired

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

Path Parameters

handle
string
required

The document's _id or slug.

Body

application/json
ends
string
required

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