using RestSharp;
var options = new RestClientOptions("https://myorg.tribalhabits.com/papi/topic_assignments");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"user_name\": \"user1@example.com\",\n \"enrolment_code_1\": \"TH-4-77-NEW\",\n \"enrolment_code_1_due_date\": \"31/12/2021\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
This endpoint creates or updates topic or pathway enrolments for one user, using enrolment codes. It is the single endpoint for creating and updating all enrolments, including pathway enrolments. Use the UPDATE action code to change dates on an existing enrolment. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes.
Up to 5 enrolments can be given, using the enrolment_code_N fields where N is from 1..5.
The response lists the user’s current enrolment for each code. For pathway codes, each item has the pathway enrolment fields instead. If any code or date is invalid, 400 is returned with a list of errors, for example {"errors":["'TH-4-999' does not correspond to a known topic or pathway"]}. If the user cannot be found, 404 is returned with {"errors":["Cannot find user"]}.
using RestSharp;
var options = new RestClientOptions("https://myorg.tribalhabits.com/papi/topic_assignments");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"user_name\": \"user1@example.com\",\n \"enrolment_code_1\": \"TH-4-77-NEW\",\n \"enrolment_code_1_due_date\": \"31/12/2021\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Tribal Habits API","description":"Reference for the Tribal Habits Public API V1.","colors":{"primary":"#7C299B","light":"#FF754A","dark":"#7C299B"},"logo":{"light":"https://mintcdn.com/tribal-habits/dbtAL_otpFb7lO5f/logo/light.png?fit=max\u0026auto=format\u0026n=dbtAL_otpFb7lO5f\u0026q=85\u0026s=27cd12465618e8e083443fe905630191","dark":"https://mintcdn.com/tribal-habits/dbtAL_otpFb7lO5f/logo/dark.png?fit=max\u0026auto=format\u0026n=dbtAL_otpFb7lO5f\u0026q=85\u0026s=a9313585e676ec6e1d0350c81464edee"},"favicon":"https://mintcdn.com/tribal-habits/dbtAL_otpFb7lO5f/favicon.png?fit=max\u0026auto=format\u0026n=dbtAL_otpFb7lO5f\u0026q=85\u0026s=cf0b5e6c683ece3eff3e26eb5fe8a773","api":{"playground":{"display":"simple"},"examples":{"languages":["curl","python","javascript","php","csharp","ruby"]},"url":"full"},"fonts":{"family":"Barlow"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"tribal-habits","hasAudioNarration":false,"actualSubdomain":"tribal-habits","customDomains":["api-docs.tribalhabits.com"],"gitSource":{"type":"github","owner":"tribalhabits","repo":"api-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6ac718329937db71086c8a9e","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"Enrolments","count":7},{"language":"default","tag":"Users","count":6},{"language":"default","tag":"Getting started","count":5},{"language":"default","tag":"Webhooks","count":5},{"language":"default","tag":"External Knowledge","count":5},{"language":"default","tag":"Certificates","count":4},{"language":"default","tag":"Enrolment events","count":4},{"language":"default","tag":"Pathways","count":2},{"language":"default","tag":"Topics","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"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":true},"customCss":[],"page":{"pagePath":"api-reference/enrolments/create-or-update-topic-or-pathway-enrolments","slug":"/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments","pageMetadata":{"title":"Create or update topic or pathway enrolments","description":"This endpoint creates or updates topic or pathway enrolments for one user, using enrolment codes. It is the single endpoint for creating and updating all enrolments, including pathway enrolments. Use the `UPDATE` action code to change dates on an existing enrolment. See [How can I enrol people or import enrolments via a spreadsheet (CSV)](https://support.tribalhabits.com/en/articles/5735753-how-can-i-enrol-people-or-import-enrolments-via-a-spreadsheet-csv) for an explanation of enrolment codes.\n\nUp to 5 enrolments can be given, using the `enrolment_code_N` fields where N is from 1..5.\n\nThe response lists the user's current enrolment for each code. For pathway codes, each item has the pathway enrolment fields instead. If any code or date is invalid, `400` is returned with a list of errors, for example `{\"errors\":[\"'TH-4-999' does not correspond to a known topic or pathway\"]}`. If the user cannot be found, `404` is returned with `{\"errors\":[\"Cannot find user\"]}`.\n","deprecated":null,"version":null,"sidebarTitle":"Create or update topic or pathway enrolments","openapi":"/openapi.yaml post /topic_assignments","href":"/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"This endpoint creates or updates topic or pathway enrolments for one user, using enrolment codes. It is the single endpoint for creating and updating all enrolments, including pathway enrolments. Use the \", _jsx(_components.code, {\n children: \"UPDATE\"\n }), \" action code to change dates on an existing enrolment. See \", _jsx(_components.a, {\n href: \"https://support.tribalhabits.com/en/articles/5735753-how-can-i-enrol-people-or-import-enrolments-via-a-spreadsheet-csv\",\n children: \"How can I enrol people or import enrolments via a spreadsheet (CSV)\"\n }), \" for an explanation of enrolment codes.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Up to 5 enrolments can be given, using the \", _jsx(_components.code, {\n children: \"enrolment_code_N\"\n }), \" fields where N is from 1..5.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"The response lists the user’s current enrolment for each code. For pathway codes, each item has the pathway enrolment fields instead. If any code or date is invalid, \", _jsx(_components.code, {\n children: \"400\"\n }), \" is returned with a list of errors, for example \", _jsx(_components.code, {\n children: \"{\\\"errors\\\":[\\\"'TH-4-999' does not correspond to a known topic or pathway\\\"]}\"\n }), \". If the user cannot be found, \", _jsx(_components.code, {\n children: \"404\"\n }), \" is returned with \", _jsx(_components.code, {\n children: \"{\\\"errors\\\":[\\\"Cannot find user\\\"]}\"\n }), \".\"]\n })]\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create or update topic or pathway enrolments","description":"This endpoint creates or updates topic or pathway enrolments for one user, using enrolment codes. It is the single endpoint for creating and updating all enrolments, including pathway enrolments. Use the `UPDATE` action code to change dates on an existing enrolment. See [How can I enrol people or import enrolments via a spreadsheet (CSV)](https://support.tribalhabits.com/en/articles/5735753-how-can-i-enrol-people-or-import-enrolments-via-a-spreadsheet-csv) for an explanation of enrolment codes.\n\nUp to 5 enrolments can be given, using the `enrolment_code_N` fields where N is from 1..5.\n\nThe response lists the user's current enrolment for each code. For pathway codes, each item has the pathway enrolment fields instead. If any code or date is invalid, `400` is returned with a list of errors, for example `{\"errors\":[\"'TH-4-999' does not correspond to a known topic or pathway\"]}`. If the user cannot be found, `404` is returned with `{\"errors\":[\"Cannot find user\"]}`.\n","deprecated":null,"version":null,"sidebarTitle":"Create or update topic or pathway enrolments","openapi":"/openapi.yaml post /topic_assignments","href":"/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Enrolments"],"summary":"Create or update topic or pathway enrolments","operationId":"createOrUpdateEnrolment","x-mint":{"href":"/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments"},"description":"This endpoint creates or updates topic or pathway enrolments for one user, using enrolment codes. It is the single endpoint for creating and updating all enrolments, including pathway enrolments. Use the `UPDATE` action code to change dates on an existing enrolment. See [How can I enrol people or import enrolments via a spreadsheet (CSV)](https://support.tribalhabits.com/en/articles/5735753-how-can-i-enrol-people-or-import-enrolments-via-a-spreadsheet-csv) for an explanation of enrolment codes.\n\nUp to 5 enrolments can be given, using the `enrolment_code_N` fields where N is from 1..5.\n\nThe response lists the user's current enrolment for each code. For pathway codes, each item has the pathway enrolment fields instead. If any code or date is invalid, `400` is returned with a list of errors, for example `{\"errors\":[\"'TH-4-999' does not correspond to a known topic or pathway\"]}`. If the user cannot be found, `404` is returned with `{\"errors\":[\"Cannot find user\"]}`.\n","requestBody":"ee8e2e54-1689-4990-bdc7-6982fa16d090","responses":{"200":"849a9e2c-1f3f-415d-8fdf-526bcb65e97e","400":"07001ceb-aad5-47f0-9c35-56ba73c20147","401":"bc4bc33c-25ff-44cc-a3f7-56190f70f79d","404":"79ffdaa5-b74c-4aea-8854-a7925c058b77","406":"6b1fc201-b14b-48be-9530-54715af2ed07","429":"635c405b-ec33-4c4d-8ac0-59357e30eed7"},"method":"post","type":"path","servers":["5b181cef-4c1b-4ab4-aabd-5d711881fabe"],"security":["62386c5b-2ccf-48a5-9016-ec4034f256e6"],"path":"/topic_assignments","baseUrlOptions":["https://myorg.tribalhabits.com/papi"],"title":"Create or update topic or pathway enrolments","codeSamples":[],"requestExampleLanguages":["bash","python","javascript","php","csharp","ruby"],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated","urlDisplay":"full"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user_name":{"type":"string","description":"User name identifier (case-insensitive). Required, unless `user_id` is supplied instead","uniqueKey":"user_name","typeLabel":"string"},"user_id":{"type":"integer","description":"The internal user ID (`person.id`). Alternative to `user_name`","uniqueKey":"user_id","typeLabel":"integer"},"enrolment_code_1":{"type":"string","description":"The enrolment code, eg `TH-4-77-NEW`. If no codes are given, an empty `assignments` list is returned","uniqueKey":"enrolment_code_1","typeLabel":"string"},"enrolment_code_1_due_date":{"type":"string","description":"When the enrolment is due. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"enrolment_code_1_due_date","typeLabel":"string"},"enrolment_code_1_conquered_date":{"type":"string","description":"When the enrolment was conquered (completed), used with completion codes. Same formats","uniqueKey":"enrolment_code_1_conquered_date","typeLabel":"string"},"enrolment_code_1_certified_date":{"type":"string","description":"When the enrolment is certified up to. Same formats","uniqueKey":"enrolment_code_1_certified_date","typeLabel":"string"},"enrolment_code_1_skill_attained":{"type":"string","description":"Skill names attained, separated with a semicolon","uniqueKey":"enrolment_code_1_skill_attained","typeLabel":"string"},"enrolment_code_2":{"type":"string","description":"The enrolment code, eg `TH-4-77-NEW`","uniqueKey":"enrolment_code_2","typeLabel":"string"},"enrolment_code_2_due_date":{"type":"string","description":"When the enrolment is due. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"enrolment_code_2_due_date","typeLabel":"string"},"enrolment_code_2_conquered_date":{"type":"string","description":"When the enrolment was conquered (completed), used with completion codes. Same formats","uniqueKey":"enrolment_code_2_conquered_date","typeLabel":"string"},"enrolment_code_2_certified_date":{"type":"string","description":"When the enrolment is certified up to. Same formats","uniqueKey":"enrolment_code_2_certified_date","typeLabel":"string"},"enrolment_code_2_skill_attained":{"type":"string","description":"Skill names attained, separated with a semicolon","uniqueKey":"enrolment_code_2_skill_attained","typeLabel":"string"},"enrolment_code_3":{"type":"string","description":"The enrolment code, eg `TH-4-77-NEW`","uniqueKey":"enrolment_code_3","typeLabel":"string"},"enrolment_code_3_due_date":{"type":"string","description":"When the enrolment is due. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"enrolment_code_3_due_date","typeLabel":"string"},"enrolment_code_3_conquered_date":{"type":"string","description":"When the enrolment was conquered (completed), used with completion codes. Same formats","uniqueKey":"enrolment_code_3_conquered_date","typeLabel":"string"},"enrolment_code_3_certified_date":{"type":"string","description":"When the enrolment is certified up to. Same formats","uniqueKey":"enrolment_code_3_certified_date","typeLabel":"string"},"enrolment_code_3_skill_attained":{"type":"string","description":"Skill names attained, separated with a semicolon","uniqueKey":"enrolment_code_3_skill_attained","typeLabel":"string"},"enrolment_code_4":{"type":"string","description":"The enrolment code, eg `TH-4-77-NEW`","uniqueKey":"enrolment_code_4","typeLabel":"string"},"enrolment_code_4_due_date":{"type":"string","description":"When the enrolment is due. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"enrolment_code_4_due_date","typeLabel":"string"},"enrolment_code_4_conquered_date":{"type":"string","description":"When the enrolment was conquered (completed), used with completion codes. Same formats","uniqueKey":"enrolment_code_4_conquered_date","typeLabel":"string"},"enrolment_code_4_certified_date":{"type":"string","description":"When the enrolment is certified up to. Same formats","uniqueKey":"enrolment_code_4_certified_date","typeLabel":"string"},"enrolment_code_4_skill_attained":{"type":"string","description":"Skill names attained, separated with a semicolon","uniqueKey":"enrolment_code_4_skill_attained","typeLabel":"string"},"enrolment_code_5":{"type":"string","description":"The enrolment code, eg `TH-4-77-NEW`","uniqueKey":"enrolment_code_5","typeLabel":"string"},"enrolment_code_5_due_date":{"type":"string","description":"When the enrolment is due. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"enrolment_code_5_due_date","typeLabel":"string"},"enrolment_code_5_conquered_date":{"type":"string","description":"When the enrolment was conquered (completed), used with completion codes. Same formats","uniqueKey":"enrolment_code_5_conquered_date","typeLabel":"string"},"enrolment_code_5_certified_date":{"type":"string","description":"When the enrolment is certified up to. Same formats","uniqueKey":"enrolment_code_5_certified_date","typeLabel":"string"},"enrolment_code_5_skill_attained":{"type":"string","description":"Skill names attained, separated with a semicolon","uniqueKey":"enrolment_code_5_skill_attained","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"user_name":"user1@example.com","enrolment_code_1":"TH-4-77-NEW","enrolment_code_1_due_date":"31/12/2021"},"examples":{"Example":{"title":"Example","value":{"user_name":"user1@example.com","enrolment_code_1":"TH-4-77-NEW","enrolment_code_1_due_date":"31/12/2021"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"849a9e2c-1f3f-415d-8fdf-526bcb65e97e":{"description":"The user's current enrolment for each code","content":{"application/json":{"schema":{"type":"object","properties":{"assignments":{"type":"array","items":{"oneOf":[{"type":"object","title":"Topic enrolment","properties":{"id":{"type":"integer","uniqueKey":"assignments.items.[INDEX].oneOf.0.id","typeLabel":"integer"},"created_at":{"type":"string","format":"date-time","uniqueKey":"assignments.items.[INDEX].oneOf.0.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","uniqueKey":"assignments.items.[INDEX].oneOf.0.updated_at","typeLabel":"string\u003cdate-time>"},"completed_topic_at":{"oneOf":[{"type":"string","format":"date-time","description":"When the topic was completed, or `null`","uniqueKey":"assignments.items.[INDEX].oneOf.0.completed_topic_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"When the topic was completed, or `null`","uniqueKey":"assignments.items.[INDEX].oneOf.0.completed_topic_at.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.0.completed_topic_at","typeLabel":"string\u003cdate-time> | null"},"status":{"type":"string","enum":["Pre-enrolled","Unexplored","Exploring","Applying","Conquered"],"description":"Progress of the enrolment: `Pre-enrolled`, `Unexplored`, `Exploring`, `Applying` or `Conquered` (completed)","uniqueKey":"assignments.items.[INDEX].oneOf.0.status","typeLabel":"enum\u003cstring>"},"due_date":{"oneOf":[{"type":"string","format":"date-time","uniqueKey":"assignments.items.[INDEX].oneOf.0.due_date.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","uniqueKey":"assignments.items.[INDEX].oneOf.0.due_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.0.due_date","typeLabel":"string\u003cdate-time> | null"},"relationship":{"type":"string","enum":["reader","author","assessor"],"description":"`reader` (explorer), `author` (creator) or `assessor`","uniqueKey":"assignments.items.[INDEX].oneOf.0.relationship","typeLabel":"enum\u003cstring>"},"conquered_minutes":{"oneOf":[{"type":"number","description":"Minutes recorded on completion","uniqueKey":"assignments.items.[INDEX].oneOf.0.conquered_minutes.oneOf.0","typeLabel":"number"},{"type":"null","description":"Minutes recorded on completion","uniqueKey":"assignments.items.[INDEX].oneOf.0.conquered_minutes.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.0.conquered_minutes","typeLabel":"number | null"},"conquered_cpd_minutes":{"oneOf":[{"type":"number","description":"Minutes recorded on completion","uniqueKey":"assignments.items.[INDEX].oneOf.0.conquered_cpd_minutes.oneOf.0","typeLabel":"number"},{"type":"null","description":"Minutes recorded on completion","uniqueKey":"assignments.items.[INDEX].oneOf.0.conquered_cpd_minutes.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.0.conquered_cpd_minutes","typeLabel":"number | null"},"enrolled_by":{"oneOf":[{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.0.enrolled_by.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"assignments.items.[INDEX].oneOf.0.enrolled_by.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.0.enrolled_by","typeLabel":"string | null"},"certified_date":{"oneOf":[{"type":"string","description":"Date the certification is valid until, or `null`","uniqueKey":"assignments.items.[INDEX].oneOf.0.certified_date.oneOf.0","typeLabel":"string"},{"type":"null","description":"Date the certification is valid until, or `null`","uniqueKey":"assignments.items.[INDEX].oneOf.0.certified_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.0.certified_date","typeLabel":"string | null"},"recertification_allowed":{"type":"boolean","uniqueKey":"assignments.items.[INDEX].oneOf.0.recertification_allowed","typeLabel":"boolean"},"version":{"oneOf":[{"type":"string","description":"Version of the topic completed, or `null`","uniqueKey":"assignments.items.[INDEX].oneOf.0.version.oneOf.0","typeLabel":"string"},{"type":"null","description":"Version of the topic completed, or `null`","uniqueKey":"assignments.items.[INDEX].oneOf.0.version.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.0.version","typeLabel":"string | null"},"skills_attained":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","uniqueKey":"assignments.items.[INDEX].oneOf.0.skills_attained.items.[INDEX].id","typeLabel":"integer"},"name":{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.0.skills_attained.items.[INDEX].name","typeLabel":"string"}},"uniqueKey":"assignments.items.[INDEX].oneOf.0.skills_attained.items.[INDEX]","typeLabel":"object"},"uniqueKey":"assignments.items.[INDEX].oneOf.0.skills_attained","typeLabel":"object[]"},"categories":{"type":"array","description":"Continuing education categories recorded on completion","items":{"type":"object","properties":{"name":{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.0.categories.items.[INDEX].name","typeLabel":"string"},"minutes":{"type":"number","uniqueKey":"assignments.items.[INDEX].oneOf.0.categories.items.[INDEX].minutes","typeLabel":"number"},"points":{"type":"number","uniqueKey":"assignments.items.[INDEX].oneOf.0.categories.items.[INDEX].points","typeLabel":"number"}},"uniqueKey":"assignments.items.[INDEX].oneOf.0.categories.items.[INDEX]","typeLabel":"object"},"uniqueKey":"assignments.items.[INDEX].oneOf.0.categories","typeLabel":"object[]"},"person":{"type":"object","properties":{"id":{"type":"integer","description":"Internal user ID. This is not the `user_name`","uniqueKey":"assignments.items.[INDEX].oneOf.0.person.id","typeLabel":"integer"},"name":{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.0.person.name","typeLabel":"string"},"user_name":{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.0.person.user_name","typeLabel":"string"},"link":{"type":"string","description":"Path of the related page in Tribal Habits","uniqueKey":"assignments.items.[INDEX].oneOf.0.person.link","typeLabel":"string"}},"uniqueKey":"assignments.items.[INDEX].oneOf.0.person","typeLabel":"object"},"topic":{"type":"object","properties":{"id":{"type":"integer","uniqueKey":"assignments.items.[INDEX].oneOf.0.topic.id","typeLabel":"integer"},"title":{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.0.topic.title","typeLabel":"string"},"link":{"type":"string","description":"Path of the related page in Tribal Habits","uniqueKey":"assignments.items.[INDEX].oneOf.0.topic.link","typeLabel":"string"},"knowledge_type":{"type":"integer","enum":[0,1],"description":"`0` = standard topic, `1` = short topic","uniqueKey":"assignments.items.[INDEX].oneOf.0.topic.knowledge_type","typeLabel":"enum\u003cinteger>"},"show_certificate":{"type":"boolean","uniqueKey":"assignments.items.[INDEX].oneOf.0.topic.show_certificate","typeLabel":"boolean"},"external_id":{"oneOf":[{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.0.topic.external_id.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"assignments.items.[INDEX].oneOf.0.topic.external_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.0.topic.external_id","typeLabel":"string | null"}},"uniqueKey":"assignments.items.[INDEX].oneOf.0.topic","typeLabel":"object"}},"uniqueKey":"assignments.items.[INDEX].oneOf.0","typeLabel":"Topic enrolment · object"},{"type":"object","title":"Pathway enrolment","properties":{"id":{"type":"integer","uniqueKey":"assignments.items.[INDEX].oneOf.1.id","typeLabel":"integer"},"created_at":{"type":"string","format":"date-time","uniqueKey":"assignments.items.[INDEX].oneOf.1.created_at","typeLabel":"string\u003cdate-time>"},"updated_at":{"type":"string","format":"date-time","uniqueKey":"assignments.items.[INDEX].oneOf.1.updated_at","typeLabel":"string\u003cdate-time>"},"conquered_at":{"oneOf":[{"type":"string","format":"date-time","description":"When the pathway was completed, or `null`","uniqueKey":"assignments.items.[INDEX].oneOf.1.conquered_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"When the pathway was completed, or `null`","uniqueKey":"assignments.items.[INDEX].oneOf.1.conquered_at.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.1.conquered_at","typeLabel":"string\u003cdate-time> | null"},"status":{"type":"string","enum":["Pre-enrolled","Unexplored","Exploring","Applying","Conquered","recertify"],"description":"Progress of the enrolment: `Pre-enrolled`, `Unexplored`, `Exploring`, `Applying`, `Conquered` (completed) or `recertify`","uniqueKey":"assignments.items.[INDEX].oneOf.1.status","typeLabel":"enum\u003cstring>"},"due_date":{"oneOf":[{"type":"string","format":"date-time","uniqueKey":"assignments.items.[INDEX].oneOf.1.due_date.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","uniqueKey":"assignments.items.[INDEX].oneOf.1.due_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.1.due_date","typeLabel":"string\u003cdate-time> | null"},"enrolled_by":{"oneOf":[{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.1.enrolled_by.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"assignments.items.[INDEX].oneOf.1.enrolled_by.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.1.enrolled_by","typeLabel":"string | null"},"certified_date":{"oneOf":[{"type":"string","description":"Date the certification is valid until, or `null`","uniqueKey":"assignments.items.[INDEX].oneOf.1.certified_date.oneOf.0","typeLabel":"string"},{"type":"null","description":"Date the certification is valid until, or `null`","uniqueKey":"assignments.items.[INDEX].oneOf.1.certified_date.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.1.certified_date","typeLabel":"string | null"},"recertification_allowed":{"type":"boolean","uniqueKey":"assignments.items.[INDEX].oneOf.1.recertification_allowed","typeLabel":"boolean"},"skills_attained":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","uniqueKey":"assignments.items.[INDEX].oneOf.1.skills_attained.items.[INDEX].id","typeLabel":"integer"},"name":{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.1.skills_attained.items.[INDEX].name","typeLabel":"string"}},"uniqueKey":"assignments.items.[INDEX].oneOf.1.skills_attained.items.[INDEX]","typeLabel":"object"},"uniqueKey":"assignments.items.[INDEX].oneOf.1.skills_attained","typeLabel":"object[]"},"person":{"type":"object","properties":{"id":{"type":"integer","description":"Internal user ID. This is not the `user_name`","uniqueKey":"assignments.items.[INDEX].oneOf.1.person.id","typeLabel":"integer"},"name":{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.1.person.name","typeLabel":"string"},"user_name":{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.1.person.user_name","typeLabel":"string"},"link":{"type":"string","description":"Path of the related page in Tribal Habits","uniqueKey":"assignments.items.[INDEX].oneOf.1.person.link","typeLabel":"string"}},"uniqueKey":"assignments.items.[INDEX].oneOf.1.person","typeLabel":"object"},"pathway":{"type":"object","properties":{"id":{"type":"integer","uniqueKey":"assignments.items.[INDEX].oneOf.1.pathway.id","typeLabel":"integer"},"title":{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.1.pathway.title","typeLabel":"string"},"link":{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.1.pathway.link","typeLabel":"string"},"show_certificate":{"type":"boolean","uniqueKey":"assignments.items.[INDEX].oneOf.1.pathway.show_certificate","typeLabel":"boolean"},"external_id":{"oneOf":[{"type":"string","uniqueKey":"assignments.items.[INDEX].oneOf.1.pathway.external_id.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"assignments.items.[INDEX].oneOf.1.pathway.external_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"assignments.items.[INDEX].oneOf.1.pathway.external_id","typeLabel":"string | null"}},"uniqueKey":"assignments.items.[INDEX].oneOf.1.pathway","typeLabel":"object"}},"uniqueKey":"assignments.items.[INDEX].oneOf.1","typeLabel":"Pathway enrolment · object"}],"uniqueKey":"assignments.items.[INDEX]","typeLabel":"Topic enrolment · object | Pathway enrolment · object"},"uniqueKey":"assignments","typeLabel":"(Topic enrolment · object | Pathway enrolment · object)[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"assignments":[{"id":12345,"created_at":"2019-04-01T18:03:15.966+11:00","updated_at":"2020-01-22T14:38:39.099+11:00","completed_topic_at":"2019-10-23T15:27:09.829+11:00","status":"Conquered","due_date":null,"relationship":"reader","conquered_minutes":7,"conquered_cpd_minutes":7,"enrolled_by":"Upload people enrolment by API","certified_date":null,"recertification_allowed":true,"version":null,"skills_attained":[{"id":13,"name":"First Aid"}],"categories":[{"name":"Health","minutes":39.5,"points":500}],"person":{"id":2,"name":"User One","user_name":"user1@example.com","link":"/people/users/7"},"topic":{"id":3,"title":"Confident and effective business networking","link":"/knowledge/topics/3/overview","knowledge_type":0,"show_certificate":true,"external_id":"123"}}]},"examples":{"Example":{"title":"Example","value":{"assignments":[{"id":12345,"created_at":"2019-04-01T18:03:15.966+11:00","updated_at":"2020-01-22T14:38:39.099+11:00","completed_topic_at":"2019-10-23T15:27:09.829+11:00","status":"Conquered","due_date":null,"relationship":"reader","conquered_minutes":7,"conquered_cpd_minutes":7,"enrolled_by":"Upload people enrolment by API","certified_date":null,"recertification_allowed":true,"version":null,"skills_attained":[{"id":13,"name":"First Aid"}],"categories":[{"name":"Health","minutes":39.5,"points":500}],"person":{"id":2,"name":"User One","user_name":"user1@example.com","link":"/people/users/7"},"topic":{"id":3,"title":"Confident and effective business networking","link":"/knowledge/topics/3/overview","knowledge_type":0,"show_certificate":true,"external_id":"123"}}]}}},"exampleType":"examples"}},"exampleType":"examples"},"07001ceb-aad5-47f0-9c35-56ba73c20147":{"description":"A code or date is invalid","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX]","typeLabel":"string"},"uniqueKey":"errors","typeLabel":"string[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"errors":["'TH-4-999' does not correspond to a known topic or pathway"]},"examples":{"Example":{"title":"Example","value":{"errors":["'TH-4-999' does not correspond to a known topic or pathway"]}}},"exampleType":"examples"}},"exampleType":"examples"},"bc4bc33c-25ff-44cc-a3f7-56190f70f79d":{"description":"Unauthorized - The request does not include the API key, the API key is incorrect, or API access is not enabled on your plan.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"79ffdaa5-b74c-4aea-8854-a7925c058b77":{"description":"The user cannot be found","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string","uniqueKey":"errors.items.[INDEX]","typeLabel":"string"},"uniqueKey":"errors","typeLabel":"string[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"errors":["Cannot find user"]},"examples":{"Example":{"title":"Example","value":{"errors":["Cannot find user"]}}},"exampleType":"examples"}},"exampleType":"examples"},"6b1fc201-b14b-48be-9530-54715af2ed07":{"description":"Not Acceptable - A `POST` or `PUT` request had a `Content-Type` header other than `application/json`","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"635c405b-ec33-4c4d-8ac0-59357e30eed7":{"description":"Too Many Requests - You have exceeded the rate limit. See [Rate limits](/rate-limits)","headers":{"Retry-After":{"description":"Number of seconds until the rate limit window resets","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","uniqueKey":"error","typeLabel":"string"},"retry_after_seconds":{"type":"integer","uniqueKey":"retry_after_seconds","typeLabel":"integer"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":"Rate limit exceeded. Please slow down.","retry_after_seconds":23},"examples":{"Example":{"title":"Example","value":{"error":"Rate limit exceeded. Please slow down.","retry_after_seconds":23}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"62386c5b-2ccf-48a5-9016-ec4034f256e6":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"Authorization","description":"Your organisation's API key, sent as `Authorization: my_api_key`. The key can also be passed as an `api_key` query parameter. See [Authentication](/authentication).\n","scopes":[],"schemeName":"ApiKeyHeader"}}},"servers":{"5b181cef-4c1b-4ab4-aabd-5d711881fabe":{"url":"https://myorg.tribalhabits.com/papi"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"Authorization","description":"Your organisation's API key, sent as `Authorization: my_api_key`. The key can also be passed as an `api_key` query parameter. See [Authentication](/authentication).\n","scopes":[],"schemeName":"ApiKeyHeader"},"schema":{"title":"Authorization","type":"string","description":"Your organisation's API key, sent as `Authorization: my_api_key`. The key can also be passed as an `api_key` query parameter. See [Authentication](/authentication).\n","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKeyHeader","name":"Authorization"}],"title":"ApiKeyHeader"}]},"originalFileLocation":"openapi.yaml"},"subdomain":"tribal-habits","siteName":"Tribal Habits API","title":"Create or update topic or pathway enrolments - Tribal Habits API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-08T04:12:39.894Z","originalFileLocation":"api-reference/enrolments/create-or-update-topic-or-pathway-enrolments.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=\"This endpoint creates or updates topic or pathway enrolments for one user, using enrolment codes. It is the single endpoint for creating and updating all enrolments, including pathway enrolments. Use the UPDATE action code to change dates on an existing enrolment. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes. Up to 5 enrolments can be given, using the enrolment_code_N fields where N is from 1..5. The response lists the user\u0026#x27;s current enrolment for each code. For pathway codes, each item has the pathway enrolment fields instead. If any code or date is invalid, 400 is returned with a list of errors, for example {\u0026quot;errors\u0026quot;:[\u0026quot;\u0026#x27;TH-4-999\u0026#x27; does not correspond to a known topic or pathway\u0026quot;]}. If the user cannot be found, 404 is returned with {\u0026quot;errors\u0026quot;:[\u0026quot;Cannot find user\u0026quot;]}.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Tribal Habits 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/tribal-habits/bUA3GI8z0PbH28Cb/_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/tribal-habits/bUA3GI8z0PbH28Cb/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tribal-habits/bUA3GI8z0PbH28Cb/_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/tribal-habits/bUA3GI8z0PbH28Cb/_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/tribal-habits/bUA3GI8z0PbH28Cb/_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/tribal-habits/bUA3GI8z0PbH28Cb/_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/tribal-habits/bUA3GI8z0PbH28Cb/_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/tribal-habits/bUA3GI8z0PbH28Cb/_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/tribal-habits/bUA3GI8z0PbH28Cb/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create or update topic or pathway enrolments - Tribal Habits API\">\u003cmeta data-mint-head property=\"og:description\" content=\"This endpoint creates or updates topic or pathway enrolments for one user, using enrolment codes. It is the single endpoint for creating and updating all enrolments, including pathway enrolments. Use the UPDATE action code to change dates on an existing enrolment. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes. Up to 5 enrolments can be given, using the enrolment_code_N fields where N is from 1..5. The response lists the user\u0026#x27;s current enrolment for each code. For pathway codes, each item has the pathway enrolment fields instead. If any code or date is invalid, 400 is returned with a list of errors, for example {\u0026quot;errors\u0026quot;:[\u0026quot;\u0026#x27;TH-4-999\u0026#x27; does not correspond to a known topic or pathway\u0026quot;]}. If the user cannot be found, 404 is returned with {\u0026quot;errors\u0026quot;:[\u0026quot;Cannot find user\u0026quot;]}.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Tribal Habits API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://api-docs.tribalhabits.com/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://tribal-habits.mintlify.site/_mintlify/api/og/v2?division=Enrolments\u0026amp;title=Create+or+update+topic+or+pathway+enrolments\u0026amp;description=This+endpoint+creates+or+updates+topic+or+pathway+enrolments+for+one+user%2C+using+enrolment+codes.+It+is+the+single+endpoint+for+creating+and+updating+all+enrolm\u0026amp;theme=dae6b6579c606a6e034e45ee\u0026amp;signature=5315648216f38da49f9f32ab67535b07f460ed67049d4a75496ff51a3e73d34a\">\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=\"Create or update topic or pathway enrolments - Tribal Habits API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"This endpoint creates or updates topic or pathway enrolments for one user, using enrolment codes. It is the single endpoint for creating and updating all enrolments, including pathway enrolments. Use the UPDATE action code to change dates on an existing enrolment. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes. Up to 5 enrolments can be given, using the enrolment_code_N fields where N is from 1..5. The response lists the user\u0026#x27;s current enrolment for each code. For pathway codes, each item has the pathway enrolment fields instead. If any code or date is invalid, 400 is returned with a list of errors, for example {\u0026quot;errors\u0026quot;:[\u0026quot;\u0026#x27;TH-4-999\u0026#x27; does not correspond to a known topic or pathway\u0026quot;]}. If the user cannot be found, 404 is returned with {\u0026quot;errors\u0026quot;:[\u0026quot;Cannot find user\u0026quot;]}.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://tribal-habits.mintlify.site/_mintlify/api/og/v2?division=Enrolments\u0026amp;title=Create+or+update+topic+or+pathway+enrolments\u0026amp;description=This+endpoint+creates+or+updates+topic+or+pathway+enrolments+for+one+user%2C+using+enrolment+codes.+It+is+the+single+endpoint+for+creating+and+updating+all+enrolm\u0026amp;theme=dae6b6579c606a6e034e45ee\u0026amp;signature=5315648216f38da49f9f32ab67535b07f460ed67049d4a75496ff51a3e73d34a\">\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/tribal-habits/bUA3GI8z0PbH28Cb/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Tribal Habits API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#7C299B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://api-docs.tribalhabits.com/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://api-docs.tribalhabits.com/#organization\",\"name\":\"Tribal Habits API\",\"url\":\"https://api-docs.tribalhabits.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/tribal-habits/dbtAL_otpFb7lO5f/logo/light.png?fit=max\u0026auto=format\u0026n=dbtAL_otpFb7lO5f\u0026q=85\u0026s=27cd12465618e8e083443fe905630191\"}},{\"@type\":\"WebSite\",\"@id\":\"https://api-docs.tribalhabits.com#website\",\"name\":\"Tribal Habits API\",\"url\":\"https://api-docs.tribalhabits.com\",\"publisher\":{\"@id\":\"https://api-docs.tribalhabits.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://api-docs.tribalhabits.com/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments#webpage\",\"url\":\"https://api-docs.tribalhabits.com/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments\",\"name\":\"Create or update topic or pathway enrolments\",\"description\":\"This endpoint creates or updates topic or pathway enrolments for one user, using enrolment codes. It is the single endpoint for creating and updating all enrolments, including pathway enrolments. Use the UPDATE action code to change dates on an existing enrolment. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes. Up to 5 enrolments can be given, using the enrolment_code_N fields where N is from 1..5. The response lists the user's current enrolment for each code. For pathway codes, each item has the pathway enrolment fields instead. If any code or date is invalid, 400 is returned with a list of errors, for example {\\\"errors\\\":[\\\"'TH-4-999' does not correspond to a known topic or pathway\\\"]}. If the user cannot be found, 404 is returned with {\\\"errors\\\":[\\\"Cannot find user\\\"]}.\",\"dateModified\":\"2026-10-08T04:12:39.894Z\",\"isPartOf\":{\"@id\":\"https://api-docs.tribalhabits.com#website\"},\"breadcrumb\":{\"@id\":\"https://api-docs.tribalhabits.com/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://api-docs.tribalhabits.com/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Enrolments\",\"item\":\"https://api-docs.tribalhabits.com/api-reference/enrolments/get-all-topic-enrolments\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create or update topic or pathway enrolments\",\"item\":\"https://api-docs.tribalhabits.com/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://api-docs.tribalhabits.com/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments#apireference\",\"headline\":\"Create or update topic or pathway enrolments\",\"name\":\"Create or update topic or pathway enrolments\",\"description\":\"This endpoint creates or updates topic or pathway enrolments for one user, using enrolment codes. It is the single endpoint for creating and updating all enrolments, including pathway enrolments. Use the UPDATE action code to change dates on an existing enrolment. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes. Up to 5 enrolments can be given, using the enrolment_code_N fields where N is from 1..5. The response lists the user's current enrolment for each code. For pathway codes, each item has the pathway enrolment fields instead. If any code or date is invalid, 400 is returned with a list of errors, for example {\\\"errors\\\":[\\\"'TH-4-999' does not correspond to a known topic or pathway\\\"]}. If the user cannot be found, 404 is returned with {\\\"errors\\\":[\\\"Cannot find user\\\"]}.\",\"url\":\"https://api-docs.tribalhabits.com/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments\",\"mainEntityOfPage\":{\"@id\":\"https://api-docs.tribalhabits.com/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments#webpage\"},\"dateModified\":\"2026-10-08T04:12:39.894Z\",\"publisher\":{\"@id\":\"https://api-docs.tribalhabits.com/#organization\"},\"isPartOf\":{\"@id\":\"https://api-docs.tribalhabits.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Tribal Habits API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Tribal Habits API","nav":{"global":null,"groups":[{"group":"Getting started","pages":[{"title":"Introduction","href":"/introduction"},{"title":"Authentication","href":"/authentication"},{"title":"Vanity URL","href":"/vanity-url"},{"title":"Errors","href":"/errors"},{"title":"Rate limits","href":"/rate-limits"}]},{"group":"Users","pages":[{"title":"Custom fields","href":"/custom-fields"},{"title":"Get all users","deprecated":null,"version":null,"sidebarTitle":"Get all users","openapi":"/openapi.yaml get /users","href":"/api-reference/users/get-all-users"},{"title":"Create a new user","deprecated":null,"version":null,"sidebarTitle":"Create a new user","openapi":"/openapi.yaml post /users","href":"/api-reference/users/create-a-new-user"},{"title":"Get a specific user","deprecated":null,"version":null,"sidebarTitle":"Get a specific user","openapi":"/openapi.yaml get /users/{user_name}","href":"/api-reference/users/get-a-specific-user"},{"title":"Update a specific user","deprecated":null,"version":null,"sidebarTitle":"Update a specific user","openapi":"/openapi.yaml put /users/{user_name}","href":"/api-reference/users/update-a-specific-user"},{"title":"Batch create or update","deprecated":null,"version":null,"sidebarTitle":"Batch create or update","openapi":"/openapi.yaml post /users/batch_save","href":"/api-reference/users/batch-create-or-update"}]},{"group":"Topics","pages":[{"title":"Get all topics","deprecated":null,"version":null,"sidebarTitle":"Get all topics","openapi":"/openapi.yaml get /topics","href":"/api-reference/topics/get-all-topics"},{"title":"Get a specific topic","deprecated":null,"version":null,"sidebarTitle":"Get a specific topic","openapi":"/openapi.yaml get /topics/{id}","href":"/api-reference/topics/get-a-specific-topic"}]},{"group":"Pathways","pages":[{"title":"Get all pathways","deprecated":null,"version":null,"sidebarTitle":"Get all pathways","openapi":"/openapi.yaml get /pathways","href":"/api-reference/pathways/get-all-pathways"},{"title":"Get a specific pathway","deprecated":null,"version":null,"sidebarTitle":"Get a specific pathway","openapi":"/openapi.yaml get /pathways/{id}","href":"/api-reference/pathways/get-a-specific-pathway"}]},{"group":"Enrolments","pages":[{"title":"Get all topic enrolments","deprecated":null,"version":null,"sidebarTitle":"Get all topic enrolments","openapi":"/openapi.yaml get /topic_assignments","href":"/api-reference/enrolments/get-all-topic-enrolments"},{"title":"Get all topic enrolments by user","deprecated":null,"version":null,"sidebarTitle":"Get all topic enrolments by user","openapi":"/openapi.yaml get /topic_assignments/user/{user_name}","href":"/api-reference/enrolments/get-all-topic-enrolments-by-user"},{"title":"Get a specific topic enrolment","description":"This endpoint retrieves a specific topic enrolment.\n\nIf the enrolment does not exist, `404` is returned with the body `{\"errors\":[\"Cannot find topic assignment\"]}`.\n","deprecated":null,"version":null,"sidebarTitle":"Get a specific topic enrolment","openapi":"/openapi.yaml get /topic_assignments/{id}","href":"/api-reference/enrolments/get-a-specific-topic-enrolment"},{"title":"Create or update topic or pathway enrolments","deprecated":null,"version":null,"sidebarTitle":"Create or update topic or pathway enrolments","openapi":"/openapi.yaml post /topic_assignments","href":"/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments"},{"title":"Get all pathway enrolments","description":"This endpoint retrieves all pathway enrolments (paginated), oldest first.\n\nThe same list, filtered to one pathway or one user, is also available at `GET /papi/pathway_assignments/by_pathway/PATHWAY_ID` and `GET /papi/pathway_assignments/by_user/USER_ID`, where `USER_ID` is the internal user ID (`person.id`).\n\nIf a `pathway_id`, `user_name` or `user_id` filter does not match a pathway or user, no records are returned.\n\nResults are paginated. For example, `GET /papi/pathway_assignments?page=2` returns the second page.\n\nTo create or update pathway enrolments, use [Create or update topic or pathway enrolments](/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments).\n","deprecated":null,"version":null,"sidebarTitle":"Get all pathway enrolments","openapi":"/openapi.yaml get /pathway_assignments","href":"/api-reference/enrolments/get-all-pathway-enrolments"},{"title":"Get all pathway enrolments by user","deprecated":null,"version":null,"sidebarTitle":"Get all pathway enrolments by user","openapi":"/openapi.yaml get /pathway_assignments/user/{user_name}","href":"/api-reference/enrolments/get-all-pathway-enrolments-by-user"},{"title":"Get a specific pathway enrolment","deprecated":null,"version":null,"sidebarTitle":"Get a specific pathway enrolment","openapi":"/openapi.yaml get /pathway_assignments/{id}","href":"/api-reference/enrolments/get-a-specific-pathway-enrolment"}]},{"group":"Certificates","pages":[{"title":"Certificates","href":"/certificates"},{"title":"Request a certificate","deprecated":null,"version":null,"sidebarTitle":"Request a certificate","openapi":"/openapi.yaml get /certificates","href":"/api-reference/certificates/request-a-certificate"},{"title":"Poll certificate status","deprecated":null,"version":null,"sidebarTitle":"Poll certificate status","openapi":"/openapi.yaml get /certificates/status/{job_id}","href":"/api-reference/certificates/poll-certificate-status"},{"title":"Download certificate PDF","api":"GET {url}","href":"/download-certificate"}]},{"group":"External Knowledge","pages":[{"title":"Get all external knowledge","deprecated":null,"version":null,"sidebarTitle":"Get all external knowledge","openapi":"/openapi.yaml get /external_knowledges","href":"/api-reference/external-knowledge/get-all-external-knowledge"},{"title":"Get a specific external knowledge","deprecated":null,"version":null,"sidebarTitle":"Get a specific external knowledge","openapi":"/openapi.yaml get /external_knowledges/{id}","href":"/api-reference/external-knowledge/get-a-specific-external-knowledge"},{"title":"Create a new external knowledge","deprecated":null,"version":null,"sidebarTitle":"Create a new external knowledge","openapi":"/openapi.yaml post /external_knowledges","href":"/api-reference/external-knowledge/create-a-new-external-knowledge"},{"title":"Update an external knowledge","deprecated":null,"version":null,"sidebarTitle":"Update an external knowledge","openapi":"/openapi.yaml put /external_knowledges/{id}","href":"/api-reference/external-knowledge/update-an-external-knowledge"},{"title":"Batch create external knowledge","deprecated":null,"version":null,"sidebarTitle":"Batch create external knowledge","openapi":"/openapi.yaml post /external_knowledges/batch_save","href":"/api-reference/external-knowledge/batch-create-external-knowledge"}]},{"group":"Webhooks","pages":[{"title":"Webhooks","href":"/webhooks"},{"group":"Enrolment events","pages":[{"title":"Enrolment created","version":null,"deprecated":null,"openapi":"/openapi.yaml webhook enrolment-created","href":"/api-reference/webhooks/enrolment-created"},{"title":"Enrolment completed","version":null,"deprecated":null,"openapi":"/openapi.yaml webhook enrolment-completed","href":"/api-reference/webhooks/enrolment-completed"},{"title":"Enrolment updated","version":null,"deprecated":null,"openapi":"/openapi.yaml webhook enrolment-updated","href":"/api-reference/webhooks/enrolment-updated"},{"title":"Enrolment deleted","version":null,"deprecated":null,"openapi":"/openapi.yaml webhook enrolment-deleted","href":"/api-reference/webhooks/enrolment-deleted"}]}]}]},"basePath":"","title":"Create or update topic or pathway enrolments - Tribal Habits API","buildId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","deploymentId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CBsVopKK.js","utils-DZAk68jJ.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D32AYZrP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-D_A5_cny.js","snippetPresets-xNRfS9th.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BIB25-tq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CydJ4w4j.js","shallow-CYPBeQSG.js","getApiPlaygroundDisplay-A5xJVBOu.js","CodeSnippet-BVRTgi3m.js","CodeSnippets-DjD6BSlt.js","Page-Dr40SSJq.js","getPastedJson-D4V4JyrR.js","icon-uhcnG22T.js","MethodPill-CM-ZQdGH.js","DuplicateIcon-B_WnOiNf.js","createIcon-CJsb8utt.js","DynamicMarkdown-D-2HDKEp.js","SectionHeading-KP5xmMgQ.js","axios-vUo_bRtp.js","Markdown-D_k0dg6k.js","clsx-DK3K4Z1S.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DE3EVdvd.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-fN9H9n9g.js"]}