This endpoint allows you to create a new user or update an existing one. The operation is idempotent - if a user with the specified ID already exists, the request will update the user’s attributes. If the user doesn’t exist, a new user will be created.
A map of user attributes to update. You can include any custom attributes. Existing attributes not included in the request will remain unchanged. See Attributes for details.
An array of company objects to associate with the user. Each company object must contain an ID and can include additional attributes. This is the recommended approach when you only need to establish company associations without additional relationship attributes.
An array of membership objects that define the relationship between a user and a company. Use this when you need to specify attributes that describe the user’s relationship with each company. Each membership object must include a company object with at least its ID.
A map of attributes that describe the user’s relationship with the company. You can include any custom attributes to define the nature of this relationship.
{"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":""},"chroma":{"liveDeploymentHistoryId":"6ac75b31be572e7b73287b41","collectionId":"cc2197bc-7ebd-4230-b95d-3bdf19169dd0","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ac75b31be572e7b73287b41"},"entitlements":{},"buildId":"6ac75b31be572e7b73287b41","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"API Reference","count":92},{"language":"default","tag":"Endpoints","count":79},{"language":"default","tag":"Documentation","count":48},{"language":"default","tag":"API Reference (v1)","count":37},{"language":"default","tag":"Usertour.js Reference","count":31},{"language":"default","tag":"How-to Guides","count":30},{"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":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/users/create","slug":"/api-reference/users/create","pageMetadata":{"title":"Upsert a user","api":"Post /v1/users","description":null,"href":"/api-reference/users/create"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,p:`p`,..._provideComponents(),...props.components},{Expandable,Heading,Note,ParamField,ResponseField}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`This endpoint allows you to create a new user or update an existing one. The operation is idempotent - if a user with the specified ID already exists, the request will update the user’s attributes. If the user doesn’t exist, a new user will be created.`}),`\n`,_jsx(Heading,{level:`2`,id:`body-parameters`,children:`Body Parameters`}),`\n`,_jsx(ParamField,{body:`id`,type:`string`,required:true,id:`param-id`,children:_jsx(_components.p,{children:`Unique identifier for the user. This should match the user’s ID in your system.`})}),`\n`,_jsx(ParamField,{body:`attributes`,type:`object`,id:`param-attributes`,children:_jsxs(_components.p,{children:[`A map of user attributes to update. You can include any custom attributes. Existing attributes not included in the request will remain unchanged. See `,_jsx(_components.a,{href:`/api-reference/attributes`,children:`Attributes`}),` for details.`]})}),`\n`,_jsxs(ParamField,{body:`companies`,type:`array`,id:`param-companies`,children:[_jsx(_components.p,{children:`An array of company objects to associate with the user. Each company object must contain an ID and can include additional attributes. This is the recommended approach when you only need to establish company associations without additional relationship attributes.`}),_jsxs(Expandable,{title:`companies`,children:[_jsx(ResponseField,{name:`companies.id`,type:`string`,required:true,id:`param-companies-id`,children:_jsx(_components.p,{children:`Unique identifier for the company. Must match the company’s ID in your system.`})}),_jsx(ResponseField,{name:`companies.attributes`,type:`object`,id:`param-companies-attributes`,children:_jsx(_components.p,{children:`A map of company-specific attributes. You can include any custom attributes to describe the company.`})})]})]}),`\n`,_jsxs(ParamField,{body:`memberships`,type:`array`,id:`param-memberships`,children:[_jsx(_components.p,{children:`An array of membership objects that define the relationship between a user and a company. Use this when you need to specify attributes that describe the user’s relationship with each company. Each membership object must include a company object with at least its ID.`}),_jsxs(Expandable,{title:`memberships`,children:[_jsx(ResponseField,{name:`memberships.attributes`,type:`object`,required:true,id:`param-memberships-attributes`,children:_jsx(_components.p,{children:`A map of attributes that describe the user’s relationship with the company. You can include any custom attributes to define the nature of this relationship.`})}),_jsxs(ResponseField,{name:`memberships.company`,type:`object`,required:true,id:`param-memberships-company`,children:[_jsx(_components.p,{children:`The company object associated with this membership.`}),_jsxs(Expandable,{title:`memberships.company`,children:[_jsx(ResponseField,{name:`memberships.company.id`,type:`string`,required:true,id:`param-memberships-company-id`,children:_jsx(_components.p,{children:`Unique identifier for the company. Must match the company’s ID in your system.`})}),_jsx(ResponseField,{name:`memberships.company.attributes`,type:`object`,id:`param-memberships-company-attributes`,children:_jsx(_components.p,{children:`A map of company-specific attributes. You can include any custom attributes to describe the company.`})})]})]})]})]}),`\n`,_jsx(Note,{children:`Only one of companies and memberships can be set.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Upsert a user","api":"Post /v1/users","description":null,"href":"/api-reference/users/create"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Note,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`This endpoint allows you to create a new user or update an existing one. The operation is idempotent - if a user with the specified ID already exists, the request will update the user’s attributes. If the user doesn’t exist, a new user will be created.`}),`\n`,_jsx(Heading,{level:`2`,id:`body-parameters`,children:`Body Parameters`}),`\n`,_jsx(ParamField,{body:`id`,type:`string`,required:true,id:`param-id`,children:_jsx(_components.p,{children:`Unique identifier for the user. This should match the user’s ID in your system.`})}),`\n`,_jsx(ParamField,{body:`attributes`,type:`object`,id:`param-attributes`,children:_jsxs(_components.p,{children:[`A map of user attributes to update. You can include any custom attributes. Existing attributes not included in the request will remain unchanged. See `,_jsx(_components.a,{href:`/api-reference/attributes`,children:`Attributes`}),` for details.`]})}),`\n`,_jsxs(ParamField,{body:`companies`,type:`array`,id:`param-companies`,children:[_jsx(_components.p,{children:`An array of company objects to associate with the user. Each company object must contain an ID and can include additional attributes. This is the recommended approach when you only need to establish company associations without additional relationship attributes.`}),_jsxs(Expandable,{title:`companies`,children:[_jsx(ResponseField,{name:`companies.id`,type:`string`,required:true,id:`param-companies-id`,children:_jsx(_components.p,{children:`Unique identifier for the company. Must match the company’s ID in your system.`})}),_jsx(ResponseField,{name:`companies.attributes`,type:`object`,id:`param-companies-attributes`,children:_jsx(_components.p,{children:`A map of company-specific attributes. You can include any custom attributes to describe the company.`})})]})]}),`\n`,_jsxs(ParamField,{body:`memberships`,type:`array`,id:`param-memberships`,children:[_jsx(_components.p,{children:`An array of membership objects that define the relationship between a user and a company. Use this when you need to specify attributes that describe the user’s relationship with each company. Each membership object must include a company object with at least its ID.`}),_jsxs(Expandable,{title:`memberships`,children:[_jsx(ResponseField,{name:`memberships.attributes`,type:`object`,required:true,id:`param-memberships-attributes`,children:_jsx(_components.p,{children:`A map of attributes that describe the user’s relationship with the company. You can include any custom attributes to define the nature of this relationship.`})}),_jsxs(ResponseField,{name:`memberships.company`,type:`object`,required:true,id:`param-memberships-company`,children:[_jsx(_components.p,{children:`The company object associated with this membership.`}),_jsxs(Expandable,{title:`memberships.company`,children:[_jsx(ResponseField,{name:`memberships.company.id`,type:`string`,required:true,id:`param-memberships-company-id`,children:_jsx(_components.p,{children:`Unique identifier for the company. Must match the company’s ID in your system.`})}),_jsx(ResponseField,{name:`memberships.company.attributes`,type:`object`,id:`param-memberships-company-attributes`,children:_jsx(_components.p,{children:`A map of company-specific attributes. You can include any custom attributes to describe the company.`})})]})]})]})]}),`\n`,_jsx(Note,{children:`Only one of companies and memberships can be set.`}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`Basic Request`,numberOfLines:`12`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.usertour.io/v1/users`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-XPOST `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: Bearer ak_123456789'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-d `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"id\": \"usr_123456789\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"attributes\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"John Doe\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"email\": \"john.doe@example.com\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"signed_up_at\": \"2024-03-20T08:30:00.000Z\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`With Companies`,numberOfLines:`21`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.usertour.io/v1/users`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-XPOST `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: Bearer ak_123456789'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-d `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"id\": \"usr_123456789\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"attributes\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"John Doe\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"email\": \"john.doe@example.com\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"companies\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"id\": \"comp_987654321\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"attributes\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Acme Corporation\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"plan\": \"enterprise\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"industry\": \"technology\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`With Memberships`,numberOfLines:`28`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`28`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.usertour.io/v1/users`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-XPOST `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: Bearer ak_123456789'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-d `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"id\": \"usr_123456789\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"attributes\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"John Doe\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"email\": \"john.doe@example.com\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"memberships\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"attributes\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"admin\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"department\": \"engineering\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"join_date\": \"2024-01-01T00:00:00.000Z\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"company\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"id\": \"comp_987654321\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"attributes\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Acme Corporation\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"plan\": \"enterprise\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"industry\": \"technology\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`Response`,numberOfLines:`9`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"usr_123456789\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"attributes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"John Doe\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"email\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"john.doe@example.com\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2024-03-20T08:30:00.000Z\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Upsert a user","api":"Post /v1/users","description":null,"href":"/api-reference/users/create"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Body Parameters","slug":"body-parameters","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"Basic Request","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"12\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api.usertour.io/v1/users\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-XPOST \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-H \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Authorization: Bearer ak_123456789'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-H \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Content-Type: application/json'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-d \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"id\": \"usr_123456789\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"attributes\": {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name\": \"John Doe\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"email\": \"john.doe@example.com\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"signed_up_at\": \"2024-03-20T08:30:00.000Z\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"With Companies","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"21\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api.usertour.io/v1/users\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-XPOST \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-H \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Authorization: Bearer ak_123456789'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-H \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Content-Type: application/json'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-d \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"id\": \"usr_123456789\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"attributes\": {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name\": \"John Doe\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"email\": \"john.doe@example.com\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"companies\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"id\": \"comp_987654321\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"attributes\": {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name\": \"Acme Corporation\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"plan\": \"enterprise\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"industry\": \"technology\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"With Memberships","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"28\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api.usertour.io/v1/users\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-XPOST \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-H \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Authorization: Bearer ak_123456789'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-H \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Content-Type: application/json'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">-d \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"id\": \"usr_123456789\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"attributes\": {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name\": \"John Doe\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"email\": \"john.doe@example.com\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"memberships\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"attributes\": {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"role\": \"admin\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"department\": \"engineering\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"join_date\": \"2024-01-01T00:00:00.000Z\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"company\": {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"id\": \"comp_987654321\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"attributes\": {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"name\": \"Acme Corporation\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"plan\": \"enterprise\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"industry\": \"technology\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"9\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"usr_123456789\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"object\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"user\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"attributes\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"name\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"John Doe\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"email\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"john.doe@example.com\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"created_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2024-03-20T08:30:00.000Z\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Upsert a user","path":"/v1/users","method":"post","request":{"security":[],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"id":[{"type":"string","description":"Unique identifier for the user. This should match the user’s ID in your system.","required":true}],"attributes":[{"type":"object","properties":{},"description":"A map of user attributes to update. You can include any custom attributes. Existing attributes not included in the request will remain unchanged. See Attributes for details."}],"companies":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"An array of company objects to associate with the user. Each company object must contain an ID and can include additional attributes. This is the recommended approach when you only need to establish company associations without additional relationship attributes."}],"memberships":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"An array of membership objects that define the relationship between a user and a company. Use this when you need to specify attributes that describe the user’s relationship with each company. Each membership object must include a company object with at least its ID."}]}}],"examples":{"example":{"value":{"id":"\u003cstring>","attributes":{},"companies":[{}],"memberships":[{}]}}}}}},"response":{},"deprecated":false}},"jsLinks":[],"subdomain":"usertour","siteName":"Usertour documention","title":"Upsert a user - Usertour documention","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-08T05:02:51.661Z","originalFileLocation":"api-reference/users/create.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=\"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=\"Upsert a user - Usertour documention\">\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/users/create\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://usertour.mintlify.app/_mintlify/api/og/v2?division=Users\u0026amp;title=Upsert+a+user\u0026amp;theme=e8ff6aa64680886dad37379c\u0026amp;signature=995513ae2d26ae438a0a8e188cedf68d8af2ca4d6dc81a8952a3f2b6edb292c1\">\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=\"Upsert a user - Usertour documention\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://usertour.mintlify.app/_mintlify/api/og/v2?division=Users\u0026amp;title=Upsert+a+user\u0026amp;theme=e8ff6aa64680886dad37379c\u0026amp;signature=995513ae2d26ae438a0a8e188cedf68d8af2ca4d6dc81a8952a3f2b6edb292c1\">\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/users/create\">\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/create.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/users/create#webpage\",\"url\":\"https://docs.usertour.io/api-reference/users/create\",\"name\":\"Upsert a user\",\"dateModified\":\"2026-10-08T05:02:51.661Z\",\"isPartOf\":{\"@id\":\"https://docs.usertour.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.usertour.io/api-reference/users/create#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.usertour.io/api-reference/users/create#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Users\",\"item\":\"https://docs.usertour.io/api-reference/users/model\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Upsert a user\",\"item\":\"https://docs.usertour.io/api-reference/users/create\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.usertour.io/api-reference/users/create#apireference\",\"headline\":\"Upsert a user\",\"name\":\"Upsert a user\",\"url\":\"https://docs.usertour.io/api-reference/users/create\",\"mainEntityOfPage\":{\"@id\":\"https://docs.usertour.io/api-reference/users/create#webpage\"},\"dateModified\":\"2026-10-08T05:02:51.661Z\",\"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","pages":[{"title":"API Reference","href":"/api-reference-v2/introduction"}]},{"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","groups":[{"group":"API References","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Errors","href":"/api-reference/errors"},{"title":"Pagination","href":"/api-reference/pagination"},{"title":"Ordering","href":"/api-reference/ordering"},{"title":"Expanding objects","href":"/api-reference/expanding-objects"},{"title":"Attributes","href":"/api-reference/attributes"}]},{"group":"Users","pages":[{"title":"The user object","description":null,"href":"/api-reference/users/model"},{"title":"Upsert a user","api":"Post /v1/users","href":"/api-reference/users/create"},{"title":"Get a user","api":"Get /v1/users/:id","description":"Retrieves a specific user by their ID, including all their attributes and relationships.","href":"/api-reference/users/get"},{"title":"Delete a user","api":"Delete /v1/users/:id","href":"/api-reference/users/delete"},{"title":"List users","api":"Get /v1/users","href":"/api-reference/users/list"}]},{"group":"Companies","pages":[{"title":"The company object","href":"/api-reference/companies/model"},{"title":"Upsert a company","api":"Post /v1/companies","href":"/api-reference/companies/create"},{"title":"Get a company","api":"Get /v1/companies/:id","href":"/api-reference/companies/get"},{"title":"Delete a company","api":"Delete /v1/companies/:id","href":"/api-reference/companies/delete"},{"title":"List companies","api":"Get /v1/companies","href":"/api-reference/companies/list"}]},{"group":"Company Memberships","pages":[{"title":"The company membership object","href":"/api-reference/company-memberships/model"},{"title":"Upsert a membership","api":"Post /v1/company-memberships","href":"/api-reference/company-memberships/create"},{"title":"Remove a membership","api":"Delete /v1/company-memberships","href":"/api-reference/company-memberships/delete"},{"title":"List memberships","api":"Get /v1/company-memberships","href":"/api-reference/company-memberships/list"}]},{"group":"Content","pages":[{"title":"The content object","href":"/api-reference/content/model"},{"title":"Get a content","api":"Get /v1/content/:id","href":"/api-reference/content/get"},{"title":"List content","api":"Get /v1/content","href":"/api-reference/content/list"}]},{"group":"Content Versions","pages":[{"title":"The content version object","href":"/api-reference/content-versions/model"},{"title":"The question object","href":"/api-reference/content-versions/the-question-model"},{"title":"Get a content version","api":"Get /v1/content-versions/:id","href":"/api-reference/content-versions/get"},{"title":"List content versions","api":"Get /v1/content-versions","href":"/api-reference/content-versions/list"}]},{"group":"Content Sessions","pages":[{"title":"The content session object","href":"/api-reference/content-sessions/model"},{"title":"The answer object","href":"/api-reference/content-sessions/the-answer-model"},{"title":"Get a content session","api":"Get /v1/content-sessions/:id","href":"/api-reference/content-sessions/get"},{"title":"Delete a content session","api":"Delete /v1/content-sessions/:id","href":"/api-reference/content-sessions/delete"},{"title":"End a content session","api":"Post /v1/content-sessions/:id/end","href":"/api-reference/content-sessions/end"},{"title":"List content sessions","api":"Get /v1/content-sessions","href":"/api-reference/content-sessions/list"}]},{"group":"Event Definitions","pages":[{"title":"The event definition object","href":"/api-reference/event-definitions/model"},{"title":"List event definitions","api":"Get /v1/event-definitions","href":"/api-reference/event-definitions/list"}]},{"group":"Attribute Definitions","pages":[{"title":"The attribute definition object","href":"/api-reference/attribute-definitions/model"},{"title":"List attribute definitions","api":"Get /v1/attribute-definitions","href":"/api-reference/attribute-definitions/list"}]}]},{"anchor":"Changelog","icon":"clock-rotate-left","pages":[{"title":"Changelog","href":"/changelog/2026"}]}]},"title":"Upsert a user - Usertour documention","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-DmVyH30O.js","utils-BHQqGGOd.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CD-E4BIt.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Bp5Lq9Ds.js","snippetPresets-C4xAVCFP.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CgXVLxUC.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BF8I5oUf.js","shallow-Byd0lWnC.js","getApiPlaygroundDisplay-BGOZG1OK.js","CodeSnippet-CpvQL0CY.js","CodeSnippets-B8wkBKXa.js","Page-CBCH2P7b.js","getPastedJson-Ry3scI3Y.js","icon-D7a9HcdD.js","MethodPill-CJ8pmHhz.js","DuplicateIcon-rh1HJF0t.js","createIcon-DvGznqYs.js","DynamicMarkdown-Cc6AuSHS.js","SectionHeading-B4A0S-ep.js","axios-vUo_bRtp.js"]}