Add a user to the company, or update the membership (idempotent). Returns the membership (external ids + attributes). Membership attributes with an unknown codeName auto-create a definition (dataType inferred from the value) — a typo’d codeName therefore silently creates a new attribute while the real one is not updated.
Custom attributes to write on the membership (e.g. the user's role in the company). Each value is a literal, null (remove), or one operation object — {set}, {set_once}, {add}, {union}, {remove}. Each key must be a valid codeName: start with a letter, then letters/digits/underscores, 2–100 chars.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Usertour documention","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"logo":{"light":"https://mintcdn.com/usertour/fGy2waOqk2YYQ2QK/logo-dark.svg?fit=max\u0026auto=format\u0026n=fGy2waOqk2YYQ2QK\u0026q=85\u0026s=841070ff620cff55401ec69cfc514e27","dark":"https://mintcdn.com/usertour/fGy2waOqk2YYQ2QK/logo-light.svg?fit=max\u0026auto=format\u0026n=fGy2waOqk2YYQ2QK\u0026q=85\u0026s=28f06f1ac3d117bd77837574e801ed7b","href":"https://www.usertour.io/"},"favicon":"https://mintcdn.com/usertour/nYBy6MD0LzNhBLol/images/favicon.png?fit=max\u0026auto=format\u0026n=nYBy6MD0LzNhBLol\u0026q=85\u0026s=2d933e312d87107d569af0615a00225b","api":{"playground":{"display":"simple"}},"navbar":{"links":[{"href":"mailto:support@usertour.io","label":"Support"}]},"footer":{"socials":{"x":"https://x.com/usertourio","github":"https://github.com/usertour/usertour","discord":"https://discord.gg/WPVJPX8fJh"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"usertour","hasAudioNarration":false,"actualSubdomain":"usertour","customDomains":["docs.usertour.io"],"gitSource":{"type":"github","owner":"usertour","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6af2be424ef979744de2e2db","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"API Reference","count":92},{"language":"default","tag":"Endpoints","count":79},{"language":"default","tag":"Documentation","count":49},{"language":"default","tag":"API Reference (v1)","count":37},{"language":"default","tag":"How-to Guides","count":31},{"language":"default","tag":"Usertour.js Reference","count":31},{"language":"default","tag":"Self-Hosting","count":20},{"language":"default","tag":"Content","count":15},{"language":"default","tag":"Users","count":14},{"language":"default","tag":"Companies","count":13}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","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}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/companies/add-a-company-member","slug":"/api-reference/companies/add-a-company-member","pageMetadata":{"title":"Add a company member","description":"Add a user to the company, or update the membership (idempotent). Returns the membership (external ids + attributes). Membership attributes with an unknown codeName auto-create a definition (dataType inferred from the value) — a typo'd codeName therefore silently creates a new attribute while the real one is not updated.","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json put /v2/projects/{projectId}/environments/{environmentId}/companies/{id}/memberships/{userId}","href":"/api-reference/companies/add-a-company-member","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Add a user to the company, or update the membership (idempotent). Returns the membership (external ids + attributes). Membership attributes with an unknown codeName auto-create a definition (dataType inferred from the value) — a typo’d codeName therefore silently creates a new attribute while the real one is not updated.\"\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":"Add a company member","description":"Add a user to the company, or update the membership (idempotent). Returns the membership (external ids + attributes). Membership attributes with an unknown codeName auto-create a definition (dataType inferred from the value) — a typo'd codeName therefore silently creates a new attribute while the real one is not updated.","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json put /v2/projects/{projectId}/environments/{environmentId}/companies/{id}/memberships/{userId}","href":"/api-reference/companies/add-a-company-member","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"ApiCompaniesController_upsertMembership","summary":"Add a company member","description":"Add a user to the company, or update the membership (idempotent). Returns the membership (external ids + attributes). Membership attributes with an unknown codeName auto-create a definition (dataType inferred from the value) — a typo'd codeName therefore silently creates a new attribute while the real one is not updated.","parameters":["06925136-5464-4f08-9c74-78cf78d3d0d2","0dde2f03-346f-45e6-979e-b4fca0b099f4","ad478d1d-820b-495a-8f7b-1c12eba17a96","59fda9d9-424c-4397-81d4-11349be788d5"],"requestBody":"d22b2271-b662-4401-9ce8-1204d3604800","responses":{"200":"1bbe01b4-27ff-4a74-8f2a-063ab744208d","400":"c01c7c9c-d986-4f87-94fe-467ebf6228e0","401":"b62dbab8-b2e9-4c10-9f39-4064a250febe","403":"74ded3a6-7a11-416b-9c8f-c4efbb49139d","404":"408069ff-d082-44ef-8b75-2c07a2ac6271","429":"47872fbc-a810-44a5-abeb-4b14e8654a44"},"tags":["Companies"],"security":["e47830f6-9a7e-438f-8c2f-b6e39ffc42ce"],"method":"put","type":"path","servers":["23c31da0-5340-453a-ad80-9d71f43aa3ab"],"path":"/v2/projects/{projectId}/environments/{environmentId}/companies/{id}/memberships/{userId}","baseUrlOptions":["https://api.usertour.io"],"title":"Add a company member","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"06925136-5464-4f08-9c74-78cf78d3d0d2":{"name":"id","required":true,"in":"path","description":"Company external ID","schema":{"type":"string","isRequired":true,"description":"Company external ID","uniqueKey":"","typeLabel":"string"}},"0dde2f03-346f-45e6-979e-b4fca0b099f4":{"name":"userId","required":true,"in":"path","description":"User external ID","schema":{"type":"string","isRequired":true,"description":"User external ID","uniqueKey":"","typeLabel":"string"}},"ad478d1d-820b-495a-8f7b-1c12eba17a96":{"name":"environmentId","required":true,"in":"path","description":"Environment ID","schema":{"type":"string","isRequired":true,"description":"Environment ID","uniqueKey":"","typeLabel":"string"}},"59fda9d9-424c-4397-81d4-11349be788d5":{"name":"projectId","required":true,"in":"path","description":"Project ID","schema":{"type":"string","isRequired":true,"description":"Project ID","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"attributes":{"description":"Custom attributes to write on the membership (e.g. the user's role in the company). Each value is a literal, null (remove), or one operation object — {set}, {set_once}, {add}, {union}, {remove}. Each key must be a valid codeName: start with a letter, then letters/digits/underscores, 2–100 chars.","type":"object","additionalProperties":{"oneOf":[{"type":"string","description":"A literal (string, number, boolean, list of scalars), null to remove the attribute, or exactly one operation object: {set}, {set_once}, {add}, {union}, {remove} — `set` and `set_once` may carry `data_type`.","uniqueKey":"attributes.additionalProperties.oneOf.0","typeLabel":"string"},{"type":"number","description":"A literal (string, number, boolean, list of scalars), null to remove the attribute, or exactly one operation object: {set}, {set_once}, {add}, {union}, {remove} — `set` and `set_once` may carry `data_type`.","uniqueKey":"attributes.additionalProperties.oneOf.1","typeLabel":"number"},{"type":"boolean","description":"A literal (string, number, boolean, list of scalars), null to remove the attribute, or exactly one operation object: {set}, {set_once}, {add}, {union}, {remove} — `set` and `set_once` may carry `data_type`.","uniqueKey":"attributes.additionalProperties.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string","uniqueKey":"attributes.additionalProperties.oneOf.3.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"number","uniqueKey":"attributes.additionalProperties.oneOf.3.items.[INDEX].oneOf.1","typeLabel":"number"},{"type":"boolean","uniqueKey":"attributes.additionalProperties.oneOf.3.items.[INDEX].oneOf.2","typeLabel":"boolean"}],"uniqueKey":"attributes.additionalProperties.oneOf.3.items.[INDEX]","typeLabel":"string | number | boolean"},"description":"A literal (string, number, boolean, list of scalars), null to remove the attribute, or exactly one operation object: {set}, {set_once}, {add}, {union}, {remove} — `set` and `set_once` may carry `data_type`.","uniqueKey":"attributes.additionalProperties.oneOf.3","typeLabel":"(string | number | boolean)[]"},{"type":"object","description":"A literal (string, number, boolean, list of scalars), null to remove the attribute, or exactly one operation object: {set}, {set_once}, {add}, {union}, {remove} — `set` and `set_once` may carry `data_type`.","required":["set"],"properties":{"set":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.4.set.oneOf.0","typeLabel":"string"},{"type":"number","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.4.set.oneOf.1","typeLabel":"number"},{"type":"boolean","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.4.set.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string","uniqueKey":"attributes.additionalProperties.oneOf.4.set.oneOf.3.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"number","uniqueKey":"attributes.additionalProperties.oneOf.4.set.oneOf.3.items.[INDEX].oneOf.1","typeLabel":"number"},{"type":"boolean","uniqueKey":"attributes.additionalProperties.oneOf.4.set.oneOf.3.items.[INDEX].oneOf.2","typeLabel":"boolean"}],"uniqueKey":"attributes.additionalProperties.oneOf.4.set.oneOf.3.items.[INDEX]","typeLabel":"string | number | boolean"},"isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.4.set.oneOf.3","typeLabel":"(string | number | boolean)[]"}],"isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.4.set","typeLabel":"string | number | boolean | (string | number | boolean)[]"},"data_type":{"type":"string","enum":["string","number","boolean","datetime","list"],"description":"Pins the type of the attribute definition when this write creates it; never retypes an existing definition (a conflicting data_type is rejected).","uniqueKey":"attributes.additionalProperties.oneOf.4.data_type","typeLabel":"enum\u003cstring>"}},"additionalProperties":false,"uniqueKey":"attributes.additionalProperties.oneOf.4","typeLabel":"object"},{"type":"object","description":"A literal (string, number, boolean, list of scalars), null to remove the attribute, or exactly one operation object: {set}, {set_once}, {add}, {union}, {remove} — `set` and `set_once` may carry `data_type`.","required":["set_once"],"properties":{"set_once":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.5.set_once.oneOf.0","typeLabel":"string"},{"type":"number","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.5.set_once.oneOf.1","typeLabel":"number"},{"type":"boolean","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.5.set_once.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string","uniqueKey":"attributes.additionalProperties.oneOf.5.set_once.oneOf.3.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"number","uniqueKey":"attributes.additionalProperties.oneOf.5.set_once.oneOf.3.items.[INDEX].oneOf.1","typeLabel":"number"},{"type":"boolean","uniqueKey":"attributes.additionalProperties.oneOf.5.set_once.oneOf.3.items.[INDEX].oneOf.2","typeLabel":"boolean"}],"uniqueKey":"attributes.additionalProperties.oneOf.5.set_once.oneOf.3.items.[INDEX]","typeLabel":"string | number | boolean"},"isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.5.set_once.oneOf.3","typeLabel":"(string | number | boolean)[]"}],"isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.5.set_once","typeLabel":"string | number | boolean | (string | number | boolean)[]"},"data_type":{"type":"string","enum":["string","number","boolean","datetime","list"],"description":"Pins the type of the attribute definition when this write creates it; never retypes an existing definition (a conflicting data_type is rejected).","uniqueKey":"attributes.additionalProperties.oneOf.5.data_type","typeLabel":"enum\u003cstring>"}},"additionalProperties":false,"uniqueKey":"attributes.additionalProperties.oneOf.5","typeLabel":"object"},{"type":"object","description":"A literal (string, number, boolean, list of scalars), null to remove the attribute, or exactly one operation object: {set}, {set_once}, {add}, {union}, {remove} — `set` and `set_once` may carry `data_type`.","required":["add"],"properties":{"add":{"type":"number","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.6.add","typeLabel":"number"}},"additionalProperties":false,"uniqueKey":"attributes.additionalProperties.oneOf.6","typeLabel":"object"},{"type":"object","description":"A literal (string, number, boolean, list of scalars), null to remove the attribute, or exactly one operation object: {set}, {set_once}, {add}, {union}, {remove} — `set` and `set_once` may carry `data_type`.","required":["union"],"properties":{"union":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.7.union.oneOf.0","typeLabel":"string"},{"type":"number","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.7.union.oneOf.1","typeLabel":"number"},{"type":"boolean","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.7.union.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string","uniqueKey":"attributes.additionalProperties.oneOf.7.union.oneOf.3.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"number","uniqueKey":"attributes.additionalProperties.oneOf.7.union.oneOf.3.items.[INDEX].oneOf.1","typeLabel":"number"},{"type":"boolean","uniqueKey":"attributes.additionalProperties.oneOf.7.union.oneOf.3.items.[INDEX].oneOf.2","typeLabel":"boolean"}],"uniqueKey":"attributes.additionalProperties.oneOf.7.union.oneOf.3.items.[INDEX]","typeLabel":"string | number | boolean"},"isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.7.union.oneOf.3","typeLabel":"(string | number | boolean)[]"}],"isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.7.union","typeLabel":"string | number | boolean | (string | number | boolean)[]"}},"additionalProperties":false,"uniqueKey":"attributes.additionalProperties.oneOf.7","typeLabel":"object"},{"type":"object","description":"A literal (string, number, boolean, list of scalars), null to remove the attribute, or exactly one operation object: {set}, {set_once}, {add}, {union}, {remove} — `set` and `set_once` may carry `data_type`.","required":["remove"],"properties":{"remove":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.8.remove.oneOf.0","typeLabel":"string"},{"type":"number","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.8.remove.oneOf.1","typeLabel":"number"},{"type":"boolean","isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.8.remove.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string","uniqueKey":"attributes.additionalProperties.oneOf.8.remove.oneOf.3.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"number","uniqueKey":"attributes.additionalProperties.oneOf.8.remove.oneOf.3.items.[INDEX].oneOf.1","typeLabel":"number"},{"type":"boolean","uniqueKey":"attributes.additionalProperties.oneOf.8.remove.oneOf.3.items.[INDEX].oneOf.2","typeLabel":"boolean"}],"uniqueKey":"attributes.additionalProperties.oneOf.8.remove.oneOf.3.items.[INDEX]","typeLabel":"string | number | boolean"},"isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.8.remove.oneOf.3","typeLabel":"(string | number | boolean)[]"}],"isRequired":true,"uniqueKey":"attributes.additionalProperties.oneOf.8.remove","typeLabel":"string | number | boolean | (string | number | boolean)[]"}},"additionalProperties":false,"uniqueKey":"attributes.additionalProperties.oneOf.8","typeLabel":"object"},{"type":"null","uniqueKey":"attributes.additionalProperties.oneOf.9","typeLabel":"null"}],"uniqueKey":"attributes.additionalProperties","typeLabel":"string · number · boolean · (string | number | boolean)[] · object · object · object · object · object · null"},"uniqueKey":"attributes","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"attributes":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"1bbe01b4-27ff-4a74-8f2a-063ab744208d":{"description":"Membership created or updated (echoed)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Internal membership record id (not addressable anywhere) — join on userId/companyId instead.","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","enum":["companyMembership"],"isRequired":true,"uniqueKey":"object","typeLabel":"enum\u003cstring>"},"attributes":{"type":"object","additionalProperties":{"oneOf":[{}],"uniqueKey":"attributes.additionalProperties","typeLabel":"any"},"isRequired":true,"uniqueKey":"attributes","typeLabel":"object"},"createdAt":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"createdAt","typeLabel":"string\u003cdate-time>"},"companyId":{"type":"string","description":"External company id — the id companies are addressed by.","isRequired":true,"uniqueKey":"companyId","typeLabel":"string"},"userId":{"type":"string","description":"External user id — the id users are addressed by.","isRequired":true,"uniqueKey":"userId","typeLabel":"string"},"user":{"type":"object","properties":{"id":{"type":"string","uniqueKey":"user.id","typeLabel":"string"},"object":{"type":"string","enum":["user"],"uniqueKey":"user.object","typeLabel":"enum\u003cstring>"},"attributes":{"type":"object","additionalProperties":{"oneOf":[{}],"uniqueKey":"user.attributes.additionalProperties","typeLabel":"any"},"uniqueKey":"user.attributes","typeLabel":"object"},"createdAt":{"type":"string","format":"date-time","uniqueKey":"user.createdAt","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"user","typeLabel":"object"}},"required":["id","object","attributes","createdAt","companyId","userId"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","object":"companyMembership","attributes":{},"createdAt":"2023-11-07T05:31:56Z","companyId":"\u003cstring>","userId":"\u003cstring>","user":{"id":"\u003cstring>","object":"user","attributes":{},"createdAt":"2023-11-07T05:31:56Z"}}}},"exampleType":"generated"}},"exampleType":"generated"},"c01c7c9c-d986-4f87-94fe-467ebf6228e0":{"description":"Invalid request — E1017 validation (may carry `issues`; an invalid orderBy/limit is also E1017), E1015 invalid scope, E0003 invalid against current domain state.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine-readable code (e.g. E1017). Match on this, never on `message`.","uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable summary. Wording may change between releases.","uniqueKey":"error.message","typeLabel":"string"},"issues":{"description":"Validation errors (E1017) may carry one entry per problem so every field can be fixed in a single round-trip. Absent on other errors.","type":"array","items":{"type":"object","properties":{"rule":{"type":"string","description":"Which validation layer rejected it: schema | reactive_condition | action_not_allowed | step_shape | reference_target | auto_start | media_url | destination_url. New values may be added; treat an unknown value as a generic validation failure.","isRequired":true,"uniqueKey":"error.issues.items.[INDEX].rule","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.issues.items.[INDEX].message","typeLabel":"string"},"path":{"description":"Path into the request body (e.g. `steps[0].triggers[0].when[1]`).","type":"string","uniqueKey":"error.issues.items.[INDEX].path","typeLabel":"string"}},"required":["rule","message"],"uniqueKey":"error.issues.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.issues","typeLabel":"object[]"},"doc_url":{"type":"string","description":"Base URL of the API documentation.","uniqueKey":"error.doc_url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","issues":[{"rule":"\u003cstring>","message":"\u003cstring>","path":"\u003cstring>"}],"doc_url":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"b62dbab8-b2e9-4c10-9f39-4064a250febe":{"description":"Missing or expired API key — E1010, E1020.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine-readable code (e.g. E1017). Match on this, never on `message`.","uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable summary. Wording may change between releases.","uniqueKey":"error.message","typeLabel":"string"},"issues":{"description":"Validation errors (E1017) may carry one entry per problem so every field can be fixed in a single round-trip. Absent on other errors.","type":"array","items":{"type":"object","properties":{"rule":{"type":"string","description":"Which validation layer rejected it: schema | reactive_condition | action_not_allowed | step_shape | reference_target | auto_start | media_url | destination_url. New values may be added; treat an unknown value as a generic validation failure.","isRequired":true,"uniqueKey":"error.issues.items.[INDEX].rule","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.issues.items.[INDEX].message","typeLabel":"string"},"path":{"description":"Path into the request body (e.g. `steps[0].triggers[0].when[1]`).","type":"string","uniqueKey":"error.issues.items.[INDEX].path","typeLabel":"string"}},"required":["rule","message"],"uniqueKey":"error.issues.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.issues","typeLabel":"object[]"},"doc_url":{"type":"string","description":"Base URL of the API documentation.","uniqueKey":"error.doc_url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","issues":[{"rule":"\u003cstring>","message":"\u003cstring>","path":"\u003cstring>"}],"doc_url":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"74ded3a6-7a11-416b-9c8f-c4efbb49139d":{"description":"Refused — E1000 invalid key, E1011 project not in token scope, E1012 insufficient scope, E1029 environment not in token scope, E1032 environment creation needs a token without env-targeted capabilities (its allowlist cannot cover a not-yet-existing environment), E0043 the project's plan does not include the feature (e.g. webhooks require a paid plan on cloud).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine-readable code (e.g. E1017). Match on this, never on `message`.","uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable summary. Wording may change between releases.","uniqueKey":"error.message","typeLabel":"string"},"issues":{"description":"Validation errors (E1017) may carry one entry per problem so every field can be fixed in a single round-trip. Absent on other errors.","type":"array","items":{"type":"object","properties":{"rule":{"type":"string","description":"Which validation layer rejected it: schema | reactive_condition | action_not_allowed | step_shape | reference_target | auto_start | media_url | destination_url. New values may be added; treat an unknown value as a generic validation failure.","isRequired":true,"uniqueKey":"error.issues.items.[INDEX].rule","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.issues.items.[INDEX].message","typeLabel":"string"},"path":{"description":"Path into the request body (e.g. `steps[0].triggers[0].when[1]`).","type":"string","uniqueKey":"error.issues.items.[INDEX].path","typeLabel":"string"}},"required":["rule","message"],"uniqueKey":"error.issues.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.issues","typeLabel":"object[]"},"doc_url":{"type":"string","description":"Base URL of the API documentation.","uniqueKey":"error.doc_url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","issues":[{"rule":"\u003cstring>","message":"\u003cstring>","path":"\u003cstring>"}],"doc_url":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"408069ff-d082-44ef-8b75-2c07a2ac6271":{"description":"Company or user not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine-readable code (e.g. E1017). Match on this, never on `message`.","uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable summary. Wording may change between releases.","uniqueKey":"error.message","typeLabel":"string"},"issues":{"description":"Validation errors (E1017) may carry one entry per problem so every field can be fixed in a single round-trip. Absent on other errors.","type":"array","items":{"type":"object","properties":{"rule":{"type":"string","description":"Which validation layer rejected it: schema | reactive_condition | action_not_allowed | step_shape | reference_target | auto_start | media_url | destination_url. New values may be added; treat an unknown value as a generic validation failure.","isRequired":true,"uniqueKey":"error.issues.items.[INDEX].rule","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.issues.items.[INDEX].message","typeLabel":"string"},"path":{"description":"Path into the request body (e.g. `steps[0].triggers[0].when[1]`).","type":"string","uniqueKey":"error.issues.items.[INDEX].path","typeLabel":"string"}},"required":["rule","message"],"uniqueKey":"error.issues.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.issues","typeLabel":"object[]"},"doc_url":{"type":"string","description":"Base URL of the API documentation.","uniqueKey":"error.doc_url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","issues":[{"rule":"\u003cstring>","message":"\u003cstring>","path":"\u003cstring>"}],"doc_url":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"47872fbc-a810-44a5-abeb-4b14e8654a44":{"description":"Rate limit exceeded — E1013. The limit follows the project's plan (100/500/1000/3000 requests per minute); unknown credentials share a per-IP bucket. Every response also carries X-RateLimit-Limit / -Remaining / -Reset for pacing; a 429 adds the standard Retry-After header (seconds to back off).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable machine-readable code (e.g. E1017). Match on this, never on `message`.","uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable summary. Wording may change between releases.","uniqueKey":"error.message","typeLabel":"string"},"issues":{"description":"Validation errors (E1017) may carry one entry per problem so every field can be fixed in a single round-trip. Absent on other errors.","type":"array","items":{"type":"object","properties":{"rule":{"type":"string","description":"Which validation layer rejected it: schema | reactive_condition | action_not_allowed | step_shape | reference_target | auto_start | media_url | destination_url. New values may be added; treat an unknown value as a generic validation failure.","isRequired":true,"uniqueKey":"error.issues.items.[INDEX].rule","typeLabel":"string"},"message":{"type":"string","isRequired":true,"uniqueKey":"error.issues.items.[INDEX].message","typeLabel":"string"},"path":{"description":"Path into the request body (e.g. `steps[0].triggers[0].when[1]`).","type":"string","uniqueKey":"error.issues.items.[INDEX].path","typeLabel":"string"}},"required":["rule","message"],"uniqueKey":"error.issues.items.[INDEX]","typeLabel":"object"},"uniqueKey":"error.issues","typeLabel":"object[]"},"doc_url":{"type":"string","description":"Base URL of the API documentation.","uniqueKey":"error.doc_url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","issues":[{"rule":"\u003cstring>","message":"\u003cstring>","path":"\u003cstring>"}],"doc_url":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"e47830f6-9a7e-438f-8c2f-b6e39ffc42ce":{"bearer":{"scheme":"bearer","bearerFormat":"utp_... personal API token (opaque)","type":"http","scopes":[],"schemeName":"bearer"}}},"servers":{"23c31da0-5340-453a-ad80-9d71f43aa3ab":{"url":"https://api.usertour.io"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"scheme":"bearer","bearerFormat":"utp_... personal API token (opaque)","type":"http","scopes":[],"schemeName":"bearer"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearer","name":"Authorization"}],"title":"bearer"}]},"originalFileLocation":"api-reference-v2/openapi.json"},"subdomain":"usertour","siteName":"Usertour documention","title":"Add a company member - Usertour documention","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-10T06:48:43.968Z","originalFileLocation":"api-reference/companies/add-a-company-member.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=\"Add a user to the company, or update the membership (idempotent). Returns the membership (external ids + attributes). Membership attributes with an unknown codeName auto-create a definition (dataType inferred from the value) — a typo\u0026#x27;d codeName therefore silently creates a new attribute while the real one is not updated.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Usertour documention\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/usertour/vM2wRfIVfuMnzscJ/_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/usertour/vM2wRfIVfuMnzscJ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/usertour/vM2wRfIVfuMnzscJ/_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/usertour/vM2wRfIVfuMnzscJ/_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/usertour/vM2wRfIVfuMnzscJ/_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/usertour/vM2wRfIVfuMnzscJ/_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/usertour/vM2wRfIVfuMnzscJ/_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/usertour/vM2wRfIVfuMnzscJ/_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/usertour/vM2wRfIVfuMnzscJ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Add a company member - Usertour documention\">\u003cmeta data-mint-head property=\"og:description\" content=\"Add a user to the company, or update the membership (idempotent). Returns the membership (external ids + attributes). Membership attributes with an unknown codeName auto-create a definition (dataType inferred from the value) — a typo\u0026#x27;d codeName therefore silently creates a new attribute while the real one is not updated.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Usertour documention\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.usertour.io/api-reference/companies/add-a-company-member\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://usertour.mintlify.site/_mintlify/api/og/v2?division=Companies\u0026amp;title=Add+a+company+member\u0026amp;description=Add+a+user+to+the+company%2C+or+update+the+membership+%28idempotent%29.+Returns+the+membership+%28external+ids+%2B+attributes%29.+Membership+attributes+with+an+unknown+code\u0026amp;theme=51092ed6781dc62f07a52a12\u0026amp;signature=0121216a99a17acc25f1f1d452a51c37acf4716ffd2e8c0e6de38e33cb14546d\">\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=\"Add a company member - Usertour documention\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Add a user to the company, or update the membership (idempotent). Returns the membership (external ids + attributes). Membership attributes with an unknown codeName auto-create a definition (dataType inferred from the value) — a typo\u0026#x27;d codeName therefore silently creates a new attribute while the real one is not updated.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://usertour.mintlify.site/_mintlify/api/og/v2?division=Companies\u0026amp;title=Add+a+company+member\u0026amp;description=Add+a+user+to+the+company%2C+or+update+the+membership+%28idempotent%29.+Returns+the+membership+%28external+ids+%2B+attributes%29.+Membership+attributes+with+an+unknown+code\u0026amp;theme=51092ed6781dc62f07a52a12\u0026amp;signature=0121216a99a17acc25f1f1d452a51c37acf4716ffd2e8c0e6de38e33cb14546d\">\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/usertour/vM2wRfIVfuMnzscJ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Usertour documention\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.usertour.io/api-reference/companies/add-a-company-member\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/companies/add-a-company-member.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.usertour.io/#organization\",\"name\":\"Usertour documention\",\"url\":\"https://docs.usertour.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/usertour/fGy2waOqk2YYQ2QK/logo-dark.svg?fit=max\u0026auto=format\u0026n=fGy2waOqk2YYQ2QK\u0026q=85\u0026s=841070ff620cff55401ec69cfc514e27\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.usertour.io#website\",\"name\":\"Usertour documention\",\"url\":\"https://docs.usertour.io\",\"publisher\":{\"@id\":\"https://docs.usertour.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.usertour.io/api-reference/companies/add-a-company-member#webpage\",\"url\":\"https://docs.usertour.io/api-reference/companies/add-a-company-member\",\"name\":\"Add a company member\",\"description\":\"Add a user to the company, or update the membership (idempotent). Returns the membership (external ids + attributes). Membership attributes with an unknown codeName auto-create a definition (dataType inferred from the value) — a typo'd codeName therefore silently creates a new attribute while the real one is not updated.\",\"dateModified\":\"2026-11-10T06:48:43.968Z\",\"isPartOf\":{\"@id\":\"https://docs.usertour.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.usertour.io/api-reference/companies/add-a-company-member#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.usertour.io/api-reference/companies/add-a-company-member#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.usertour.io/api-reference/analytics/get-content-analytics\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Companies\",\"item\":\"https://docs.usertour.io/api-reference/companies/list-companies\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Add a company member\",\"item\":\"https://docs.usertour.io/api-reference/companies/add-a-company-member\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.usertour.io/api-reference/companies/add-a-company-member#apireference\",\"headline\":\"Add a company member\",\"name\":\"Add a company member\",\"description\":\"Add a user to the company, or update the membership (idempotent). Returns the membership (external ids + attributes). Membership attributes with an unknown codeName auto-create a definition (dataType inferred from the value) — a typo'd codeName therefore silently creates a new attribute while the real one is not updated.\",\"url\":\"https://docs.usertour.io/api-reference/companies/add-a-company-member\",\"mainEntityOfPage\":{\"@id\":\"https://docs.usertour.io/api-reference/companies/add-a-company-member#webpage\"},\"dateModified\":\"2026-11-10T06:48:43.968Z\",\"publisher\":{\"@id\":\"https://docs.usertour.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.usertour.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Usertour documention\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Usertour documention","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/build-onboarding-with-ai"}]},{"anchor":"Usertour.js Reference","icon":"connectdevelop","pages":[{"title":"Usertour.js Reference","href":"/developers/usertourjs-reference/overview"}]},{"anchor":"API Reference","icon":"terminal","groups":[{"group":"Getting started","pages":[{"title":"Introduction","href":"/api-reference-v2/introduction"},{"title":"Authentication","href":"/api-reference-v2/authentication"},{"title":"Errors","href":"/api-reference-v2/errors"},{"title":"MCP server","href":"/api-reference-v2/mcp"}]},{"group":"Conventions","pages":[{"title":"Pagination","href":"/api-reference-v2/pagination"},{"title":"Ordering","href":"/api-reference-v2/ordering"},{"title":"Expanding objects","href":"/api-reference-v2/expanding-objects"},{"title":"Attributes","href":"/api-reference-v2/attributes"}]},{"group":"Concepts","pages":[{"title":"Content representation","href":"/api-reference-v2/content-representation"},{"title":"Blocks","href":"/api-reference-v2/blocks"},{"title":"Conditions \u0026 actions","href":"/api-reference-v2/conditions-and-actions"},{"title":"Start, hide \u0026 trigger rules","href":"/api-reference-v2/rules"},{"title":"Type-specific data","href":"/api-reference-v2/type-data"}]},{"group":"Endpoints","pages":[{"group":"Analytics","pages":[{"title":"Get content analytics","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/content/{id}/analytics","href":"/api-reference/analytics/get-content-analytics"},{"title":"Get question analytics","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/content/{id}/analytics/questions","href":"/api-reference/analytics/get-question-analytics"}]},{"group":"Content","pages":[{"title":"List content","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/content","href":"/api-reference/content/list-content"},{"title":"Create content","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/content","href":"/api-reference/content/create-content"},{"title":"Get content","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/content/{id}","href":"/api-reference/content/get-content"},{"title":"Delete content","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/content/{id}","href":"/api-reference/content/delete-content"},{"title":"Update content","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json patch /v2/projects/{projectId}/content/{id}","href":"/api-reference/content/update-content"},{"title":"Restore deleted content","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/content/{id}/restore","href":"/api-reference/content/restore-deleted-content"},{"title":"Duplicate content","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/content/{id}/duplicate","href":"/api-reference/content/duplicate-content"},{"title":"Publish a version","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/content/{id}/publish","href":"/api-reference/content/publish-a-version"},{"title":"Unpublish a version","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/content/{id}/unpublish","href":"/api-reference/content/unpublish-a-version"}]},{"group":"Content versions","pages":[{"title":"List content versions","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/content/{contentId}/versions","href":"/api-reference/content-versions/list-content-versions"},{"title":"Create a content version","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/content/{contentId}/versions","href":"/api-reference/content-versions/create-a-content-version"},{"title":"Get a content version","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/content/{contentId}/versions/{id}","href":"/api-reference/content-versions/get-a-content-version"},{"title":"Update a content version","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json patch /v2/projects/{projectId}/content/{contentId}/versions/{id}","href":"/api-reference/content-versions/update-a-content-version"},{"title":"Validate a content version","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/content/{contentId}/versions/{id}/validate","href":"/api-reference/content-versions/validate-a-content-version"},{"title":"Restore a content version","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/content/{contentId}/versions/{id}/restore","href":"/api-reference/content-versions/restore-a-content-version"},{"title":"Get a translation","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}","href":"/api-reference/content-versions/get-a-translation"},{"title":"Update a translation","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json put /v2/projects/{projectId}/content/{contentId}/versions/{versionId}/localizations/{code}","href":"/api-reference/content-versions/update-a-translation"}]},{"group":"Themes","pages":[{"title":"List themes","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/themes","href":"/api-reference/themes/list-themes"},{"title":"Create a theme","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/themes","href":"/api-reference/themes/create-a-theme"},{"title":"Get a theme","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/themes/{id}","href":"/api-reference/themes/get-a-theme"},{"title":"Delete a theme","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/themes/{id}","href":"/api-reference/themes/delete-a-theme"},{"title":"Update a theme","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json patch /v2/projects/{projectId}/themes/{id}","href":"/api-reference/themes/update-a-theme"},{"title":"Duplicate a theme","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/themes/{id}/duplicate","href":"/api-reference/themes/duplicate-a-theme"},{"title":"Restore a deleted theme","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/themes/{id}/restore","href":"/api-reference/themes/restore-a-deleted-theme"}]},{"group":"Users","pages":[{"title":"List users","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/environments/{environmentId}/users","href":"/api-reference/users/list-users"},{"title":"Get a user","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/environments/{environmentId}/users/{id}","href":"/api-reference/users/get-a-user"},{"title":"Create or update a user","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json put /v2/projects/{projectId}/environments/{environmentId}/users/{id}","href":"/api-reference/users/create-or-update-a-user"},{"title":"Delete a user","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/environments/{environmentId}/users/{id}","href":"/api-reference/users/delete-a-user"}]},{"group":"Companies","pages":[{"title":"List companies","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/environments/{environmentId}/companies","href":"/api-reference/companies/list-companies"},{"title":"Get a company","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/environments/{environmentId}/companies/{id}","href":"/api-reference/companies/get-a-company"},{"title":"Create or update a company","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json put /v2/projects/{projectId}/environments/{environmentId}/companies/{id}","href":"/api-reference/companies/create-or-update-a-company"},{"title":"Delete a company","description":"DESTRUCTIVE and permanent — removes the company, every membership in it (with their membership attributes) and its segment rows. Users themselves survive. There is no restore; re-grouping the same external id later starts a brand-new company.","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/environments/{environmentId}/companies/{id}","href":"/api-reference/companies/delete-a-company"},{"title":"Add a company member","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json put /v2/projects/{projectId}/environments/{environmentId}/companies/{id}/memberships/{userId}","href":"/api-reference/companies/add-a-company-member"},{"title":"Remove a company member","description":"Remove a user from the company. DESTRUCTIVE, not a hide: the membership record and its membership-scoped attributes (e.g. a role) are deleted for good — re-adding creates a brand-new membership with empty attributes and a new join date, so remove-then-re-add is NOT an undo.","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/environments/{environmentId}/companies/{id}/memberships/{userId}","href":"/api-reference/companies/remove-a-company-member"}]},{"group":"Segments","pages":[{"title":"List segments","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/segments","href":"/api-reference/segments/list-segments"},{"title":"Create a segment","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/segments","href":"/api-reference/segments/create-a-segment"},{"title":"Get a segment","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/segments/{id}","href":"/api-reference/segments/get-a-segment"},{"title":"Delete a segment","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/segments/{id}","href":"/api-reference/segments/delete-a-segment"},{"title":"Update a segment","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json patch /v2/projects/{projectId}/segments/{id}","href":"/api-reference/segments/update-a-segment"},{"title":"Restore a deleted segment","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/segments/{id}/restore","href":"/api-reference/segments/restore-a-deleted-segment"},{"title":"Add a segment member","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json put /v2/projects/{projectId}/environments/{environmentId}/segments/{id}/members/{externalId}","href":"/api-reference/segments/add-a-segment-member"},{"title":"Remove a segment member","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/environments/{environmentId}/segments/{id}/members/{externalId}","href":"/api-reference/segments/remove-a-segment-member"}]},{"group":"Sessions","pages":[{"title":"List sessions","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/environments/{environmentId}/sessions","href":"/api-reference/sessions/list-sessions"},{"title":"Get a session","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/environments/{environmentId}/sessions/{id}","href":"/api-reference/sessions/get-a-session"},{"title":"Delete a session","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/environments/{environmentId}/sessions/{id}","href":"/api-reference/sessions/delete-a-session"},{"title":"End a session","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/environments/{environmentId}/sessions/{id}/end","href":"/api-reference/sessions/end-a-session"}]},{"group":"Attribute definitions","pages":[{"title":"List attribute definitions","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/attribute-definitions","href":"/api-reference/attribute-definitions/list-attribute-definitions"},{"title":"Create an attribute definition","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/attribute-definitions","href":"/api-reference/attribute-definitions/create-an-attribute-definition"},{"title":"Get an attribute definition","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/attribute-definitions/{id}","href":"/api-reference/attribute-definitions/get-an-attribute-definition"},{"title":"Delete an attribute definition","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/attribute-definitions/{id}","href":"/api-reference/attribute-definitions/delete-an-attribute-definition"},{"title":"Update an attribute definition","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json patch /v2/projects/{projectId}/attribute-definitions/{id}","href":"/api-reference/attribute-definitions/update-an-attribute-definition"},{"title":"Restore a deleted attribute definition","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/attribute-definitions/{id}/restore","href":"/api-reference/attribute-definitions/restore-a-deleted-attribute-definition"}]},{"group":"Event definitions","pages":[{"title":"List event definitions","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/event-definitions","href":"/api-reference/event-definitions/list-event-definitions"},{"title":"Create an event definition","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/event-definitions","href":"/api-reference/event-definitions/create-an-event-definition"},{"title":"Get an event definition","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/event-definitions/{id}","href":"/api-reference/event-definitions/get-an-event-definition"},{"title":"Delete an event definition","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/event-definitions/{id}","href":"/api-reference/event-definitions/delete-an-event-definition"},{"title":"Update an event definition","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json patch /v2/projects/{projectId}/event-definitions/{id}","href":"/api-reference/event-definitions/update-an-event-definition"},{"title":"Restore a deleted event definition","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/event-definitions/{id}/restore","href":"/api-reference/event-definitions/restore-a-deleted-event-definition"}]},{"group":"Webhooks","pages":[{"title":"List webhooks","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/environments/{environmentId}/webhooks","href":"/api-reference/webhooks/list-webhooks"},{"title":"Create a webhook","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/environments/{environmentId}/webhooks","href":"/api-reference/webhooks/create-a-webhook"},{"title":"Get a webhook (includes the signing secret for webhook:manage tokens)","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}","href":"/api-reference/webhooks/get-a-webhook-includes-the-signing-secret-for-webhook:manage-tokens"},{"title":"Delete a webhook","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}","href":"/api-reference/webhooks/delete-a-webhook"},{"title":"Update a webhook","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json patch /v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}","href":"/api-reference/webhooks/update-a-webhook"},{"title":"Rotate the signing secret","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/environments/{environmentId}/webhooks/{id}/rotate-secret","href":"/api-reference/webhooks/rotate-the-signing-secret"}]},{"group":"Me","pages":[{"title":"Introspect the token","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/me","href":"/api-reference/me/introspect-the-token"}]},{"group":"Localizations","pages":[{"title":"List locales","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/locales","href":"/api-reference/localizations/list-locales"},{"title":"List localizations","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/localizations","href":"/api-reference/localizations/list-localizations"},{"title":"Create a localization","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/localizations","href":"/api-reference/localizations/create-a-localization"},{"title":"Delete a localization","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/localizations/{id}","href":"/api-reference/localizations/delete-a-localization"},{"title":"Update a localization","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json patch /v2/projects/{projectId}/localizations/{id}","href":"/api-reference/localizations/update-a-localization"},{"title":"Restore a deleted localization","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/localizations/{id}/restore","href":"/api-reference/localizations/restore-a-deleted-localization"}]},{"group":"Events","pages":[{"title":"Track an event","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/environments/{environmentId}/events","href":"/api-reference/events/track-an-event"}]},{"group":"Environments","pages":[{"title":"List environments","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/environments","href":"/api-reference/environments/list-environments"},{"title":"Create an environment","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json post /v2/projects/{projectId}/environments","href":"/api-reference/environments/create-an-environment"},{"title":"Get an environment","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json get /v2/projects/{projectId}/environments/{id}","href":"/api-reference/environments/get-an-environment"},{"title":"Delete an environment","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json delete /v2/projects/{projectId}/environments/{id}","href":"/api-reference/environments/delete-an-environment"},{"title":"Update an environment","deprecated":null,"version":null,"openapi":"/api-reference-v2/openapi.json patch /v2/projects/{projectId}/environments/{id}","href":"/api-reference/environments/update-an-environment"}]}]}]},{"anchor":"Self-Hosting","icon":"github","pages":[{"title":"Self-Hosting","href":"/open-source/self-hosting"}]},{"anchor":"Use Cases","icon":"route","pages":[{"title":"Use Cases","href":"/use-cases/analyze-onboarding-with-ai"}]},{"anchor":"API Reference (v1)","icon":"terminal","pages":[{"title":"API Reference (v1)","href":"/api-reference/introduction"}]},{"anchor":"Changelog","icon":"clock-rotate-left","pages":[{"title":"Changelog","href":"/changelog/2026"}]}]},"basePath":"","title":"Add a company member - Usertour documention","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C-hEh3I2.js","utils-CnF4QiUD.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C7PVNbel.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-8ytevL2A.js","snippetPresets-BT1alx3v.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BLXC0i_W.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CyLIGI9_.js","shallow-DC0lGVIW.js","getApiPlaygroundDisplay-CgDQ85tN.js","CodeSnippet-6-I-Gpv9.js","CodeSnippets-BAk1kDdu.js","Page-C945cI-W.js","getPastedJson-B276RuWN.js","icon-BqP8etTm.js","MethodPill-DM6sbxG1.js","DuplicateIcon-PyJglOaE.js","createIcon-CMeOMAc_.js","DynamicMarkdown-BoyYAA8K.js","SectionHeading-DAYv3gvZ.js","axios-vUo_bRtp.js","Markdown-BhTTmazV.js","clsx-CR-RHrVC.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CBUH0-zX.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BmARFYNC.js"]}