This endpoint creates or updates multiple users in one call. A user whose user_name does not match an existing user is created with all the fields given. If the user_name already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg "manager_email": "".
Each user object accepts the same fields as Create a new user, plus the enrolment fields below. user_name matching is case-insensitive. New users need user_name, first_name, last_name and email.
In the response, created, updated and unchanged count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in error_list and is not saved. enrolled counts enrolments successfully made, and invitations_sent and invitations_failed count invitation emails. errors is the number of entries in error_list, which includes enrolment errors as well as users with errors.
Errors
If there are no errors, the errors count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (user_name and email), and the error reason. Enrolment errors are also added to error_list, with only an error_reason. You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again.
A request without a people array, or with more than 100 people, returns 400 and nothing is saved.
Whether to send invitation emails. "new" sends them only to newly created people, "all" sends them to everyone in the batch, and "no" (or leaving out this field) sends none.
One entry per error. Enrolment errors have only an error_reason
Show child attributes
{"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/users/batch-create-or-update","slug":"/api-reference/users/batch-create-or-update","pageMetadata":{"title":"Batch create or update","description":"This endpoint creates or updates multiple users in one call. A user whose `user_name` does not match an existing user is created with all the fields given. If the `user_name` already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg `\"manager_email\": \"\"`.\n\nEach user object accepts the same fields as [Create a new user](/api-reference/users/create-a-new-user), plus the enrolment fields below. `user_name` matching is case-insensitive. New users need `user_name`, `first_name`, `last_name` and `email`.\n\nIn the response, `created`, `updated` and `unchanged` count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in `error_list` and is not saved. `enrolled` counts enrolments successfully made, and `invitations_sent` and `invitations_failed` count invitation emails. `errors` is the number of entries in `error_list`, which includes enrolment errors as well as users with errors.\n\n### Errors\n\nIf there are no errors, the `errors` count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (`user_name` and `email`), and the error reason. Enrolment errors are also added to `error_list`, with only an `error_reason`. You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again.\n\nA request without a `people` array, or with more than 100 people, returns `400` and nothing is saved.\n\n### Enrolment fields\n\nEach user object can also enrol that user in up to 5 topics or pathways, using the `enrolment_code_N` fields where N is from 1..5. 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\n\u003cNote>Maximum permitted batch size is 100.\u003c/Note>\n","deprecated":null,"version":null,"sidebarTitle":"Batch create or update","openapi":"/openapi.yaml post /users/batch_save","href":"/api-reference/users/batch-create-or-update","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 h3: \"h3\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n }, {Note} = _components;\n if (!Note) _missingMdxReference(\"Note\", true);\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"This endpoint creates or updates multiple users in one call. A user whose \", _jsx(_components.code, {\n children: \"user_name\"\n }), \" does not match an existing user is created with all the fields given. If the \", _jsx(_components.code, {\n children: \"user_name\"\n }), \" already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg \", _jsx(_components.code, {\n children: \"\\\"manager_email\\\": \\\"\\\"\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Each user object accepts the same fields as \", _jsx(_components.a, {\n href: \"/api-reference/users/create-a-new-user\",\n children: \"Create a new user\"\n }), \", plus the enrolment fields below. \", _jsx(_components.code, {\n children: \"user_name\"\n }), \" matching is case-insensitive. New users need \", _jsx(_components.code, {\n children: \"user_name\"\n }), \", \", _jsx(_components.code, {\n children: \"first_name\"\n }), \", \", _jsx(_components.code, {\n children: \"last_name\"\n }), \" and \", _jsx(_components.code, {\n children: \"email\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"In the response, \", _jsx(_components.code, {\n children: \"created\"\n }), \", \", _jsx(_components.code, {\n children: \"updated\"\n }), \" and \", _jsx(_components.code, {\n children: \"unchanged\"\n }), \" count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in \", _jsx(_components.code, {\n children: \"error_list\"\n }), \" and is not saved. \", _jsx(_components.code, {\n children: \"enrolled\"\n }), \" counts enrolments successfully made, and \", _jsx(_components.code, {\n children: \"invitations_sent\"\n }), \" and \", _jsx(_components.code, {\n children: \"invitations_failed\"\n }), \" count invitation emails. \", _jsx(_components.code, {\n children: \"errors\"\n }), \" is the number of entries in \", _jsx(_components.code, {\n children: \"error_list\"\n }), \", which includes enrolment errors as well as users with errors.\"]\n }), \"\\n\", _jsx(_components.h3, {\n children: \"Errors\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"If there are no errors, the \", _jsx(_components.code, {\n children: \"errors\"\n }), \" count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (\", _jsx(_components.code, {\n children: \"user_name\"\n }), \" and \", _jsx(_components.code, {\n children: \"email\"\n }), \"), and the error reason. Enrolment errors are also added to \", _jsx(_components.code, {\n children: \"error_list\"\n }), \", with only an \", _jsx(_components.code, {\n children: \"error_reason\"\n }), \". You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"A request without a \", _jsx(_components.code, {\n children: \"people\"\n }), \" array, or with more than 100 people, returns \", _jsx(_components.code, {\n children: \"400\"\n }), \" and nothing is saved.\"]\n }), \"\\n\", _jsx(_components.h3, {\n children: \"Enrolment fields\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Each user object can also enrol that user in up to 5 topics or pathways, using the \", _jsx(_components.code, {\n children: \"enrolment_code_N\"\n }), \" fields where N is from 1..5. 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\", _jsx(Note, {\n children: \"Maximum permitted batch size is 100.\"\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};\nfunction _missingMdxReference(id, component) {\n throw new Error(\"Expected \" + (component ? \"component\" : \"object\") + \" `\" + id + \"` to be defined: you likely forgot to import, pass, or provide it.\");\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":"Batch create or update","description":"This endpoint creates or updates multiple users in one call. A user whose `user_name` does not match an existing user is created with all the fields given. If the `user_name` already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg `\"manager_email\": \"\"`.\n\nEach user object accepts the same fields as [Create a new user](/api-reference/users/create-a-new-user), plus the enrolment fields below. `user_name` matching is case-insensitive. New users need `user_name`, `first_name`, `last_name` and `email`.\n\nIn the response, `created`, `updated` and `unchanged` count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in `error_list` and is not saved. `enrolled` counts enrolments successfully made, and `invitations_sent` and `invitations_failed` count invitation emails. `errors` is the number of entries in `error_list`, which includes enrolment errors as well as users with errors.\n\n### Errors\n\nIf there are no errors, the `errors` count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (`user_name` and `email`), and the error reason. Enrolment errors are also added to `error_list`, with only an `error_reason`. You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again.\n\nA request without a `people` array, or with more than 100 people, returns `400` and nothing is saved.\n\n### Enrolment fields\n\nEach user object can also enrol that user in up to 5 topics or pathways, using the `enrolment_code_N` fields where N is from 1..5. 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\n\u003cNote>Maximum permitted batch size is 100.\u003c/Note>\n","deprecated":null,"version":null,"sidebarTitle":"Batch create or update","openapi":"/openapi.yaml post /users/batch_save","href":"/api-reference/users/batch-create-or-update","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Users"],"summary":"Batch create or update","operationId":"batchSaveUsers","x-mint":{"href":"/api-reference/users/batch-create-or-update"},"description":"This endpoint creates or updates multiple users in one call. A user whose `user_name` does not match an existing user is created with all the fields given. If the `user_name` already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg `\"manager_email\": \"\"`.\n\nEach user object accepts the same fields as [Create a new user](/api-reference/users/create-a-new-user), plus the enrolment fields below. `user_name` matching is case-insensitive. New users need `user_name`, `first_name`, `last_name` and `email`.\n\nIn the response, `created`, `updated` and `unchanged` count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in `error_list` and is not saved. `enrolled` counts enrolments successfully made, and `invitations_sent` and `invitations_failed` count invitation emails. `errors` is the number of entries in `error_list`, which includes enrolment errors as well as users with errors.\n\n### Errors\n\nIf there are no errors, the `errors` count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (`user_name` and `email`), and the error reason. Enrolment errors are also added to `error_list`, with only an `error_reason`. You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again.\n\nA request without a `people` array, or with more than 100 people, returns `400` and nothing is saved.\n\n### Enrolment fields\n\nEach user object can also enrol that user in up to 5 topics or pathways, using the `enrolment_code_N` fields where N is from 1..5. 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\n\u003cNote>Maximum permitted batch size is 100.\u003c/Note>\n","requestBody":"71e3d5c7-86a9-4cd2-8099-0a28fbe1888b","responses":{"200":"4d617b92-26b8-44ca-a609-b3b73e6494c9","400":"d52b045d-746e-4f82-9a23-1413789367b3","401":"1ed3734d-9e86-4cc9-861a-2afd72f6ca47","406":"46e1deb2-fe93-4090-98c2-309a19ca2006","429":"02efc983-a631-4336-9604-05d3d10285da"},"method":"post","type":"path","servers":["5b181cef-4c1b-4ab4-aabd-5d711881fabe"],"security":["62386c5b-2ccf-48a5-9016-ec4034f256e6"],"path":"/users/batch_save","baseUrlOptions":["https://myorg.tribalhabits.com/papi"],"title":"Batch create or update","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","required":["people"],"properties":{"people":{"type":"array","maxItems":100,"description":"An array of user objects whereby each user must include a `user_name` attribute denoting the unique id of the user to be created or updated.","items":{"type":"object","description":"A user object. Accepts the same fields as [Create a new user](/api-reference/users/create-a-new-user), plus the enrolment fields. New users need `user_name`, `first_name`, `last_name` and `email`. Existing users are updated with only the fields that are given.","required":["user_name"],"properties":{"user_name":{"type":"string","description":"Unique identifier for the new user. Stored in lower case","isRequired":true,"uniqueKey":"people.items.[INDEX].user_name","typeLabel":"string"},"first_name":{"type":"string","description":"User's first name - used for display purposes","uniqueKey":"people.items.[INDEX].first_name","typeLabel":"string"},"last_name":{"type":"string","description":"User's last name - used for display purposes","uniqueKey":"people.items.[INDEX].last_name","typeLabel":"string"},"email":{"type":"string","description":"User's email address (must be unique within your organisation) - used for email notifications","uniqueKey":"people.items.[INDEX].email","typeLabel":"string"},"type":{"type":"string","description":"Type of user. One of `Client`, `Contractor`, `Customer`, `Director`, `Employee`, `Lead`, `Member`, `Parent`, `Partner`, `Practitioner`, `Prospect`, `Staff`, `Student`, `Subscriber`, `Supporter`, `Volunteer`, `Worker`. Case-insensitive. Defaults to `Staff`","uniqueKey":"people.items.[INDEX].type","typeLabel":"string"},"manager_email":{"type":"string","description":"Email address of the user's manager - used for email notifications and team reporting","uniqueKey":"people.items.[INDEX].manager_email","typeLabel":"string"},"manager_2_email":{"type":"string","description":"Email address of the user's 2nd manager - used for email notifications and team reporting","uniqueKey":"people.items.[INDEX].manager_2_email","typeLabel":"string"},"manager_3_email":{"type":"string","description":"Email address of the user's 3rd manager - used for email notifications and team reporting","uniqueKey":"people.items.[INDEX].manager_3_email","typeLabel":"string"},"manager_4_email":{"type":"string","description":"Email address of the user's 4th manager - used for email notifications and team reporting","uniqueKey":"people.items.[INDEX].manager_4_email","typeLabel":"string"},"manager_5_email":{"type":"string","description":"Email address of the user's 5th manager - used for email notifications and team reporting","uniqueKey":"people.items.[INDEX].manager_5_email","typeLabel":"string"},"mentor_email":{"type":"string","description":"Email address of the user's mentor - used for email notifications","uniqueKey":"people.items.[INDEX].mentor_email","typeLabel":"string"},"language":{"type":"string","description":"One of `en`, `fj`, `fr`, `de`, `hi-IN`, `id`, `it`, `ja`, `ko`, `mi`, `ms`, `ne`, `pa-IN`, `pt`, `sm`, `zh-Hans`, `es`, `tl`, `ta`, `te`, `th`, `to`, `zh-Hant-HK`, `vi`. Case-insensitive. Unrecognised values are ignored","uniqueKey":"people.items.[INDEX].language","typeLabel":"string"},"timezone":{"type":"string","description":"User's time zone, eg `Australia/Sydney`. Defaults to your organisation's time zone","uniqueKey":"people.items.[INDEX].timezone","typeLabel":"string"},"lms_learner_id":{"type":"string","description":"User's id in company LMS - used for matching users in Tribal Habits. The combination of `lms_reference` and `lms_learner_id` must be unique","uniqueKey":"people.items.[INDEX].lms_learner_id","typeLabel":"string"},"lms_reference":{"type":"string","description":"Company LMS name - used for matching users in Tribal Habits","uniqueKey":"people.items.[INDEX].lms_reference","typeLabel":"string"},"login":{"type":"string","enum":["internal","external"],"description":"`internal` (Tribal Habits login) or `external` (single sign-on)","uniqueKey":"people.items.[INDEX].login","typeLabel":"enum\u003cstring>"},"active":{"type":"boolean","description":"Specify `false` to create the user account but disable login","uniqueKey":"people.items.[INDEX].active","typeLabel":"boolean"},"creator":{"type":"boolean","description":"Specify `true` to allow this user to create topics","uniqueKey":"people.items.[INDEX].creator","typeLabel":"boolean"},"user_notifications_enabled":{"type":"boolean","description":"User will receive email notifications","uniqueKey":"people.items.[INDEX].user_notifications_enabled","typeLabel":"boolean"},"force_pwd_reset_next_login":{"type":"boolean","description":"User must change their password at next login","uniqueKey":"people.items.[INDEX].force_pwd_reset_next_login","typeLabel":"boolean"},"manager_email_report_1st_month":{"type":"boolean","description":"Send the manager email report on the 1st of the month","uniqueKey":"people.items.[INDEX].manager_email_report_1st_month","typeLabel":"boolean"},"manager_email_report_15th_month":{"type":"boolean","description":"Send the manager email report on the 15th of the month","uniqueKey":"people.items.[INDEX].manager_email_report_15th_month","typeLabel":"boolean"},"password":{"type":"string","description":"8 to 72 characters, with at least one number, one upper case and one lower case character","uniqueKey":"people.items.[INDEX].password","typeLabel":"string"},"deactivate_scheduled_date":{"type":"string","description":"A future date this account will be deactivated. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"people.items.[INDEX].deactivate_scheduled_date","typeLabel":"string"},"reactivate_scheduled_date":{"type":"string","description":"A future date this account will be reactivated. Same formats as `deactivate_scheduled_date`","uniqueKey":"people.items.[INDEX].reactivate_scheduled_date","typeLabel":"string"},"team_leader_report_frequency":{"type":"string","description":"Frequency of team leader report emails, if the user is a team leader. One of `every_half`, `every_quarter`, `once_a_month`, `twice_a_month`, `every_monday`, `every_tuesday`, `every_wednesday`, `every_thursday`, `every_friday`, `every_weekday`, `every_day`. `none` or an empty value clears it. Any other value returns `400`","uniqueKey":"people.items.[INDEX].team_leader_report_frequency","typeLabel":"string"},"learner_report_frequency":{"type":"string","description":"Frequency of learner report emails. Same values as `team_leader_report_frequency`","uniqueKey":"people.items.[INDEX].learner_report_frequency","typeLabel":"string"},"assessor_report_frequency":{"type":"string","description":"Frequency of assessor report emails, if the user is an assessor or creator. Same values as `team_leader_report_frequency`","uniqueKey":"people.items.[INDEX].assessor_report_frequency","typeLabel":"string"},"default_landing_page":{"type":"string","description":"One of `Assess`, `Create`, `Admin`, `Dashboard - Overview`, `Dashboard - Calendar`, `Training - Enrolments`, `Profile`. Case-insensitive. Unrecognised values are ignored","uniqueKey":"people.items.[INDEX].default_landing_page","typeLabel":"string"},"role_1":{"type":"string","description":"Name of the role assigned to the user in position 1. The role must already exist, otherwise `400` is returned. An empty value removes the role in that position","uniqueKey":"people.items.[INDEX].role_1","typeLabel":"string"},"role_2":{"type":"string","description":"Name of the role assigned to the user in position 2. The role must already exist, otherwise `400` is returned. An empty value removes the role in that position","uniqueKey":"people.items.[INDEX].role_2","typeLabel":"string"},"role_3":{"type":"string","description":"Name of the role assigned to the user in position 3. The role must already exist, otherwise `400` is returned. An empty value removes the role in that position","uniqueKey":"people.items.[INDEX].role_3","typeLabel":"string"},"role_4":{"type":"string","description":"Name of the role assigned to the user in position 4. The role must already exist, otherwise `400` is returned. An empty value removes the role in that position","uniqueKey":"people.items.[INDEX].role_4","typeLabel":"string"},"role_5":{"type":"string","description":"Name of the role assigned to the user in position 5. The role must already exist, otherwise `400` is returned. An empty value removes the role in that position","uniqueKey":"people.items.[INDEX].role_5","typeLabel":"string"},"groups":{"oneOf":[{"type":"string","title":"Semicolon-separated","description":"Group names separated with a semicolon, eg `\"groups\": \"Brisbane;Bundaberg\"`, or an array of group names, eg `\"groups\": [\"Brisbane\", \"Bundaberg\"]`. Groups must already exist, otherwise `400` is returned. Replaces all of the user's current groups; an empty value removes the user from all groups","uniqueKey":"people.items.[INDEX].groups.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"people.items.[INDEX].groups.oneOf.1.items.[INDEX]","typeLabel":"string"},"title":"Array","description":"Group names separated with a semicolon, eg `\"groups\": \"Brisbane;Bundaberg\"`, or an array of group names, eg `\"groups\": [\"Brisbane\", \"Bundaberg\"]`. Groups must already exist, otherwise `400` is returned. Replaces all of the user's current groups; an empty value removes the user from all groups","uniqueKey":"people.items.[INDEX].groups.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"people.items.[INDEX].groups","typeLabel":"string | string[]"},"goals":{"oneOf":[{"type":"string","title":"Semicolon-separated","description":"Goal names separated with a semicolon, eg `\"goals\": \"Goal1;Goal2\"`, or an array of goal names, eg `\"goals\": [\"Goal1\", \"Goal2\"]`. Replaces all of the user's current goals. Goals must already exist, otherwise `400` is returned. An empty value removes all goals","uniqueKey":"people.items.[INDEX].goals.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"people.items.[INDEX].goals.oneOf.1.items.[INDEX]","typeLabel":"string"},"title":"Array","description":"Goal names separated with a semicolon, eg `\"goals\": \"Goal1;Goal2\"`, or an array of goal names, eg `\"goals\": [\"Goal1\", \"Goal2\"]`. Replaces all of the user's current goals. Goals must already exist, otherwise `400` is returned. An empty value removes all goals","uniqueKey":"people.items.[INDEX].goals.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"people.items.[INDEX].goals","typeLabel":"string | string[]"},"X-[Custom]":{"description":"Custom field. Replace `[Custom]` with the custom field name. See [Custom fields](/custom-fields)","uniqueKey":"people.items.[INDEX].X-[Custom]","typeLabel":"any"},"send_invitation":{"type":"boolean","description":"Specify `true` to send an invitation email to the user","uniqueKey":"people.items.[INDEX].send_invitation","typeLabel":"boolean"},"enrolment_code_1":{"type":"string","description":"Enrolment code for enrolment 1, eg `TH-4-77-NEW`","uniqueKey":"people.items.[INDEX].enrolment_code_1","typeLabel":"string"},"enrolment_code_1_due_date":{"type":"string","description":"Due date for enrolment 1. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"people.items.[INDEX].enrolment_code_1_due_date","typeLabel":"string"},"enrolment_code_1_conquered_date":{"type":"string","description":"Completion date for enrolment 1, used with completion codes. Same formats as the due date","uniqueKey":"people.items.[INDEX].enrolment_code_1_conquered_date","typeLabel":"string"},"enrolment_code_1_certified_date":{"type":"string","description":"Date the certification for enrolment 1 is valid until. Same formats as the due date","uniqueKey":"people.items.[INDEX].enrolment_code_1_certified_date","typeLabel":"string"},"enrolment_code_1_skill_attained":{"type":"string","description":"Skill names attained for enrolment 1, separated with a semicolon","uniqueKey":"people.items.[INDEX].enrolment_code_1_skill_attained","typeLabel":"string"},"enrolment_code_2":{"type":"string","description":"Enrolment code for enrolment 2, eg `TH-4-77-NEW`","uniqueKey":"people.items.[INDEX].enrolment_code_2","typeLabel":"string"},"enrolment_code_2_due_date":{"type":"string","description":"Due date for enrolment 2. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"people.items.[INDEX].enrolment_code_2_due_date","typeLabel":"string"},"enrolment_code_2_conquered_date":{"type":"string","description":"Completion date for enrolment 2, used with completion codes. Same formats as the due date","uniqueKey":"people.items.[INDEX].enrolment_code_2_conquered_date","typeLabel":"string"},"enrolment_code_2_certified_date":{"type":"string","description":"Date the certification for enrolment 2 is valid until. Same formats as the due date","uniqueKey":"people.items.[INDEX].enrolment_code_2_certified_date","typeLabel":"string"},"enrolment_code_2_skill_attained":{"type":"string","description":"Skill names attained for enrolment 2, separated with a semicolon","uniqueKey":"people.items.[INDEX].enrolment_code_2_skill_attained","typeLabel":"string"},"enrolment_code_3":{"type":"string","description":"Enrolment code for enrolment 3, eg `TH-4-77-NEW`","uniqueKey":"people.items.[INDEX].enrolment_code_3","typeLabel":"string"},"enrolment_code_3_due_date":{"type":"string","description":"Due date for enrolment 3. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"people.items.[INDEX].enrolment_code_3_due_date","typeLabel":"string"},"enrolment_code_3_conquered_date":{"type":"string","description":"Completion date for enrolment 3, used with completion codes. Same formats as the due date","uniqueKey":"people.items.[INDEX].enrolment_code_3_conquered_date","typeLabel":"string"},"enrolment_code_3_certified_date":{"type":"string","description":"Date the certification for enrolment 3 is valid until. Same formats as the due date","uniqueKey":"people.items.[INDEX].enrolment_code_3_certified_date","typeLabel":"string"},"enrolment_code_3_skill_attained":{"type":"string","description":"Skill names attained for enrolment 3, separated with a semicolon","uniqueKey":"people.items.[INDEX].enrolment_code_3_skill_attained","typeLabel":"string"},"enrolment_code_4":{"type":"string","description":"Enrolment code for enrolment 4, eg `TH-4-77-NEW`","uniqueKey":"people.items.[INDEX].enrolment_code_4","typeLabel":"string"},"enrolment_code_4_due_date":{"type":"string","description":"Due date for enrolment 4. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"people.items.[INDEX].enrolment_code_4_due_date","typeLabel":"string"},"enrolment_code_4_conquered_date":{"type":"string","description":"Completion date for enrolment 4, used with completion codes. Same formats as the due date","uniqueKey":"people.items.[INDEX].enrolment_code_4_conquered_date","typeLabel":"string"},"enrolment_code_4_certified_date":{"type":"string","description":"Date the certification for enrolment 4 is valid until. Same formats as the due date","uniqueKey":"people.items.[INDEX].enrolment_code_4_certified_date","typeLabel":"string"},"enrolment_code_4_skill_attained":{"type":"string","description":"Skill names attained for enrolment 4, separated with a semicolon","uniqueKey":"people.items.[INDEX].enrolment_code_4_skill_attained","typeLabel":"string"},"enrolment_code_5":{"type":"string","description":"Enrolment code for enrolment 5, eg `TH-4-77-NEW`","uniqueKey":"people.items.[INDEX].enrolment_code_5","typeLabel":"string"},"enrolment_code_5_due_date":{"type":"string","description":"Due date for enrolment 5. Formats: 'yyyy-mm-dd', 'dd/mm/yyyy' or 'dd/mm/yy'","uniqueKey":"people.items.[INDEX].enrolment_code_5_due_date","typeLabel":"string"},"enrolment_code_5_conquered_date":{"type":"string","description":"Completion date for enrolment 5, used with completion codes. Same formats as the due date","uniqueKey":"people.items.[INDEX].enrolment_code_5_conquered_date","typeLabel":"string"},"enrolment_code_5_certified_date":{"type":"string","description":"Date the certification for enrolment 5 is valid until. Same formats as the due date","uniqueKey":"people.items.[INDEX].enrolment_code_5_certified_date","typeLabel":"string"},"enrolment_code_5_skill_attained":{"type":"string","description":"Skill names attained for enrolment 5, separated with a semicolon","uniqueKey":"people.items.[INDEX].enrolment_code_5_skill_attained","typeLabel":"string"}},"uniqueKey":"people.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"people","typeLabel":"object[]"},"send_invitations":{"type":"string","enum":["new","all","no"],"description":"Whether to send invitation emails. `\"new\"` sends them only to newly created people, `\"all\"` sends them to everyone in the batch, and `\"no\"` (or leaving out this field) sends none.","uniqueKey":"send_invitations","typeLabel":"enum\u003cstring>"}},"uniqueKey":"","typeLabel":"object"},"examples":{"create_and_enrol":{"title":"create_and_enrol","value":{"people":[{"user_name":"12345","first_name":"Bilbo","last_name":"Baggins","email":"bilbo@myorg.com","language":"fr"},{"user_name":"12346","first_name":"Frodo","last_name":"Baggins","email":"frodo@myorg.com","enrolment_code_1":"TH-4-77-NEW","enrolment_code_1_due_date":"31/12/2025"},{"user_name":"12347","first_name":"Samwise","last_name":"Gamgee","email":"not-an-email"}],"send_invitations":"new"}},"deactivate":{"title":"deactivate","value":{"people":[{"user_name":"12345","active":false},{"user_name":"12346","active":false}]}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"4d617b92-26b8-44ca-a609-b3b73e6494c9":{"description":"Batch results","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"integer","description":"Number of users created","uniqueKey":"created","typeLabel":"integer"},"updated":{"type":"integer","description":"Number of users updated","uniqueKey":"updated","typeLabel":"integer"},"unchanged":{"type":"integer","description":"Number of users unchanged","uniqueKey":"unchanged","typeLabel":"integer"},"enrolled":{"type":"integer","description":"Number of enrolments made","uniqueKey":"enrolled","typeLabel":"integer"},"invitations_sent":{"type":"integer","description":"Number of invitation emails sent","uniqueKey":"invitations_sent","typeLabel":"integer"},"invitations_failed":{"type":"integer","description":"Number of invitation emails that failed","uniqueKey":"invitations_failed","typeLabel":"integer"},"errors":{"type":"integer","description":"Number of errors. `0` if there are no errors","uniqueKey":"errors","typeLabel":"integer"},"error_list":{"type":"array","description":"One entry per error. Enrolment errors have only an `error_reason`","items":{"type":"object","properties":{"user_name":{"type":"string","uniqueKey":"error_list.items.[INDEX].user_name","typeLabel":"string"},"email":{"type":"string","uniqueKey":"error_list.items.[INDEX].email","typeLabel":"string"},"error_reason":{"type":"string","uniqueKey":"error_list.items.[INDEX].error_reason","typeLabel":"string"}},"uniqueKey":"error_list.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error_list","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"create_and_enrol":{"title":"create_and_enrol","value":{"created":3,"updated":0,"unchanged":0,"enrolled":1,"invitations_sent":2,"invitations_failed":0,"errors":1,"error_list":[{"user_name":"12347","email":"not-an-email","error_reason":"Email is invalid"}]}},"deactivate":{"title":"deactivate","value":{"created":0,"updated":2,"unchanged":0,"enrolled":0,"invitations_sent":0,"invitations_failed":0,"errors":0,"error_list":[]}}},"exampleType":"examples"}},"exampleType":"examples"},"d52b045d-746e-4f82-9a23-1413789367b3":{"description":"Bad Request - The request is missing a required parameter or has an invalid value. See the response body for more details","content":{"application/json":{"schema":{"type":"string","uniqueKey":"","typeLabel":"string"},"examples":{"Example":{"title":"Example","value":"\u003cstring>"}},"exampleType":"generated"}},"exampleType":"generated"},"1ed3734d-9e86-4cc9-861a-2afd72f6ca47":{"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":""}}}},"46e1deb2-fe93-4090-98c2-309a19ca2006":{"description":"Not Acceptable - A `POST` or `PUT` request had a `Content-Type` header other than `application/json`","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"02efc983-a631-4336-9604-05d3d10285da":{"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":"Batch create or update - Tribal Habits API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-08T04:12:39.817Z","originalFileLocation":"api-reference/users/batch-create-or-update.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 multiple users in one call. A user whose user_name does not match an existing user is created with all the fields given. If the user_name already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg \u0026quot;manager_email\u0026quot;: \u0026quot;\u0026quot;. Each user object accepts the same fields as Create a new user, plus the enrolment fields below. user_name matching is case-insensitive. New users need user_name, first_name, last_name and email. In the response, created, updated and unchanged count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in error_list and is not saved. enrolled counts enrolments successfully made, and invitations_sent and invitations_failed count invitation emails. errors is the number of entries in error_list, which includes enrolment errors as well as users with errors. ### Errors If there are no errors, the errors count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (user_name and email), and the error reason. Enrolment errors are also added to error_list, with only an error_reason. You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again. A request without a people array, or with more than 100 people, returns 400 and nothing is saved. ### Enrolment fields Each user object can also enrol that user in up to 5 topics or pathways, using the enrolment_code_N fields where N is from 1..5. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes. Maximum permitted batch size is 100.\">\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=\"Batch create or update - Tribal Habits API\">\u003cmeta data-mint-head property=\"og:description\" content=\"This endpoint creates or updates multiple users in one call. A user whose user_name does not match an existing user is created with all the fields given. If the user_name already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg \u0026quot;manager_email\u0026quot;: \u0026quot;\u0026quot;. Each user object accepts the same fields as Create a new user, plus the enrolment fields below. user_name matching is case-insensitive. New users need user_name, first_name, last_name and email. In the response, created, updated and unchanged count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in error_list and is not saved. enrolled counts enrolments successfully made, and invitations_sent and invitations_failed count invitation emails. errors is the number of entries in error_list, which includes enrolment errors as well as users with errors. ### Errors If there are no errors, the errors count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (user_name and email), and the error reason. Enrolment errors are also added to error_list, with only an error_reason. You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again. A request without a people array, or with more than 100 people, returns 400 and nothing is saved. ### Enrolment fields Each user object can also enrol that user in up to 5 topics or pathways, using the enrolment_code_N fields where N is from 1..5. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes. Maximum permitted batch size is 100.\">\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/users/batch-create-or-update\">\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=Users\u0026amp;title=Batch+create+or+update\u0026amp;description=This+endpoint+creates+or+updates+multiple+users+in+one+call.+A+user+whose+%60user_name%60+does+not+match+an+existing+user+is+created+with+all+the+fields+given.+If+t\u0026amp;theme=dae6b6579c606a6e034e45ee\u0026amp;signature=df9f6dfc7df34e33941e7680bff9da4e1d1cc231a5a7d240e2bb88cf99def204\">\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=\"Batch create or update - Tribal Habits API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"This endpoint creates or updates multiple users in one call. A user whose user_name does not match an existing user is created with all the fields given. If the user_name already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg \u0026quot;manager_email\u0026quot;: \u0026quot;\u0026quot;. Each user object accepts the same fields as Create a new user, plus the enrolment fields below. user_name matching is case-insensitive. New users need user_name, first_name, last_name and email. In the response, created, updated and unchanged count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in error_list and is not saved. enrolled counts enrolments successfully made, and invitations_sent and invitations_failed count invitation emails. errors is the number of entries in error_list, which includes enrolment errors as well as users with errors. ### Errors If there are no errors, the errors count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (user_name and email), and the error reason. Enrolment errors are also added to error_list, with only an error_reason. You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again. A request without a people array, or with more than 100 people, returns 400 and nothing is saved. ### Enrolment fields Each user object can also enrol that user in up to 5 topics or pathways, using the enrolment_code_N fields where N is from 1..5. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes. Maximum permitted batch size is 100.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://tribal-habits.mintlify.site/_mintlify/api/og/v2?division=Users\u0026amp;title=Batch+create+or+update\u0026amp;description=This+endpoint+creates+or+updates+multiple+users+in+one+call.+A+user+whose+%60user_name%60+does+not+match+an+existing+user+is+created+with+all+the+fields+given.+If+t\u0026amp;theme=dae6b6579c606a6e034e45ee\u0026amp;signature=df9f6dfc7df34e33941e7680bff9da4e1d1cc231a5a7d240e2bb88cf99def204\">\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/users/batch-create-or-update\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/users/batch-create-or-update.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/users/batch-create-or-update#webpage\",\"url\":\"https://api-docs.tribalhabits.com/api-reference/users/batch-create-or-update\",\"name\":\"Batch create or update\",\"description\":\"This endpoint creates or updates multiple users in one call. A user whose user_name does not match an existing user is created with all the fields given. If the user_name already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg \\\"manager_email\\\": \\\"\\\". Each user object accepts the same fields as Create a new user, plus the enrolment fields below. user_name matching is case-insensitive. New users need user_name, first_name, last_name and email. In the response, created, updated and unchanged count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in error_list and is not saved. enrolled counts enrolments successfully made, and invitations_sent and invitations_failed count invitation emails. errors is the number of entries in error_list, which includes enrolment errors as well as users with errors. ### Errors If there are no errors, the errors count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (user_name and email), and the error reason. Enrolment errors are also added to error_list, with only an error_reason. You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again. A request without a people array, or with more than 100 people, returns 400 and nothing is saved. ### Enrolment fields Each user object can also enrol that user in up to 5 topics or pathways, using the enrolment_code_N fields where N is from 1..5. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes. Maximum permitted batch size is 100.\",\"dateModified\":\"2026-10-08T04:12:39.817Z\",\"isPartOf\":{\"@id\":\"https://api-docs.tribalhabits.com#website\"},\"breadcrumb\":{\"@id\":\"https://api-docs.tribalhabits.com/api-reference/users/batch-create-or-update#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://api-docs.tribalhabits.com/api-reference/users/batch-create-or-update#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Users\",\"item\":\"https://api-docs.tribalhabits.com/custom-fields\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Batch create or update\",\"item\":\"https://api-docs.tribalhabits.com/api-reference/users/batch-create-or-update\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://api-docs.tribalhabits.com/api-reference/users/batch-create-or-update#apireference\",\"headline\":\"Batch create or update\",\"name\":\"Batch create or update\",\"description\":\"This endpoint creates or updates multiple users in one call. A user whose user_name does not match an existing user is created with all the fields given. If the user_name already exists in the portal, that user is updated with only the fields that are given. To clear an optional field, send an empty string, eg \\\"manager_email\\\": \\\"\\\". Each user object accepts the same fields as Create a new user, plus the enrolment fields below. user_name matching is case-insensitive. New users need user_name, first_name, last_name and email. In the response, created, updated and unchanged count users the batch attempted to create or update, including users that then failed with an error. A failed user is listed in error_list and is not saved. enrolled counts enrolments successfully made, and invitations_sent and invitations_failed count invitation emails. errors is the number of entries in error_list, which includes enrolment errors as well as users with errors. ### Errors If there are no errors, the errors count in the response will be 0. If there are errors in the batch run, there will be an error count above 0. The batch run will execute all the rows that do not have any errors, and those that do have errors it will return a list of who the user was (user_name and email), and the error reason. Enrolment errors are also added to error_list, with only an error_reason. You will only need to fix those records with errors, and run in a batch again, but you can run the whole list again. A request without a people array, or with more than 100 people, returns 400 and nothing is saved. ### Enrolment fields Each user object can also enrol that user in up to 5 topics or pathways, using the enrolment_code_N fields where N is from 1..5. See How can I enrol people or import enrolments via a spreadsheet (CSV) for an explanation of enrolment codes. Maximum permitted batch size is 100.\",\"url\":\"https://api-docs.tribalhabits.com/api-reference/users/batch-create-or-update\",\"mainEntityOfPage\":{\"@id\":\"https://api-docs.tribalhabits.com/api-reference/users/batch-create-or-update#webpage\"},\"dateModified\":\"2026-10-08T04:12:39.817Z\",\"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","description":"This endpoint updates a specific user. Only fields that are supplied will be updated. To clear an optional field, send an empty string, eg `\"manager_email\": \"\"`. Returns `404` if the user does not exist.\n\n`user_name` in the URL is the unique identifier of the person to update (case-insensitive).\n\nBoolean fields accept `true`, `1` or `\"yes\"`, and `false`, `0` or `\"no\"`. Values are case-insensitive and can also be sent as strings, eg `\"true\"`. Any other value returns `400`.\n\nThe fields `org_admin` and `admin_type` cannot be set through the API. If supplied they are ignored. Administrator access must be granted in the Tribal Habits web interface.\n\nEnrolment codes (`enrolment_code_N`) are not processed by this endpoint. To enrol users, use [Batch create or update](/api-reference/users/batch-create-or-update) or [Create or update topic or pathway enrolments](/api-reference/enrolments/create-or-update-topic-or-pathway-enrolments).\n","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","description":"This endpoint retrieves all topics (paginated), ordered by title. Draft and archived topics are included; use `visibility` to tell them apart.\n\n`knowledge_type` can be either 0 or 1. Where 0 = standard topic, 1 = short topic.\n\nResults are paginated. For example, `GET /papi/topics?page=2` returns the second page.\n","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","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","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":"Batch create or update - 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"]}