If the user already has access to the “Classroom” version up to a certain time, this shortens/revokes his/her access. If the ends is less than or equal to the current time, it revokes the enrollment and sets the end date to be the current time, else it just shortens the enrollment.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"CodeCombat","colors":{"primary":"#1FBAB4","light":"#63DFDA","dark":"#018A85"},"favicon":"/favicon.png","logo":{"light":"https://mintlify.s3.us-west-1.amazonaws.com/codecombat/logo/codecombatlogo.png","dark":"https://mintlify.s3.us-west-1.amazonaws.com/codecombat/logo/codecombatlogo.png"},"api":{"mdx":{"server":"https://codecombat.com/api"}},"navbar":{"links":[{"label":"Login","href":"https://codecombat.com/"}],"primary":{"type":"button","label":"Sign Up","href":"https://codecombat.com/"}},"footer":{"socials":{"twitter":"https://twitter.com/codecombat","facebook":"https://www.facebook.com/codecombat","youtube":"https://www.youtube.com/channel/UCEl7Rs_jtl3hcbnp0xZclQA","instagram":"https://www.instagram.com/codecombat/"}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"codecombat","hasAudioNarration":false,"actualSubdomain":"codecombat","customDomains":["api-docs.codecombat.com"],"gitSource":{"type":"github","owner":"codecombat","repo":"docs","deployBranch":"main","contentDirectory":"","mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae9145abf5fde76d1e1b66b:success","clientVersion":"0.0.4088","searchFilterCounts":[{"language":"default","tag":"Documentation","count":26},{"language":"default","tag":"Users","count":12},{"language":"default","tag":"Classrooms","count":8},{"language":"default","tag":"Getting Started","count":2},{"language":"default","tag":"Stats","count":2},{"language":"default","tag":"Auth","count":1},{"language":"default","tag":"Clans","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"users/shorten-license","slug":"/users/shorten-license","pageMetadata":{"openapi":"PUT /users/{handle}/shorten-license","description":"If the user already has access to the “Classroom” version up to a certain time, this shortens/revokes his/her access. If the ends is less than or equal to the current time, it revokes the enrollment and sets the end date to be the current time, else it just shortens the enrollment.","title":"Shorten User License","href":"/users/shorten-license"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"If the user already has access to the “Classroom” version up to a certain time, this shortens/revokes his/her access. If the ends is less than or equal to the current time, it revokes the enrollment and sets the end date to be the current time, else it just shortens the enrollment.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);return _jsx(CodeBlock,{numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"url = `https://codecombat.com/api/users/${userID}/shorten-license`\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`json = { ends: new Date().toISOString() }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`request.put({ url, json, auth }, (err, res) => {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` console.log(res.body.license.active) // false`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`})`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi":"PUT /users/{handle}/shorten-license","description":"If the user already has access to the “Classroom” version up to a certain time, this shortens/revokes his/her access. If the ends is less than or equal to the current time, it revokes the enrollment and sets the end date to be the current time, else it just shortens the enrollment.","title":"Shorten User License","href":"/users/shorten-license"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"description":"If the user already has access to the “Classroom” version up to a certain time, this shortens/revokes his/her access. If the ends is less than or equal to the current time, it revokes the enrollment and sets the end date to be the current time, else it just shortens the enrollment.","operationId":"users_shortenLicense","tags":["Users"],"parameters":["9b155e83-1247-4e43-8a96-ebd31ba6c176"],"responses":{"200":"82beedb9-a9f0-4ad0-bec2-a93ee8d76e5b"},"summary":"Shorten User License","security":["c591d831-a40a-4e2c-b2b5-f7a070cb894c"],"requestBody":"8a721c73-d304-4a78-b48b-1480c89a94b8","method":"put","type":"path","servers":["dff43397-8a72-4de1-b165-3bc18a5651f0"],"path":"/users/{handle}/shorten-license","baseUrlOptions":["https://codecombat.com/api"],"title":"Shorten User License","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"9b155e83-1247-4e43-8a96-ebd31ba6c176":{"name":"handle","in":"path","description":"The document's `_id` or `slug`.","required":true,"schema":{"type":"string","isRequired":true,"description":"The document's `_id` or `slug`.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ends":{"title":"datetimeString","type":"string","isRequired":true,"uniqueKey":"ends","typeLabel":"string"}},"required":["ends"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"ends":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"82beedb9-a9f0-4ad0-bec2-a93ee8d76e5b":{"description":"The affected user","content":{"application/json":{"schema":{"title":"UserResponse","type":"object","description":"Subset of properties listed here","properties":{"_id":{"oneOf":[{"title":"objectIdString","type":"string","uniqueKey":"_id.oneOf.0","typeLabel":"string"},{"title":"objectIdString","type":"null","uniqueKey":"_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"_id","typeLabel":"string | null"},"email":{"oneOf":[{"type":"string","uniqueKey":"email.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"email.oneOf.1","typeLabel":"null"}],"uniqueKey":"email","typeLabel":"string | null"},"name":{"oneOf":[{"type":"string","uniqueKey":"name.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"name.oneOf.1","typeLabel":"null"}],"uniqueKey":"name","typeLabel":"string | null"},"slug":{"oneOf":[{"type":"string","uniqueKey":"slug.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"slug.oneOf.1","typeLabel":"null"}],"uniqueKey":"slug","typeLabel":"string | null"},"role":{"oneOf":[{"title":"roleString","type":"string","description":"Usually either 'teacher' or 'student'","uniqueKey":"role.oneOf.0","typeLabel":"string"},{"title":"roleString","type":"null","description":"Usually either 'teacher' or 'student'","uniqueKey":"role.oneOf.1","typeLabel":"null"}],"uniqueKey":"role","typeLabel":"string | null"},"stats":{"oneOf":[{"title":"UserResponseStats","type":"object","properties":{"gamesCompleted":{"oneOf":[{"type":"number","format":"double","uniqueKey":"stats.oneOf.0.gamesCompleted.oneOf.0","typeLabel":"number\u003cdouble>"},{"type":"null","format":"double","uniqueKey":"stats.oneOf.0.gamesCompleted.oneOf.1","typeLabel":"null"}],"uniqueKey":"stats.oneOf.0.gamesCompleted","typeLabel":"number\u003cdouble> | null"},"concepts":{"oneOf":[{"type":"object","additionalProperties":{"type":"number","format":"double","uniqueKey":"stats.oneOf.0.concepts.oneOf.0.additionalProperties","typeLabel":"number\u003cdouble>"},"uniqueKey":"stats.oneOf.0.concepts.oneOf.0","typeLabel":"object"},{"type":"null","additionalProperties":{"type":"number","format":"double","uniqueKey":"stats.oneOf.0.concepts.oneOf.1.additionalProperties","typeLabel":"number\u003cdouble>"},"uniqueKey":"stats.oneOf.0.concepts.oneOf.1","typeLabel":"null"}],"uniqueKey":"stats.oneOf.0.concepts","typeLabel":"object | null"},"playTime":{"oneOf":[{"type":"number","format":"double","description":"Included only when specifically requested on the endpoint","uniqueKey":"stats.oneOf.0.playTime.oneOf.0","typeLabel":"number\u003cdouble>"},{"type":"null","format":"double","description":"Included only when specifically requested on the endpoint","uniqueKey":"stats.oneOf.0.playTime.oneOf.1","typeLabel":"null"}],"uniqueKey":"stats.oneOf.0.playTime","typeLabel":"number\u003cdouble> | null"}},"uniqueKey":"stats.oneOf.0","typeLabel":"UserResponseStats · object"},{"title":"UserResponseStats","type":"null","properties":{"gamesCompleted":{"oneOf":[{"type":"number","format":"double"},{"type":"null","format":"double"}]},"concepts":{"oneOf":[{"type":"object","additionalProperties":{"type":"number","format":"double"}},{"type":"null","additionalProperties":{"type":"number","format":"double"}}]},"playTime":{"oneOf":[{"type":"number","format":"double","description":"Included only when specifically requested on the endpoint"},{"type":"null","format":"double","description":"Included only when specifically requested on the endpoint"}]}},"uniqueKey":"stats.oneOf.1","typeLabel":"null"}],"uniqueKey":"stats","typeLabel":"UserResponseStats · object | null"},"oAuthIdentities":{"oneOf":[{"type":"array","items":{"title":"UserResponseOAuthIdentitiesItem","type":"object","properties":{"provider":{"oneOf":[{"type":"string","uniqueKey":"oAuthIdentities.oneOf.0.items.[INDEX].provider.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"oAuthIdentities.oneOf.0.items.[INDEX].provider.oneOf.1","typeLabel":"null"}],"uniqueKey":"oAuthIdentities.oneOf.0.items.[INDEX].provider","typeLabel":"string | null"},"id":{"oneOf":[{"type":"string","uniqueKey":"oAuthIdentities.oneOf.0.items.[INDEX].id.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"oAuthIdentities.oneOf.0.items.[INDEX].id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oAuthIdentities.oneOf.0.items.[INDEX].id","typeLabel":"string | null"}},"uniqueKey":"oAuthIdentities.oneOf.0.items.[INDEX]","typeLabel":"UserResponseOAuthIdentitiesItem · object"},"uniqueKey":"oAuthIdentities.oneOf.0","typeLabel":"UserResponseOAuthIdentitiesItem · object[]"},{"type":"null","items":{"title":"UserResponseOAuthIdentitiesItem","type":"object","properties":{"provider":{"oneOf":[{"type":"string"},{"type":"null"}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]}}},"uniqueKey":"oAuthIdentities.oneOf.1","typeLabel":"null"}],"uniqueKey":"oAuthIdentities","typeLabel":"UserResponseOAuthIdentitiesItem · object[] | null"},"subscription":{"oneOf":[{"title":"UserResponseSubscription","type":"object","properties":{"ends":{"oneOf":[{"title":"datetimeString","type":"string","uniqueKey":"subscription.oneOf.0.ends.oneOf.0","typeLabel":"string"},{"title":"datetimeString","type":"null","uniqueKey":"subscription.oneOf.0.ends.oneOf.1","typeLabel":"null"}],"uniqueKey":"subscription.oneOf.0.ends","typeLabel":"string | null"},"active":{"oneOf":[{"type":"boolean","uniqueKey":"subscription.oneOf.0.active.oneOf.0","typeLabel":"boolean"},{"type":"null","uniqueKey":"subscription.oneOf.0.active.oneOf.1","typeLabel":"null"}],"uniqueKey":"subscription.oneOf.0.active","typeLabel":"boolean | null"}},"uniqueKey":"subscription.oneOf.0","typeLabel":"UserResponseSubscription · object"},{"title":"UserResponseSubscription","type":"null","properties":{"ends":{"oneOf":[{"title":"datetimeString","type":"string"},{"title":"datetimeString","type":"null"}]},"active":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"uniqueKey":"subscription.oneOf.1","typeLabel":"null"}],"uniqueKey":"subscription","typeLabel":"UserResponseSubscription · object | null"},"license":{"oneOf":[{"title":"UserResponseLicense","type":"object","properties":{"ends":{"oneOf":[{"title":"datetimeString","type":"string","uniqueKey":"license.oneOf.0.ends.oneOf.0","typeLabel":"string"},{"title":"datetimeString","type":"null","uniqueKey":"license.oneOf.0.ends.oneOf.1","typeLabel":"null"}],"uniqueKey":"license.oneOf.0.ends","typeLabel":"string | null"},"active":{"oneOf":[{"type":"boolean","uniqueKey":"license.oneOf.0.active.oneOf.0","typeLabel":"boolean"},{"type":"null","uniqueKey":"license.oneOf.0.active.oneOf.1","typeLabel":"null"}],"uniqueKey":"license.oneOf.0.active","typeLabel":"boolean | null"}},"uniqueKey":"license.oneOf.0","typeLabel":"UserResponseLicense · object"},{"title":"UserResponseLicense","type":"null","properties":{"ends":{"oneOf":[{"title":"datetimeString","type":"string"},{"title":"datetimeString","type":"null"}]},"active":{"oneOf":[{"type":"boolean"},{"type":"null"}]}},"uniqueKey":"license.oneOf.1","typeLabel":"null"}],"uniqueKey":"license","typeLabel":"UserResponseLicense · object | null"}},"uniqueKey":"","typeLabel":"UserResponse · object"},"examples":{"Example":{"title":"Example","value":{"_id":"\u003cstring>","email":"\u003cstring>","name":"\u003cstring>","slug":"\u003cstring>","role":"\u003cstring>","stats":{"gamesCompleted":123,"concepts":{},"playTime":123},"oAuthIdentities":[{"provider":"\u003cstring>","id":"\u003cstring>"}],"subscription":{"ends":"\u003cstring>","active":true},"license":{"ends":"\u003cstring>","active":true}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"c591d831-a40a-4e2c-b2b5-f7a070cb894c":{"BasicAuth":{"type":"http","scheme":"basic","scopes":[]}}},"servers":{"dff43397-8a72-4de1-b165-3bc18a5651f0":{"url":"https://codecombat.com/api","description":"default"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"basic","scopes":[]},"schema":{"title":"Basic Auth","type":"object","description":"Basic authentication header of the form `Basic \u003cencoded-value>`, where `\u003cencoded-value>` is the base64-encoded string `username:password`.","isRequired":true,"properties":{"username":{"type":"string","uniqueKey":"username","isRequired":true,"typeLabel":"string","deprecated":false},"password":{"type":"string","uniqueKey":"password","isRequired":true,"typeLabel":"string","deprecated":false}},"additionalProperties":false,"deprecated":false},"schemeName":"BasicAuth","name":"Authorization"}],"title":"BasicAuth"}]},"originalFileLocation":"openapi.yml"},"subdomain":"codecombat","siteName":"CodeCombat","title":"Shorten User License - CodeCombat","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-06T22:47:09.355Z","originalFileLocation":"users/shorten-license.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"If the user already has access to the “Classroom” version up to a certain time, this shortens/revokes his/her access. If the ends is less than or equal to the current time, it revokes the enrollment and sets the end date to be the current time, else it just shortens the enrollment.\">\u003cmeta data-mint-head name=\"application-name\" content=\"CodeCombat\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/codecombat/_V_gvL1RP8Xq6h8q/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/codecombat/_V_gvL1RP8Xq6h8q/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/codecombat/_V_gvL1RP8Xq6h8q/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/codecombat/_V_gvL1RP8Xq6h8q/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/codecombat/_V_gvL1RP8Xq6h8q/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/codecombat/_V_gvL1RP8Xq6h8q/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/codecombat/_V_gvL1RP8Xq6h8q/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/codecombat/_V_gvL1RP8Xq6h8q/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/codecombat/_V_gvL1RP8Xq6h8q/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Shorten User License - CodeCombat\">\u003cmeta data-mint-head property=\"og:description\" content=\"If the user already has access to the “Classroom” version up to a certain time, this shortens/revokes his/her access. If the ends is less than or equal to the current time, it revokes the enrollment and sets the end date to be the current time, else it just shortens the enrollment.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"CodeCombat\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://api-docs.codecombat.com/users/shorten-license\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://codecombat.mintlify.site/_mintlify/api/og/v2?division=Users\u0026amp;title=Shorten+User+License\u0026amp;description=If+the+user+already+has+access+to+the+%E2%80%9CClassroom%E2%80%9D+version+up+to+a+certain+time%2C+this+shortens%2Frevokes+his%2Fher+access.+If+the+ends+is+less+than+or+equal+to+the+c\u0026amp;theme=c9a4e209c176b64ad043262d\u0026amp;signature=5a385966097435d40e2bebc568b3d7bd919d251a2acee5fd7ecf7518989c87eb\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Shorten User License - CodeCombat\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"If the user already has access to the “Classroom” version up to a certain time, this shortens/revokes his/her access. If the ends is less than or equal to the current time, it revokes the enrollment and sets the end date to be the current time, else it just shortens the enrollment.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://codecombat.mintlify.site/_mintlify/api/og/v2?division=Users\u0026amp;title=Shorten+User+License\u0026amp;description=If+the+user+already+has+access+to+the+%E2%80%9CClassroom%E2%80%9D+version+up+to+a+certain+time%2C+this+shortens%2Frevokes+his%2Fher+access.+If+the+ends+is+less+than+or+equal+to+the+c\u0026amp;theme=c9a4e209c176b64ad043262d\u0026amp;signature=5a385966097435d40e2bebc568b3d7bd919d251a2acee5fd7ecf7518989c87eb\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/codecombat/_V_gvL1RP8Xq6h8q/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"CodeCombat\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1FBAB4\">\u003clink data-mint-head rel=\"canonical\" href=\"https://api-docs.codecombat.com/users/shorten-license\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/users/shorten-license.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://api-docs.codecombat.com/#organization\",\"name\":\"CodeCombat\",\"url\":\"https://api-docs.codecombat.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintlify.s3.us-west-1.amazonaws.com/codecombat/logo/codecombatlogo.png\"}},{\"@type\":\"WebSite\",\"@id\":\"https://api-docs.codecombat.com#website\",\"name\":\"CodeCombat\",\"url\":\"https://api-docs.codecombat.com\",\"publisher\":{\"@id\":\"https://api-docs.codecombat.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://api-docs.codecombat.com/users/shorten-license#webpage\",\"url\":\"https://api-docs.codecombat.com/users/shorten-license\",\"name\":\"Shorten User License\",\"description\":\"If the user already has access to the “Classroom” version up to a certain time, this shortens/revokes his/her access. If the ends is less than or equal to the current time, it revokes the enrollment and sets the end date to be the current time, else it just shortens the enrollment.\",\"dateModified\":\"2026-01-06T22:47:09.355Z\",\"isPartOf\":{\"@id\":\"https://api-docs.codecombat.com#website\"},\"breadcrumb\":{\"@id\":\"https://api-docs.codecombat.com/users/shorten-license#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://api-docs.codecombat.com/users/shorten-license#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Users\",\"item\":\"https://api-docs.codecombat.com/users/post-users\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Shorten User License\",\"item\":\"https://api-docs.codecombat.com/users/shorten-license\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://api-docs.codecombat.com/users/shorten-license#apireference\",\"headline\":\"Shorten User License\",\"name\":\"Shorten User License\",\"description\":\"If the user already has access to the “Classroom” version up to a certain time, this shortens/revokes his/her access. If the ends is less than or equal to the current time, it revokes the enrollment and sets the end date to be the current time, else it just shortens the enrollment.\",\"url\":\"https://api-docs.codecombat.com/users/shorten-license\",\"mainEntityOfPage\":{\"@id\":\"https://api-docs.codecombat.com/users/shorten-license#webpage\"},\"dateModified\":\"2026-01-06T22:47:09.355Z\",\"publisher\":{\"@id\":\"https://api-docs.codecombat.com/#organization\"},\"isPartOf\":{\"@id\":\"https://api-docs.codecombat.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"CodeCombat\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"CodeCombat","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":"/introduction"},{"title":"Models","href":"/models"}]},{"group":"Users","pages":[{"openapi":"POST /users","title":"Create User","href":"/users/post-users"},{"openapi":"GET /users/{handle}","title":"Get User","href":"/users/get-users-handle"},{"openapi":"PUT /users/{handle}","title":"Update User","href":"/users/put-users-handle"},{"openapi":"GET /users/{handle}/classrooms","title":"Get Classrooms By User","href":"/users/get-classrooms"},{"openapi":"PUT /users/{handle}/hero-config","title":"Get User Hero","href":"/users/put-hero-config"},{"openapi":"PUT /users/{handle}/ace-config","title":"Put Ace Config","href":"/users/put-ace-config"},{"openapi":"POST /users/{handle}/o-auth-identities","title":"Add Oauth2 Identity","href":"/users/post-o-auth-identities"},{"openapi":"PUT /users/{handle}/subscription","title":"Put Subscription","href":"/users/put-subscription"},{"openapi":"PUT /users/{handle}/shorten-subscription","title":"Shorten User Subscription","href":"/users/shorten-subscription"},{"openapi":"PUT /users/{handle}/license","description":"Grants a user access to the Classroom version up to a certain time. Sets their role to student.","title":"Grant User License","href":"/users/license"},{"openapi":"PUT /users/{handle}/shorten-license","title":"Shorten User License","href":"/users/shorten-license"},{"openapi":"GET /user-lookup/{property}/{value}","title":"Search for User","description":"Redirects to `/users/{handle}` given a unique, identifying property","href":"/users/property-value"},{"title":"Users","href":"/users"}]},{"group":"Auth","pages":[{"openapi":"GET /auth/login-o-auth","title":"Login User","href":"/auth/login"}]},{"group":"Clans","pages":[{"openapi":"PUT /clan/{handle}/members","title":"Upsert User Into Clan","href":"/clans/members"}]},{"group":"Classrooms","pages":[{"openapi":"POST /classrooms","title":"Create a classroom","href":"/classrooms/post-classrooms"},{"openapi":"GET /classrooms","title":"Get Classroom Details","href":"/classrooms/get-classrooms"},{"openapi":"PUT /classrooms/{handle}/members","title":"Upsert a user from classroom","href":"/classrooms/put-handle-members"},{"openapi":"DELETE /classrooms/{handle}/members","title":"Delete User from Classroom","href":"/classrooms/delete-handle-members"},{"openapi":"PUT /classrooms/{classroomHandle}/courses/{courseHandle}/enrolled","title":"Enroll User in a Course","href":"/classrooms/enrolled"},{"openapi":"PUT /classrooms/{classroomHandle}/courses/{courseHandle}/remove-enrolled","title":"Remove User from a classroom","href":"/classrooms/remove-enrolled"},{"openapi":"GET /classrooms/{classroomHandle}/stats","title":"Get Member Stats","href":"/classrooms/get-stats"},{"openapi":"GET /classrooms/{classroomHandle}/members/{memberHandle}/sessions","title":"Get Level Session","href":"/classrooms/get-sessions"}]},{"group":"Stats","pages":[{"openapi":"GET /playtime-stats","title":"Get Playtime Stats","href":"/stats/playtime-stats"},{"openapi":"GET /license-stats","title":"Get License Stats","href":"/stats/license-stats"}]}]},{"anchor":"Blog","href":"https://blog.codecombat.com/","icon":"newspaper"},{"anchor":"Contact Us","href":"mailto:support@codecombat.com","icon":"envelope"}]},"basePath":"","title":"Shorten User License - CodeCombat","buildId":"dpl_DTau1J5HqS9UTgVSDwGksstFWtPa","deploymentId":"dpl_DTau1J5HqS9UTgVSDwGksstFWtPa","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-5FCzAcfS.js","utils-SLtAG4EZ.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-2DZi8ZMu.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-D7J3nkzE.js","snippetPresets-D0Alv0AH.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BI4qNJ2c.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BD3uyr8j.js","shallow-D8iEBr5z.js","getApiPlaygroundDisplay-CgNP4lzR.js","CodeSnippet-CX-QHuMs.js","CodeSnippets-VlXE-ZUf.js","Page-D9ithiIZ.js","getPastedJson-DYNQkZ1M.js","icon-CzacdwOi.js","MethodPill-2JVqoYKi.js","DuplicateIcon-_xVXs-U8.js","createIcon-BRHrweLo.js","DynamicMarkdown-mQG_iQiE.js","SectionHeading-DMpJzv8f.js","axios-vUo_bRtp.js","Markdown-5FGIym-8.js","clsx-D-TRO5q5.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CdrJecqK.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-CHlcWBLM.js"]}