Assign a course to specific users and/or groups. Assigning a group also assigns its subgroups.The request is all or nothing: if a listed user ID does not resolve to a user, nothing is assigned and the request fails with 400; if a listed user cannot be assigned (the user is blocked or not active, or has a role without permission to take courses), nothing is assigned and the request fails with 422.
Path Parameters
integer
required
The unique identifier of the course
Request Headers
string
required
API Key. Go to your Konstantly site > Settings > API and copy the value from there.
Request Body
At least one of users or groups must contain an ID.
array
Array of user IDs to assign the course to: Konstantly user IDs or your own user IDs (see User IDs). Each must be a positive integer or a non-empty string of at most 41 characters.
array
Array of group IDs to assign the course to
integer
Timestamp of date and time (UTC) when the course should be assigned. A time in the past is treated as now.
integer
Timestamp of date and time (UTC) of the deadline for course completion
object
Assign the course after a period from now instead of at a fixed time. Used when assignAt is not set.
Show Period properties
string
required
Time unit: seconds, minutes, hours, days, weeks, months or years
integer
required
Number of units
object
Deadline as a period counted from the assignment time. Used when deadlineAt is not set. Same properties as assignPeriod.
Response
array
required
Users the course was assigned to
Show User object properties
string
required
User ID: the external ID set when the user was created through the API, otherwise the internal ID as a string
string
required
User’s full name
string
required
User’s email
string
Always null in this response
string
required
Job title, or an empty string
string
required
Location, or an empty string
string
required
Timezone in TZ format, or an empty string
boolean
required
Whether the user is blocked
boolean
required
Whether the user is managed via API
integer
required
Authentication type (0 password, 1 LDAP)
integer
required
Creation timestamp
integer
Always null in this response
object
User avatar (id, mini 36x36, xSmall 58x58, small 128x128), or null
array
required
Groups the course was assigned to
Show Group object properties
integer
required
Group ID
integer
Parent group ID, or null
string
required
Group name
string
Group description
boolean
required
Whether the group is active
object
Group image (id, mini 36x36, small 330x130), or null
Error Responses
object
Returned when a user ID does not resolve to a user ("Unknown users: emp-7", with codeUSER_CANNOT_ASSIGN_UNKNOWN_ENTITY and the IDs in details.users). Nothing is assigned.
Show Error object properties
integer
required
HTTP status code (400)
string
required
Error message
string
required
USER_CANNOT_ASSIGN_UNKNOWN_ENTITY
object
The unknown IDs, keyed by users
object
Returned when the request cannot be processed. Nothing is assigned.
Show Error object properties
integer
required
HTTP status code (422)
string
required
Error message
string
required
FIELD_VALUE_MISMATCH_NUMBERS: an ID in users is neither a positive integer nor a non-empty string of at most 41 characters, or an ID in groups is not a positive integer
COURSE_ASSIGN_CANNOT_BE_EMPTY: neither users nor groups contains an ID
USER_NOT_ASSIGNABLE: one or more users cannot be assigned (named as you sent them)
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Konstantly API","colors":{"primary":"#2D75F1","light":"#4D9CFF","dark":"#0050B4"},"favicon":"https://mintcdn.com/konstantly/IZX1Cm1R4tlz6NjU/favicon.png?fit=max\u0026auto=format\u0026n=IZX1Cm1R4tlz6NjU\u0026q=85\u0026s=d4cf3c35c602f58f53c1e2ba387bee66","logo":{"light":"https://mintcdn.com/konstantly/OAmkSOvbwGm4V8Ni/logo/light.svg?fit=max\u0026auto=format\u0026n=OAmkSOvbwGm4V8Ni\u0026q=85\u0026s=8395f7500595e671fc7289817efaba3a","dark":"https://mintcdn.com/konstantly/IMnOWU1PWBY6nsdL/logo/dark.svg?fit=max\u0026auto=format\u0026n=IMnOWU1PWBY6nsdL\u0026q=85\u0026s=6994cb3f0d83e7cf38be394ef799f96e","href":"https://konstantly.com"},"api":{"mdx":{"server":"https://YOURSITE.konstantly.ai/api/v1"}},"navbar":{"links":[{"label":"Knowledge Base","href":"https://konstantly.com/help"},{"label":"Contact us","href":"https://konstantly.com?contact=true"}],"primary":{"type":"button","label":"Get started","href":"https://konstantly.com/pricing"}},"footer":{"socials":{"twitter":"https://twitter.com/konstantly","linkedin":"https://linkedin.com/company/konstantly","website":"https://konstantly.com"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"konstantly","hasAudioNarration":false,"actualSubdomain":"konstantly","customDomains":["docs.konstantly.com"],"gitSource":{"type":"github","owner":"edtch-lms","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"issues":true,"thumbs":true},"entitlements":{},"buildId":"6b0d061f7a9bb2bafcaf9991","clientVersion":"0.0.4410","searchFilterCounts":[{"language":"default","tag":"Users","count":15},{"language":"default","tag":"Courses","count":9},{"language":"default","tag":"Groups","count":9},{"language":"default","tag":"MCP Server","count":6},{"language":"default","tag":"Webhooks","count":5},{"language":"default","tag":"Custom Attributes","count":4},{"language":"default","tag":"Invitations","count":4},{"language":"default","tag":"Certificates","count":1},{"language":"default","tag":"Roles","count":1},{"language":"default","tag":"Statistics","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":"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":"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":"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":"turbopuffer-dual-write","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":"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":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/courses/course-assignments","slug":"/api-reference/courses/course-assignments","pageMetadata":{"title":"Assign Course","api":"POST /courses/{courseId}/assignments","description":"Assign the course to users or groups","href":"/api-reference/courses/course-assignments"},"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: \"Assign the course to users or groups\"\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{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,ul:`ul`,..._provideComponents(),...props.components},{Expandable,Heading,ParamField,ResponseField}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Assign a course to specific users and/or groups. Assigning a group also assigns its subgroups.`}),`\n`,_jsxs(_components.p,{children:[`The request is all or nothing: if a listed user ID does not resolve to a user, nothing is assigned and the request fails with `,_jsx(_components.code,{children:`400`}),`; if a listed user cannot be assigned (the user is blocked or not active, or has a role without permission to take courses), nothing is assigned and the request fails with `,_jsx(_components.code,{children:`422`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`path-parameters`,children:`Path Parameters`}),`\n`,_jsx(ParamField,{path:`courseId`,type:`integer`,required:true,id:`param-course-id`,children:_jsx(_components.p,{children:`The unique identifier of the course`})}),`\n`,_jsx(Heading,{level:`2`,id:`request-headers`,children:`Request Headers`}),`\n`,_jsx(ParamField,{header:`X-API-KEY`,type:`string`,required:true,id:`param-x-api-key`,children:_jsx(_components.p,{children:`API Key. Go to your Konstantly site > Settings > API and copy the value from there.`})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsxs(_components.p,{children:[`At least one of `,_jsx(_components.code,{children:`users`}),` or `,_jsx(_components.code,{children:`groups`}),` must contain an ID.`]}),`\n`,_jsx(ParamField,{body:`users`,type:`array`,id:`param-users`,children:_jsxs(_components.p,{children:[`Array of user IDs to assign the course to: Konstantly user IDs or your own user IDs (see `,_jsx(_components.a,{href:`/introduction#user-ids`,children:`User IDs`}),`). Each must be a positive integer or a non-empty string of at most 41 characters.`]})}),`\n`,_jsx(ParamField,{body:`groups`,type:`array`,id:`param-groups`,children:_jsx(_components.p,{children:`Array of group IDs to assign the course to`})}),`\n`,_jsx(ParamField,{body:`assignAt`,type:`integer`,id:`param-assign-at`,children:_jsx(_components.p,{children:`Timestamp of date and time (UTC) when the course should be assigned. A time in the past is treated as now.`})}),`\n`,_jsx(ParamField,{body:`deadlineAt`,type:`integer`,id:`param-deadline-at`,children:_jsx(_components.p,{children:`Timestamp of date and time (UTC) of the deadline for course completion`})}),`\n`,_jsxs(ParamField,{body:`assignPeriod`,type:`object`,id:`param-assign-period`,children:[_jsxs(_components.p,{children:[`Assign the course after a period from now instead of at a fixed time. Used when `,_jsx(_components.code,{children:`assignAt`}),` is not set.`]}),_jsxs(Expandable,{title:`Period properties`,children:[_jsxs(ParamField,{body:`measure`,type:`string`,required:true,id:`param-measure`,children:[`Time unit: `,_jsx(_components.code,{children:`seconds`}),`, `,_jsx(_components.code,{children:`minutes`}),`, `,_jsx(_components.code,{children:`hours`}),`, `,_jsx(_components.code,{children:`days`}),`, `,_jsx(_components.code,{children:`weeks`}),`, `,_jsx(_components.code,{children:`months`}),` or `,_jsx(_components.code,{children:`years`})]}),_jsx(ParamField,{body:`value`,type:`integer`,required:true,id:`param-value`,children:`Number of units`})]})]}),`\n`,_jsx(ParamField,{body:`deadlinePeriod`,type:`object`,id:`param-deadline-period`,children:_jsxs(_components.p,{children:[`Deadline as a period counted from the assignment time. Used when `,_jsx(_components.code,{children:`deadlineAt`}),` is not set. Same properties as `,_jsx(_components.code,{children:`assignPeriod`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(ResponseField,{name:`users`,type:`array`,required:true,id:`param-users-1`,children:[_jsx(_components.p,{children:`Users the course was assigned to`}),_jsxs(Expandable,{title:`User object properties`,children:[_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id`,children:`User ID: the external ID set when the user was created through the API, otherwise the internal ID as a string`}),_jsx(ResponseField,{name:`name`,type:`string`,required:true,id:`param-name`,children:`User’s full name`}),_jsx(ResponseField,{name:`email`,type:`string`,required:true,id:`param-email`,children:`User’s email`}),_jsxs(ResponseField,{name:`language`,type:`string`,id:`param-language`,children:[`Always `,_jsx(_components.code,{children:`null`}),` in this response`]}),_jsx(ResponseField,{name:`occupation`,type:`string`,required:true,id:`param-occupation`,children:`Job title, or an empty string`}),_jsx(ResponseField,{name:`location`,type:`string`,required:true,id:`param-location`,children:`Location, or an empty string`}),_jsx(ResponseField,{name:`timezone`,type:`string`,required:true,id:`param-timezone`,children:`Timezone in TZ format, or an empty string`}),_jsx(ResponseField,{name:`isBanned`,type:`boolean`,required:true,id:`param-is-banned`,children:`Whether the user is blocked`}),_jsx(ResponseField,{name:`fromApi`,type:`boolean`,required:true,id:`param-from-api`,children:`Whether the user is managed via API`}),_jsxs(ResponseField,{name:`authType`,type:`integer`,required:true,id:`param-auth-type`,children:[`Authentication type (`,_jsx(_components.code,{children:`0`}),` password, `,_jsx(_components.code,{children:`1`}),` LDAP)`]}),_jsx(ResponseField,{name:`createdAt`,type:`integer`,required:true,id:`param-created-at`,children:`Creation timestamp`}),_jsxs(ResponseField,{name:`lastActivity`,type:`integer`,id:`param-last-activity`,children:[`Always `,_jsx(_components.code,{children:`null`}),` in this response`]}),_jsxs(ResponseField,{name:`image`,type:`object`,id:`param-image`,children:[`User avatar (`,_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`mini`}),` 36x36, `,_jsx(_components.code,{children:`xSmall`}),` 58x58, `,_jsx(_components.code,{children:`small`}),` 128x128), or `,_jsx(_components.code,{children:`null`})]})]})]}),`\n`,_jsxs(ResponseField,{name:`groups`,type:`array`,required:true,id:`param-groups-1`,children:[_jsx(_components.p,{children:`Groups the course was assigned to`}),_jsxs(Expandable,{title:`Group object properties`,children:[_jsx(ResponseField,{name:`id`,type:`integer`,required:true,id:`param-id-1`,children:`Group ID`}),_jsxs(ResponseField,{name:`parentId`,type:`integer`,id:`param-parent-id`,children:[`Parent group ID, or `,_jsx(_components.code,{children:`null`})]}),_jsx(ResponseField,{name:`name`,type:`string`,required:true,id:`param-name-1`,children:`Group name`}),_jsx(ResponseField,{name:`description`,type:`string`,id:`param-description`,children:`Group description`}),_jsx(ResponseField,{name:`isActive`,type:`boolean`,required:true,id:`param-is-active`,children:`Whether the group is active`}),_jsxs(ResponseField,{name:`image`,type:`object`,id:`param-image-1`,children:[`Group image (`,_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`mini`}),` 36x36, `,_jsx(_components.code,{children:`small`}),` 330x130), or `,_jsx(_components.code,{children:`null`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsxs(ResponseField,{name:`400`,type:`object`,id:`param-400`,children:[_jsxs(_components.p,{children:[`Returned when a user ID does not resolve to a user (`,_jsx(_components.code,{children:`\"Unknown users: emp-7\"`}),`, with `,_jsx(_components.code,{children:`code`}),` `,_jsx(_components.code,{children:`USER_CANNOT_ASSIGN_UNKNOWN_ENTITY`}),` and the IDs in `,_jsx(_components.code,{children:`details.users`}),`). Nothing is assigned.`]}),_jsxs(Expandable,{title:`Error object properties`,children:[_jsx(ResponseField,{name:`status`,type:`integer`,required:true,id:`param-status`,children:`HTTP status code (400)`}),_jsx(ResponseField,{name:`message`,type:`string`,required:true,id:`param-message`,children:`Error message`}),_jsx(ResponseField,{name:`code`,type:`string`,required:true,id:`param-code`,children:_jsx(_components.code,{children:`USER_CANNOT_ASSIGN_UNKNOWN_ENTITY`})}),_jsxs(ResponseField,{name:`details`,type:`object`,id:`param-details`,children:[`The unknown IDs, keyed by `,_jsx(_components.code,{children:`users`})]})]})]}),`\n`,_jsxs(ResponseField,{name:`422`,type:`object`,id:`param-422`,children:[_jsx(_components.p,{children:`Returned when the request cannot be processed. Nothing is assigned.`}),_jsxs(Expandable,{title:`Error object properties`,children:[_jsx(ResponseField,{name:`status`,type:`integer`,required:true,id:`param-status-1`,children:`HTTP status code (422)`}),_jsx(ResponseField,{name:`message`,type:`string`,required:true,id:`param-message-1`,children:`Error message`}),_jsx(ResponseField,{name:`code`,type:`string`,required:true,id:`param-code-1`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`FIELD_VALUE_MISMATCH_NUMBERS`}),`: an ID in `,_jsx(_components.code,{children:`users`}),` is neither a positive integer nor a non-empty string of at most 41 characters, or an ID in `,_jsx(_components.code,{children:`groups`}),` is not a positive integer`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`COURSE_ASSIGN_CANNOT_BE_EMPTY`}),`: neither `,_jsx(_components.code,{children:`users`}),` nor `,_jsx(_components.code,{children:`groups`}),` contains an ID`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`USER_NOT_ASSIGNABLE`}),`: one or more users cannot be assigned (named as you sent them)`]}),`\n`]})}),_jsxs(ResponseField,{name:`details`,type:`object`,id:`param-details-1`,children:[`The offending IDs, keyed by `,_jsx(_components.code,{children:`users`}),` and/or `,_jsx(_components.code,{children:`groups`})]})]})]})]})}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":{"title":"Assign Course","api":"POST /courses/{courseId}/assignments","description":"Assign the course to users or groups","href":"/api-reference/courses/course-assignments"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Assign a course to specific users and/or groups. Assigning a group also assigns its subgroups.`}),`\n`,_jsxs(_components.p,{children:[`The request is all or nothing: if a listed user ID does not resolve to a user, nothing is assigned and the request fails with `,_jsx(_components.code,{children:`400`}),`; if a listed user cannot be assigned (the user is blocked or not active, or has a role without permission to take courses), nothing is assigned and the request fails with `,_jsx(_components.code,{children:`422`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`path-parameters`,children:`Path Parameters`}),`\n`,_jsx(ParamField,{path:`courseId`,type:`integer`,required:true,id:`param-course-id`,children:_jsx(_components.p,{children:`The unique identifier of the course`})}),`\n`,_jsx(Heading,{level:`2`,id:`request-headers`,children:`Request Headers`}),`\n`,_jsx(ParamField,{header:`X-API-KEY`,type:`string`,required:true,id:`param-x-api-key`,children:_jsx(_components.p,{children:`API Key. Go to your Konstantly site > Settings > API and copy the value from there.`})}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsxs(_components.p,{children:[`At least one of `,_jsx(_components.code,{children:`users`}),` or `,_jsx(_components.code,{children:`groups`}),` must contain an ID.`]}),`\n`,_jsx(ParamField,{body:`users`,type:`array`,id:`param-users`,children:_jsxs(_components.p,{children:[`Array of user IDs to assign the course to: Konstantly user IDs or your own user IDs (see `,_jsx(_components.a,{href:`/introduction#user-ids`,children:`User IDs`}),`). Each must be a positive integer or a non-empty string of at most 41 characters.`]})}),`\n`,_jsx(ParamField,{body:`groups`,type:`array`,id:`param-groups`,children:_jsx(_components.p,{children:`Array of group IDs to assign the course to`})}),`\n`,_jsx(ParamField,{body:`assignAt`,type:`integer`,id:`param-assign-at`,children:_jsx(_components.p,{children:`Timestamp of date and time (UTC) when the course should be assigned. A time in the past is treated as now.`})}),`\n`,_jsx(ParamField,{body:`deadlineAt`,type:`integer`,id:`param-deadline-at`,children:_jsx(_components.p,{children:`Timestamp of date and time (UTC) of the deadline for course completion`})}),`\n`,_jsxs(ParamField,{body:`assignPeriod`,type:`object`,id:`param-assign-period`,children:[_jsxs(_components.p,{children:[`Assign the course after a period from now instead of at a fixed time. Used when `,_jsx(_components.code,{children:`assignAt`}),` is not set.`]}),_jsxs(Expandable,{title:`Period properties`,children:[_jsxs(ParamField,{body:`measure`,type:`string`,required:true,id:`param-measure`,children:[`Time unit: `,_jsx(_components.code,{children:`seconds`}),`, `,_jsx(_components.code,{children:`minutes`}),`, `,_jsx(_components.code,{children:`hours`}),`, `,_jsx(_components.code,{children:`days`}),`, `,_jsx(_components.code,{children:`weeks`}),`, `,_jsx(_components.code,{children:`months`}),` or `,_jsx(_components.code,{children:`years`})]}),_jsx(ParamField,{body:`value`,type:`integer`,required:true,id:`param-value`,children:`Number of units`})]})]}),`\n`,_jsx(ParamField,{body:`deadlinePeriod`,type:`object`,id:`param-deadline-period`,children:_jsxs(_components.p,{children:[`Deadline as a period counted from the assignment time. Used when `,_jsx(_components.code,{children:`deadlineAt`}),` is not set. Same properties as `,_jsx(_components.code,{children:`assignPeriod`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(ResponseField,{name:`users`,type:`array`,required:true,id:`param-users-1`,children:[_jsx(_components.p,{children:`Users the course was assigned to`}),_jsxs(Expandable,{title:`User object properties`,children:[_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id`,children:`User ID: the external ID set when the user was created through the API, otherwise the internal ID as a string`}),_jsx(ResponseField,{name:`name`,type:`string`,required:true,id:`param-name`,children:`User’s full name`}),_jsx(ResponseField,{name:`email`,type:`string`,required:true,id:`param-email`,children:`User’s email`}),_jsxs(ResponseField,{name:`language`,type:`string`,id:`param-language`,children:[`Always `,_jsx(_components.code,{children:`null`}),` in this response`]}),_jsx(ResponseField,{name:`occupation`,type:`string`,required:true,id:`param-occupation`,children:`Job title, or an empty string`}),_jsx(ResponseField,{name:`location`,type:`string`,required:true,id:`param-location`,children:`Location, or an empty string`}),_jsx(ResponseField,{name:`timezone`,type:`string`,required:true,id:`param-timezone`,children:`Timezone in TZ format, or an empty string`}),_jsx(ResponseField,{name:`isBanned`,type:`boolean`,required:true,id:`param-is-banned`,children:`Whether the user is blocked`}),_jsx(ResponseField,{name:`fromApi`,type:`boolean`,required:true,id:`param-from-api`,children:`Whether the user is managed via API`}),_jsxs(ResponseField,{name:`authType`,type:`integer`,required:true,id:`param-auth-type`,children:[`Authentication type (`,_jsx(_components.code,{children:`0`}),` password, `,_jsx(_components.code,{children:`1`}),` LDAP)`]}),_jsx(ResponseField,{name:`createdAt`,type:`integer`,required:true,id:`param-created-at`,children:`Creation timestamp`}),_jsxs(ResponseField,{name:`lastActivity`,type:`integer`,id:`param-last-activity`,children:[`Always `,_jsx(_components.code,{children:`null`}),` in this response`]}),_jsxs(ResponseField,{name:`image`,type:`object`,id:`param-image`,children:[`User avatar (`,_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`mini`}),` 36x36, `,_jsx(_components.code,{children:`xSmall`}),` 58x58, `,_jsx(_components.code,{children:`small`}),` 128x128), or `,_jsx(_components.code,{children:`null`})]})]})]}),`\n`,_jsxs(ResponseField,{name:`groups`,type:`array`,required:true,id:`param-groups-1`,children:[_jsx(_components.p,{children:`Groups the course was assigned to`}),_jsxs(Expandable,{title:`Group object properties`,children:[_jsx(ResponseField,{name:`id`,type:`integer`,required:true,id:`param-id-1`,children:`Group ID`}),_jsxs(ResponseField,{name:`parentId`,type:`integer`,id:`param-parent-id`,children:[`Parent group ID, or `,_jsx(_components.code,{children:`null`})]}),_jsx(ResponseField,{name:`name`,type:`string`,required:true,id:`param-name-1`,children:`Group name`}),_jsx(ResponseField,{name:`description`,type:`string`,id:`param-description`,children:`Group description`}),_jsx(ResponseField,{name:`isActive`,type:`boolean`,required:true,id:`param-is-active`,children:`Whether the group is active`}),_jsxs(ResponseField,{name:`image`,type:`object`,id:`param-image-1`,children:[`Group image (`,_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`mini`}),` 36x36, `,_jsx(_components.code,{children:`small`}),` 330x130), or `,_jsx(_components.code,{children:`null`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsxs(ResponseField,{name:`400`,type:`object`,id:`param-400`,children:[_jsxs(_components.p,{children:[`Returned when a user ID does not resolve to a user (`,_jsx(_components.code,{children:`\"Unknown users: emp-7\"`}),`, with `,_jsx(_components.code,{children:`code`}),` `,_jsx(_components.code,{children:`USER_CANNOT_ASSIGN_UNKNOWN_ENTITY`}),` and the IDs in `,_jsx(_components.code,{children:`details.users`}),`). Nothing is assigned.`]}),_jsxs(Expandable,{title:`Error object properties`,children:[_jsx(ResponseField,{name:`status`,type:`integer`,required:true,id:`param-status`,children:`HTTP status code (400)`}),_jsx(ResponseField,{name:`message`,type:`string`,required:true,id:`param-message`,children:`Error message`}),_jsx(ResponseField,{name:`code`,type:`string`,required:true,id:`param-code`,children:_jsx(_components.code,{children:`USER_CANNOT_ASSIGN_UNKNOWN_ENTITY`})}),_jsxs(ResponseField,{name:`details`,type:`object`,id:`param-details`,children:[`The unknown IDs, keyed by `,_jsx(_components.code,{children:`users`})]})]})]}),`\n`,_jsxs(ResponseField,{name:`422`,type:`object`,id:`param-422`,children:[_jsx(_components.p,{children:`Returned when the request cannot be processed. Nothing is assigned.`}),_jsxs(Expandable,{title:`Error object properties`,children:[_jsx(ResponseField,{name:`status`,type:`integer`,required:true,id:`param-status-1`,children:`HTTP status code (422)`}),_jsx(ResponseField,{name:`message`,type:`string`,required:true,id:`param-message-1`,children:`Error message`}),_jsx(ResponseField,{name:`code`,type:`string`,required:true,id:`param-code-1`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`FIELD_VALUE_MISMATCH_NUMBERS`}),`: an ID in `,_jsx(_components.code,{children:`users`}),` is neither a positive integer nor a non-empty string of at most 41 characters, or an ID in `,_jsx(_components.code,{children:`groups`}),` is not a positive integer`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`COURSE_ASSIGN_CANNOT_BE_EMPTY`}),`: neither `,_jsx(_components.code,{children:`users`}),` nor `,_jsx(_components.code,{children:`groups`}),` contains an ID`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`USER_NOT_ASSIGNABLE`}),`: one or more users cannot be assigned (named as you sent them)`]}),`\n`]})}),_jsxs(ResponseField,{name:`details`,type:`object`,id:`param-details-1`,children:[`The offending IDs, keyed by `,_jsx(_components.code,{children:`users`}),` and/or `,_jsx(_components.code,{children:`groups`})]})]})]}),`\n`,_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--url `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`https://YOURSITE.konstantly.ai/api/v1/courses/123/assignments`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--data `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"users\": [1, 2, 3],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"groups\": [4, 5],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assignAt\": 1676937600,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"deadlineAt\": 1677024000`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})})}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:``,numberOfLines:`29`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`29`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"users\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"emp-1042\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"John Doe\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"email\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"john@example.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"language\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"occupation\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"location\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"timezone\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Europe/London\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"isBanned\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"fromApi\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"authType\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"createdAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1676937600`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"lastActivity\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"image\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"groups\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"parentId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Sales Team\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"image\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"isActive\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`422 Error`,numberOfLines:`8`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`422`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Cannot assign users: 2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"USER_NOT_ASSIGNABLE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"details\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"users\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]})]})}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":{"title":"Assign Course","api":"POST /courses/{courseId}/assignments","description":"Assign the course to users or groups","href":"/api-reference/courses/course-assignments"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Path Parameters","slug":"path-parameters","depth":2,"children":[]},{"title":"Request Headers","slug":"request-headers","depth":2,"children":[]},{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[{"title":"Error Responses","slug":"error-responses","depth":3,"children":[]}]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"10\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --request\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">--url \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">https://YOURSITE.konstantly.ai/api/v1/courses/123/assignments\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">--header \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'X-API-KEY: 1qaz2wsx3edc4rfv1qaz2wsx3edc4rfv'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">--header \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Content-Type: application/json'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">--data \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"users\": [1, 2, 3],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"groups\": [4, 5],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"assignAt\": 1676937600,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"deadlineAt\": 1677024000\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">}'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"29\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"users\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"emp-1042\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"name\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"John Doe\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"email\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"john@example.com\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"language\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"occupation\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"location\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"timezone\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Europe/London\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"isBanned\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">false\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"fromApi\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"authType\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"createdAt\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1676937600\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"lastActivity\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"image\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"groups\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">4\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"parentId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"name\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Sales Team\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"description\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"image\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"isActive\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"422 Error","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"8\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">422\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Cannot assign users: 2\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"USER_NOT_ASSIGNABLE\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"details\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"users\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Assign Course","path":"/courses/{courseId}/assignments","servers":[{"url":"https://YOURSITE.konstantly.ai/api/v1"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{"X-API-KEY":{"schema":[{"type":"string","description":"API Key. Go to your Konstantly site > Settings > API and copy the value from there.","required":true}]}},"cookie":{},"path":{"courseId":{"schema":[{"type":"integer","description":"The unique identifier of the course","required":true}]}}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"users":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"Array of user IDs to assign the course to: Konstantly user IDs or your own user IDs (see User IDs ). Each must be a positive integer or a non-empty string of at most 41 characters."}],"groups":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"Array of group IDs to assign the course to"}],"assignAt":[{"type":"integer","description":"Timestamp of date and time (UTC) when the course should be assigned. A time in the past is treated as now."}],"deadlineAt":[{"type":"integer","description":"Timestamp of date and time (UTC) of the deadline for course completion"}],"assignPeriod":[{"type":"object","properties":{"measure":[{"type":"string","description":"Time unit: `seconds` , `minutes` , `hours` , `days` , `weeks` , `months` or `years`","required":true}],"value":[{"type":"integer","description":"Number of units","required":true}]},"description":"Assign the course after a period from now instead of at a fixed time. Used when `assignAt` is not set."}],"deadlinePeriod":[{"type":"object","properties":{},"description":"Deadline as a period counted from the assignment time. Used when `deadlineAt` is not set. Same properties as `assignPeriod` ."}]}}],"examples":{"example":{"value":{"users":[{}],"groups":[{}],"assignAt":123,"deadlineAt":123,"assignPeriod":{"measure":"\u003cstring>","value":123},"deadlinePeriod":{}}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"400":[{"type":"object","properties":{"status":[{"type":"integer","description":"HTTP status code (400)","required":true}],"message":[{"type":"string","description":"Error message","required":true}],"code":[{"type":"string","description":"`USER_CANNOT_ASSIGN_UNKNOWN_ENTITY`","required":true}],"details":[{"type":"object","properties":{},"description":"The unknown IDs, keyed by `users`"}]},"description":"Returned when a user ID does not resolve to a user ( `\"Unknown users: emp-7\"` , with `code` `USER_CANNOT_ASSIGN_UNKNOWN_ENTITY` and the IDs in `details.users` ). Nothing is assigned."}],"422":[{"type":"object","properties":{"status":[{"type":"integer","description":"HTTP status code (422)","required":true}],"message":[{"type":"string","description":"Error message","required":true}],"code":[{"type":"string","description":"`FIELD_VALUE_MISMATCH_NUMBERS` : an ID in `users` is neither a positive integer nor a non-empty string of at most 41 characters, or an ID in `groups` is not a positive integer `COURSE_ASSIGN_CANNOT_BE_EMPTY` : neither `users` nor `groups` contains an ID `USER_NOT_ASSIGNABLE` : one or more users cannot be assigned (named as you sent them)","required":true}],"details":[{"type":"object","properties":{},"description":"The offending IDs, keyed by `users` and/or `groups`"}]},"description":"Returned when the request cannot be processed. Nothing is assigned."}],"users":[{"type":"array","items":[{"type":"object","properties":{"id":[{"type":"string","description":"User ID: the external ID set when the user was created through the API, otherwise the internal ID as a string","required":true}],"name":[{"type":"string","description":"User’s full name","required":true}],"email":[{"type":"string","description":"User’s email","required":true}],"language":[{"type":"string","description":"Always `null` in this response"}],"occupation":[{"type":"string","description":"Job title, or an empty string","required":true}],"location":[{"type":"string","description":"Location, or an empty string","required":true}],"timezone":[{"type":"string","description":"Timezone in TZ format, or an empty string","required":true}],"isBanned":[{"type":"boolean","description":"Whether the user is blocked","required":true}],"fromApi":[{"type":"boolean","description":"Whether the user is managed via API","required":true}],"authType":[{"type":"integer","description":"Authentication type ( `0` password, `1` LDAP)","required":true}],"createdAt":[{"type":"integer","description":"Creation timestamp","required":true}],"lastActivity":[{"type":"integer","description":"Always `null` in this response"}],"image":[{"type":"object","properties":{},"description":"User avatar ( `id` , `mini` 36x36, `xSmall` 58x58, `small` 128x128), or `null`"}]}}],"description":"Users the course was assigned to","required":true}],"groups":[{"type":"array","items":[{"type":"object","properties":{"id":[{"type":"integer","description":"Group ID","required":true}],"parentId":[{"type":"integer","description":"Parent group ID, or `null`"}],"name":[{"type":"string","description":"Group name","required":true}],"description":[{"type":"string","description":"Group description"}],"isActive":[{"type":"boolean","description":"Whether the group is active","required":true}],"image":[{"type":"object","properties":{},"description":"Group image ( `id` , `mini` 36x36, `small` 330x130), or `null`"}]}}],"description":"Groups the course was assigned to","required":true}]}}],"examples":{"example":{"value":{"400":{"status":123,"message":"\u003cstring>","code":"\u003cstring>","details":{}},"422":{"status":123,"message":"\u003cstring>","code":"\u003cstring>","details":{}},"users":[{"id":"\u003cstring>","name":"\u003cstring>","email":"\u003cstring>","language":"\u003cstring>","occupation":"\u003cstring>","location":"\u003cstring>","timezone":"\u003cstring>","isBanned":true,"fromApi":true,"authType":123,"createdAt":123,"lastActivity":123,"image":{}}],"groups":[{"id":123,"parentId":123,"name":"\u003cstring>","description":"\u003cstring>","isActive":true,"image":{}}]}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"konstantly","siteName":"Konstantly API","title":"Assign Course - Konstantly API","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-30T01:39:24.379Z","originalFileLocation":"api-reference/courses/course-assignments.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=\"Assign the course to users or groups\">\u003cmeta data-mint-head name=\"application-name\" content=\"Konstantly API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/konstantly/YzkpdHKE_BXzW4sG/_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/konstantly/YzkpdHKE_BXzW4sG/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/konstantly/YzkpdHKE_BXzW4sG/_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/konstantly/YzkpdHKE_BXzW4sG/_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/konstantly/YzkpdHKE_BXzW4sG/_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/konstantly/YzkpdHKE_BXzW4sG/_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/konstantly/YzkpdHKE_BXzW4sG/_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/konstantly/YzkpdHKE_BXzW4sG/_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/konstantly/YzkpdHKE_BXzW4sG/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Assign Course - Konstantly API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Assign the course to users or groups\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Konstantly API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.konstantly.com/api-reference/courses/course-assignments\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://konstantly.mintlify.site/_mintlify/api/og/v2?division=Courses\u0026amp;title=Assign+Course\u0026amp;description=Assign+the+course+to+users+or+groups\u0026amp;theme=ac25a85b3c18c457049fdb8e\u0026amp;signature=164a70a9a5898c86469b33257860708b890af3a8dfa2ac6f3a80e633e35cc2d5\">\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=\"Assign Course - Konstantly API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Assign the course to users or groups\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://konstantly.mintlify.site/_mintlify/api/og/v2?division=Courses\u0026amp;title=Assign+Course\u0026amp;description=Assign+the+course+to+users+or+groups\u0026amp;theme=ac25a85b3c18c457049fdb8e\u0026amp;signature=164a70a9a5898c86469b33257860708b890af3a8dfa2ac6f3a80e633e35cc2d5\">\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/konstantly/YzkpdHKE_BXzW4sG/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Konstantly API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2D75F1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.konstantly.com/api-reference/courses/course-assignments\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/courses/course-assignments.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.konstantly.com/#organization\",\"name\":\"Konstantly API\",\"url\":\"https://docs.konstantly.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/konstantly/OAmkSOvbwGm4V8Ni/logo/light.svg?fit=max\u0026auto=format\u0026n=OAmkSOvbwGm4V8Ni\u0026q=85\u0026s=8395f7500595e671fc7289817efaba3a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.konstantly.com#website\",\"name\":\"Konstantly API\",\"url\":\"https://docs.konstantly.com\",\"publisher\":{\"@id\":\"https://docs.konstantly.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.konstantly.com/api-reference/courses/course-assignments#webpage\",\"url\":\"https://docs.konstantly.com/api-reference/courses/course-assignments\",\"name\":\"Assign Course\",\"description\":\"Assign the course to users or groups\",\"dateModified\":\"2026-11-30T01:39:24.379Z\",\"isPartOf\":{\"@id\":\"https://docs.konstantly.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.konstantly.com/api-reference/courses/course-assignments#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.konstantly.com/api-reference/courses/course-assignments#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Courses\",\"item\":\"https://docs.konstantly.com/api-reference/courses/get-courses\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Assign Course\",\"item\":\"https://docs.konstantly.com/api-reference/courses/course-assignments\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.konstantly.com/api-reference/courses/course-assignments#apireference\",\"headline\":\"Assign Course\",\"name\":\"Assign Course\",\"description\":\"Assign the course to users or groups\",\"url\":\"https://docs.konstantly.com/api-reference/courses/course-assignments\",\"mainEntityOfPage\":{\"@id\":\"https://docs.konstantly.com/api-reference/courses/course-assignments#webpage\"},\"dateModified\":\"2026-11-30T01:39:24.379Z\",\"publisher\":{\"@id\":\"https://docs.konstantly.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.konstantly.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Konstantly API\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Konstantly API\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/courses/course-assignments.md","siteName":"Konstantly API","nav":{"global":null,"groups":[{"group":"Getting Started","pages":[{"title":"Introduction","icon":"book","href":"/introduction"}]},{"group":"Courses","pages":[{"title":"List Courses","api":"GET /courses","href":"/api-reference/courses/get-courses"},{"title":"Get Course","api":"GET /courses/{courseId}","description":"Get detailed information about a specific course","href":"/api-reference/courses/get-course"},{"title":"Assign Course","api":"POST /courses/{courseId}/assignments","href":"/api-reference/courses/course-assignments"},{"title":"List Course Users","api":"GET /courses/{courseId}/assignments/users","description":"Get the list of users assigned to the course","href":"/api-reference/courses/course-assignments-users"},{"title":"List Course Groups","api":"GET /courses/{courseId}/assignments/groups","href":"/api-reference/courses/course-assignments-groups"},{"title":"List Course Certificates","api":"GET /courses/{courseId}/certificates","href":"/api-reference/courses/course-certificates"},{"title":"Get Course Statistics","api":"GET /courses/{courseId}/statistics","href":"/api-reference/courses/course-statistics"},{"title":"Unassign Group from Course","api":"DELETE /courses/{courseId}/assignments/groups/{groupId}","href":"/api-reference/courses/unassign-course-group"},{"title":"Unassign User from Course","api":"DELETE /courses/{courseId}/assignments/users/{userId}","href":"/api-reference/courses/unassign-course-user"}]},{"group":"Users","pages":[{"title":"Get Users","api":"GET /users","href":"/api-reference/users/get-users"},{"title":"Create User","api":"POST /users","href":"/api-reference/users/create-user"},{"title":"Get User by ID","api":"GET /users/{userId}","href":"/api-reference/users/get-user-by-id"},{"title":"Get User by Email","api":"GET /users/byEmail/{userEmail}","href":"/api-reference/users/get-user-by-email"},{"title":"Update User","api":"POST /users/{userId}/edit","href":"/api-reference/users/update-user"},{"title":"Delete User","api":"DELETE /users/{userId}","href":"/api-reference/users/delete-user"},{"title":"Deactivate User","api":"POST /users/blocked","href":"/api-reference/users/block-user"},{"title":"Activate User","api":"POST /users/{userId}/unblock","href":"/api-reference/users/unblock-user"},{"title":"Get User Assignments","api":"GET /users/{userId}/assignments","href":"/api-reference/users/get-user-assignments"},{"title":"Assign Courses to User","api":"POST /users/{userId}/assignments","href":"/api-reference/users/post-user-assignments"},{"title":"Get User Certificates","api":"GET /users/{userId}/certificates","href":"/api-reference/users/user-certificates"},{"title":"List User Groups","api":"GET /users/{userId}/groups","href":"/api-reference/users/get-user-groups"},{"title":"User Groups","api":"POST /users/{userId}/groups","href":"/api-reference/users/user-groups"},{"title":"Get SSO URL","api":"GET /users/{userId}/sso","href":"/api-reference/users/user-sso"},{"title":"Get User Statistics","api":"GET /users/{userId}/statistics","href":"/api-reference/users/user-statistics"}]},{"group":"Groups","pages":[{"title":"List Groups","api":"GET /groups","href":"/api-reference/groups/get-groups"},{"title":"Create Group","api":"POST /groups","href":"/api-reference/groups/create-group"},{"title":"Get Group","api":"GET /groups/{groupId}","href":"/api-reference/groups/get-group"},{"title":"Update Group","api":"PATCH /groups/{groupId}","href":"/api-reference/groups/update-group"},{"title":"Delete Group","api":"DELETE /groups/{groupId}","href":"/api-reference/groups/delete-group"},{"title":"List Group Assignments","api":"GET /groups/{groupId}/assignments","href":"/api-reference/groups/group-assignments"},{"title":"Add Users to Group","api":"POST /groups/{groupId}/users","href":"/api-reference/groups/group-users"},{"title":"Remove User from Group","api":"DELETE /groups/{groupId}/users/{userId}","href":"/api-reference/groups/remove-user-from-group"},{"title":"Group Statistics","api":"GET /groups/{groupId}/statistics","href":"/api-reference/groups/group-statistics"}]},{"group":"Certificates","pages":[{"title":"Get Certificate","api":"GET /certificates/{certificateId}","href":"/api-reference/certificates/get-certificate"}]},{"group":"Custom Attributes","pages":[{"title":"Get User Custom Attributes","api":"GET /custom/attributes/users","href":"/api-reference/custom-attributes/get-user-attributes"},{"title":"Update User Custom Attributes","api":"POST /custom/attributes/users","href":"/api-reference/custom-attributes/update-user-attributes"},{"title":"Get Group Custom Attributes","api":"GET /custom/attributes/groups","href":"/api-reference/custom-attributes/get-group-attributes"},{"title":"Update Group Custom Attributes","api":"POST /custom/attributes/groups","href":"/api-reference/custom-attributes/update-group-attributes"}]},{"group":"Statistics","pages":[{"title":"Get Global Statistics","api":"GET /statistics","href":"/api-reference/statistics/get-global-statistics"}]},{"group":"Invitations","pages":[{"title":"Get Invitations","api":"GET /invites","href":"/api-reference/invitations/get-invites"},{"title":"Create Invitations","api":"POST /invites","href":"/api-reference/invitations/create-invite"},{"title":"Get Invitation","api":"GET /invites/{inviteId}","href":"/api-reference/invitations/get-invite"},{"title":"Cancel Invitation","api":"DELETE /invites/{inviteId}","href":"/api-reference/invitations/delete-invite"}]},{"group":"Roles","pages":[{"title":"Get Roles","api":"GET /roles","href":"/api-reference/roles/get-roles"}]},{"group":"Webhooks","pages":[{"title":"Webhooks Overview","href":"/api-reference/webhooks/overview"},{"title":"Course Webhook Events","href":"/api-reference/webhooks/course-webhooks"},{"title":"User Webhook Events","href":"/api-reference/webhooks/user-webhooks"},{"title":"Group Webhooks","href":"/api-reference/webhooks/group-webhooks"},{"title":"Get Last Event","api":"GET /webhook/:event/last","href":"/api-reference/webhooks/get-last-event"}]},{"group":"MCP Server","pages":[{"title":"MCP Server Overview","icon":"plug","href":"/api-reference/mcp/overview"},{"title":"Quickstart","icon":"rocket","href":"/api-reference/mcp/quickstart"},{"title":"Authentication","icon":"key","href":"/api-reference/mcp/authentication"},{"title":"Tools Reference","icon":"wrench","href":"/api-reference/mcp/tools-reference"},{"title":"Permissions Matrix","icon":"user-shield","href":"/api-reference/mcp/permissions"},{"title":"Security","icon":"lock","href":"/api-reference/mcp/security"}]}]},"basePath":"","title":"Assign Course - Konstantly API","deploymentId":"dpl_3VZr4zL4q2wbintGwWjSCGUgnuP7","buildId":"dpl_3VZr4zL4q2wbintGwWjSCGUgnuP7","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-DUG0fxZu.js","snippetPresets-Ba5aWAdQ.js","utils-GxQLQihZ.js","style-to-object-BY3JEAdk.js","utils-WKMM_gjD.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-Bo9LYdaA.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DwYjaFhs.js","_Uint8Array-DDE2Hehm.js","isObject-FP1Yky1u.js","ApiExamples-DhR-5ORn.js","usePlaygroundInputsStore-BaYqfAgH.js","shallow-BC7UwQwD.js","isEqual-gcN6MEQu.js","CodeSnippets-B8P54LrN.js","CodeSnippet-Czwn5OJE.js","use-playground-group-access-C3A6I116.js","Page-CUkc1DBo.js","api-description-markdown-CDE0Fpj5.js","DynamicMarkdown-F4EfLno9.js","SectionHeading-DMe18In2.js","MethodPill-CW7tTaiB.js","getPastedJson-DB5smC0Q.js","Check2Icon-DDdveNjm.js","axios-CsQoIw0U.js"]}