# Users

#### Create and manage users.

A **User** represents an end-customer whose body scans, 3D assets, and body composition metrics you manage through the Prism Hosted API. Each user can have multiple scans over time, which are linked to this user record.

All Users endpoints require the following headers:

```http
accept: application/json;v=1
authorization: Bearer {{API_KEY}}
content-type: application/json
```

Replace `{{API_KEY}}` with your Prism API key for the selected environment.

## Register a new user.

> \
> This operation creates a new \*\*user\*\* in the Hosted API. If a \*\*user\*\* with the same \*\*token\*\* already exists,\
> their meta data is updated instead of creating a duplicate.\
> \
> After a user is registered, you can create scans for this user with the \`/scans\` endpoint by providing the \
> same \*\*token\*\*.\
> \
> The \*\*token\*\* is the unique identifier of the user in your system.  \
> It must not contain an email address or any other personally identifiable information (PII).<br>

````json
{"openapi":"3.0.3","info":{"title":"Prism Hosted API","version":"1"},"tags":[{"name":"Users","description":"### Create and manage users.\n\nA **User** represents an end-customer whose body scans, 3D assets, and body composition metrics you manage through the Prism Hosted API.\nEach user can have multiple scans over time, which are linked to this user record.\n\nAll Users endpoints require the following headers:\n```http\naccept: application/json;v=1\nauthorization: Bearer {{API_KEY}}\ncontent-type: application/json\n```\nReplace `{{API_KEY}}` with your Prism API key for the selected environment.","parent":"Prism Hosted API"}],"servers":[{"url":"https://api.hosted.prismlabs.tech","description":"Production environment for Prism Hosted API"},{"url":"https://sandbox-api.hosted.prismlabs.tech","description":"Sandbox environment for Prism Hosted API"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","name":"Authorization","in":"header"}},"schemas":{"UpsertUserDto":{"type":"object","properties":{"email":{"type":"string","nullable":true,"format":"email","description":"Deprecated. The email address of the user. Do not set this field in new integrations."},"token":{"type":"string","description":"A unique token for the user provided by the partner. Must not contain email addresses or other PII."},"weight":{"description":"The user's current body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"targetWeight":{"nullable":true,"description":"The user's target body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"height":{"description":"The user's body height.","allOf":[{"$ref":"#/components/schemas/Height"}]},"sex":{"type":"string","enum":["male","female","neutral","undefined"],"description":"The user's sex."},"region":{"type":"string","enum":["africa","asia","caribbean","central_america","europe","north_america","oceania","south_america"],"description":"The user's geographical region."},"usaResidence":{"type":"string","description":"The user's U.S. state of residence, if applicable."},"birthDate":{"type":"string","description":"The user's birth date (ISO date, format YYYY-MM-DD)."},"researchConsent":{"type":"boolean","description":"Indicates whether the user has consented to their data being used for research."},"termsOfService":{"description":"Indicates which version of the terms of service has been accepted.","allOf":[{"$ref":"#/components/schemas/UserTerms"}]}},"required":["token","weight","height","sex","region","birthDate","researchConsent","termsOfService"]},"Weight":{"type":"object","properties":{"value":{"type":"number","minimum":1,"description":"The numeric weight"},"unit":{"enum":["kg","lb"],"type":"string","description":"The unit of the weight value"}},"required":["value","unit"]},"Height":{"type":"object","properties":{"value":{"type":"number","minimum":1,"description":"The numeric height"},"unit":{"enum":["m","in"],"type":"string","description":"The unit of the height value"}},"required":["value","unit"]},"UserTerms":{"type":"object","properties":{"accepted":{"type":"boolean"},"version":{"type":"string"}},"required":["accepted"]},"UserDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the user in the Prism Hosted API."},"sex":{"type":"string","enum":["male","female","neutral","undefined"],"description":"The user's sex.."},"region":{"type":"string","enum":["africa","asia","caribbean","central_america","europe","north_america","oceania","south_america"],"description":"The user's geographical region."},"usaResidence":{"type":"string","nullable":true,"description":"The user's U.S. state of residence, if applicable."},"birthDate":{"type":"string","description":"The user's birth date (ISO date, format YYYY-MM-DD)."},"weight":{"description":"The user's current body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"targetWeight":{"nullable":true,"description":"The user's target body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"height":{"description":"The user's body height.","allOf":[{"$ref":"#/components/schemas/Height"}]},"token":{"type":"string","description":"A unique token for the user provided by the partner. Must not contain email addresses or other PII."},"email":{"type":"string","nullable":true,"description":"Deprecated. The email address of the user. Do not set this field in new integrations."},"researchConsent":{"type":"boolean","description":"Indicates whether the user has consented to their data being used for research."}},"required":["id","sex","region","birthDate","weight","height","token","researchConsent"]}}},"paths":{"/users":{"post":{"description":"\nThis operation creates a new **user** in the Hosted API. If a **user** with the same **token** already exists,\ntheir meta data is updated instead of creating a duplicate.\n\nAfter a user is registered, you can create scans for this user with the `/scans` endpoint by providing the \nsame **token**.\n\nThe **token** is the unique identifier of the user in your system.  \nIt must not contain an email address or any other personally identifiable information (PII).\n","operationId":"UsersController_upsert_1","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertUserDto"}}}},"responses":{"201":{"description":"","content":{"application/json;v=1":{"schema":{"$ref":"#/components/schemas/UserDto"}}}}},"summary":"Register a new user.","tags":["Users"]}}}}
````

## Get meta data of a user.

> \
> This operation returns the meta data of a specific \*\*user\*\* identified by the partner-provided \*\*token\*\*.\
> \
> Optionally, you can use the \`unit-system\` query parameter to receive values in \*\*metric\*\* or \*\*imperial\*\* units.<br>

````json
{"openapi":"3.0.3","info":{"title":"Prism Hosted API","version":"1"},"tags":[{"name":"Users","description":"### Create and manage users.\n\nA **User** represents an end-customer whose body scans, 3D assets, and body composition metrics you manage through the Prism Hosted API.\nEach user can have multiple scans over time, which are linked to this user record.\n\nAll Users endpoints require the following headers:\n```http\naccept: application/json;v=1\nauthorization: Bearer {{API_KEY}}\ncontent-type: application/json\n```\nReplace `{{API_KEY}}` with your Prism API key for the selected environment.","parent":"Prism Hosted API"}],"servers":[{"url":"https://api.hosted.prismlabs.tech","description":"Production environment for Prism Hosted API"},{"url":"https://sandbox-api.hosted.prismlabs.tech","description":"Sandbox environment for Prism Hosted API"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","name":"Authorization","in":"header"}},"schemas":{"UserDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the user in the Prism Hosted API."},"sex":{"type":"string","enum":["male","female","neutral","undefined"],"description":"The user's sex.."},"region":{"type":"string","enum":["africa","asia","caribbean","central_america","europe","north_america","oceania","south_america"],"description":"The user's geographical region."},"usaResidence":{"type":"string","nullable":true,"description":"The user's U.S. state of residence, if applicable."},"birthDate":{"type":"string","description":"The user's birth date (ISO date, format YYYY-MM-DD)."},"weight":{"description":"The user's current body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"targetWeight":{"nullable":true,"description":"The user's target body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"height":{"description":"The user's body height.","allOf":[{"$ref":"#/components/schemas/Height"}]},"token":{"type":"string","description":"A unique token for the user provided by the partner. Must not contain email addresses or other PII."},"email":{"type":"string","nullable":true,"description":"Deprecated. The email address of the user. Do not set this field in new integrations."},"researchConsent":{"type":"boolean","description":"Indicates whether the user has consented to their data being used for research."}},"required":["id","sex","region","birthDate","weight","height","token","researchConsent"]},"Weight":{"type":"object","properties":{"value":{"type":"number","minimum":1,"description":"The numeric weight"},"unit":{"enum":["kg","lb"],"type":"string","description":"The unit of the weight value"}},"required":["value","unit"]},"Height":{"type":"object","properties":{"value":{"type":"number","minimum":1,"description":"The numeric height"},"unit":{"enum":["m","in"],"type":"string","description":"The unit of the height value"}},"required":["value","unit"]}}},"paths":{"/users/{token}":{"get":{"description":"\nThis operation returns the meta data of a specific **user** identified by the partner-provided **token**.\n\nOptionally, you can use the `unit-system` query parameter to receive values in **metric** or **imperial** units.\n","operationId":"UsersController_findOne_1","parameters":[{"name":"token","required":true,"in":"path","description":"A unique token for the user provided by the partner. It must not contain an email address or any other PII.","schema":{"type":"string"}},{"name":"unit-system","required":false,"in":"query","description":"The unit system in which values will be returned.","schema":{"enum":["metric","imperial"],"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json;v=1":{"schema":{"$ref":"#/components/schemas/UserDto"}}}}},"summary":"Get meta data of a user.","tags":["Users"]}}}}
````

## Delete a user.

> \
> This operation deletes a specific \*\*user\*\* identified by the partner-provided \*\*token\*\*.\
> \
> After deletion, the user can no longer be used for new scans or future me predictions.<br>

````json
{"openapi":"3.0.3","info":{"title":"Prism Hosted API","version":"1"},"tags":[{"name":"Users","description":"### Create and manage users.\n\nA **User** represents an end-customer whose body scans, 3D assets, and body composition metrics you manage through the Prism Hosted API.\nEach user can have multiple scans over time, which are linked to this user record.\n\nAll Users endpoints require the following headers:\n```http\naccept: application/json;v=1\nauthorization: Bearer {{API_KEY}}\ncontent-type: application/json\n```\nReplace `{{API_KEY}}` with your Prism API key for the selected environment.","parent":"Prism Hosted API"}],"servers":[{"url":"https://api.hosted.prismlabs.tech","description":"Production environment for Prism Hosted API"},{"url":"https://sandbox-api.hosted.prismlabs.tech","description":"Sandbox environment for Prism Hosted API"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","name":"Authorization","in":"header"}},"schemas":{"UserDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the user in the Prism Hosted API."},"sex":{"type":"string","enum":["male","female","neutral","undefined"],"description":"The user's sex.."},"region":{"type":"string","enum":["africa","asia","caribbean","central_america","europe","north_america","oceania","south_america"],"description":"The user's geographical region."},"usaResidence":{"type":"string","nullable":true,"description":"The user's U.S. state of residence, if applicable."},"birthDate":{"type":"string","description":"The user's birth date (ISO date, format YYYY-MM-DD)."},"weight":{"description":"The user's current body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"targetWeight":{"nullable":true,"description":"The user's target body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"height":{"description":"The user's body height.","allOf":[{"$ref":"#/components/schemas/Height"}]},"token":{"type":"string","description":"A unique token for the user provided by the partner. Must not contain email addresses or other PII."},"email":{"type":"string","nullable":true,"description":"Deprecated. The email address of the user. Do not set this field in new integrations."},"researchConsent":{"type":"boolean","description":"Indicates whether the user has consented to their data being used for research."}},"required":["id","sex","region","birthDate","weight","height","token","researchConsent"]},"Weight":{"type":"object","properties":{"value":{"type":"number","minimum":1,"description":"The numeric weight"},"unit":{"enum":["kg","lb"],"type":"string","description":"The unit of the weight value"}},"required":["value","unit"]},"Height":{"type":"object","properties":{"value":{"type":"number","minimum":1,"description":"The numeric height"},"unit":{"enum":["m","in"],"type":"string","description":"The unit of the height value"}},"required":["value","unit"]}}},"paths":{"/users/{token}":{"delete":{"description":"\nThis operation deletes a specific **user** identified by the partner-provided **token**.\n\nAfter deletion, the user can no longer be used for new scans or future me predictions.\n","operationId":"UsersController_delete_1","parameters":[{"name":"token","required":true,"in":"path","description":"A unique token for the user provided by the partner. It must not contain an email address or any other PII.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json;v=1":{"schema":{"$ref":"#/components/schemas/UserDto"}}}}},"summary":"Delete a user.","tags":["Users"]}}}}
````

## Update meta data of a user.

> \
> This operation updates the meta data of a specific \*\*user\*\* identified by the partner-provided \*\*token\*\*.\
> \
> Send only the fields you want to change in the request body; all other fields remain unchanged.\
> The \*\*token\*\* itself cannot be changed by this operation.<br>

````json
{"openapi":"3.0.3","info":{"title":"Prism Hosted API","version":"1"},"tags":[{"name":"Users","description":"### Create and manage users.\n\nA **User** represents an end-customer whose body scans, 3D assets, and body composition metrics you manage through the Prism Hosted API.\nEach user can have multiple scans over time, which are linked to this user record.\n\nAll Users endpoints require the following headers:\n```http\naccept: application/json;v=1\nauthorization: Bearer {{API_KEY}}\ncontent-type: application/json\n```\nReplace `{{API_KEY}}` with your Prism API key for the selected environment.","parent":"Prism Hosted API"}],"servers":[{"url":"https://api.hosted.prismlabs.tech","description":"Production environment for Prism Hosted API"},{"url":"https://sandbox-api.hosted.prismlabs.tech","description":"Sandbox environment for Prism Hosted API"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","name":"Authorization","in":"header"}},"schemas":{"UpdateUserDto":{"type":"object","properties":{"email":{"type":"string","nullable":true,"format":"email","description":"Deprecated. The email address of the user. Do not set this field in new integrations."},"token":{"type":"string","description":"A unique token for the user provided by the partner. Must not contain email addresses or other PII."},"weight":{"description":"The user's current body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"targetWeight":{"nullable":true,"description":"The user's target body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"height":{"description":"The user's body height.","allOf":[{"$ref":"#/components/schemas/Height"}]},"sex":{"type":"string","enum":["male","female","neutral","undefined"],"description":"The user's sex."},"region":{"type":"string","enum":["africa","asia","caribbean","central_america","europe","north_america","oceania","south_america"],"description":"The user's geographical region."},"usaResidence":{"type":"string","description":"The user's U.S. state of residence, if applicable."},"birthDate":{"type":"string","description":"The user's birth date (ISO date, format YYYY-MM-DD)."},"researchConsent":{"type":"boolean","description":"Indicates whether the user has consented to their data being used for research."}}},"Weight":{"type":"object","properties":{"value":{"type":"number","minimum":1,"description":"The numeric weight"},"unit":{"enum":["kg","lb"],"type":"string","description":"The unit of the weight value"}},"required":["value","unit"]},"Height":{"type":"object","properties":{"value":{"type":"number","minimum":1,"description":"The numeric height"},"unit":{"enum":["m","in"],"type":"string","description":"The unit of the height value"}},"required":["value","unit"]},"UserDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique ID of the user in the Prism Hosted API."},"sex":{"type":"string","enum":["male","female","neutral","undefined"],"description":"The user's sex.."},"region":{"type":"string","enum":["africa","asia","caribbean","central_america","europe","north_america","oceania","south_america"],"description":"The user's geographical region."},"usaResidence":{"type":"string","nullable":true,"description":"The user's U.S. state of residence, if applicable."},"birthDate":{"type":"string","description":"The user's birth date (ISO date, format YYYY-MM-DD)."},"weight":{"description":"The user's current body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"targetWeight":{"nullable":true,"description":"The user's target body weight.","allOf":[{"$ref":"#/components/schemas/Weight"}]},"height":{"description":"The user's body height.","allOf":[{"$ref":"#/components/schemas/Height"}]},"token":{"type":"string","description":"A unique token for the user provided by the partner. Must not contain email addresses or other PII."},"email":{"type":"string","nullable":true,"description":"Deprecated. The email address of the user. Do not set this field in new integrations."},"researchConsent":{"type":"boolean","description":"Indicates whether the user has consented to their data being used for research."}},"required":["id","sex","region","birthDate","weight","height","token","researchConsent"]}}},"paths":{"/users/{token}":{"patch":{"description":"\nThis operation updates the meta data of a specific **user** identified by the partner-provided **token**.\n\nSend only the fields you want to change in the request body; all other fields remain unchanged.\nThe **token** itself cannot be changed by this operation.\n","operationId":"UsersController_update_1","parameters":[{"name":"token","required":true,"in":"path","description":"A unique token for the user provided by the partner. It must not contain an email address or any other PII.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserDto"}}}},"responses":{"200":{"description":"","content":{"application/json;v=1":{"schema":{"$ref":"#/components/schemas/UserDto"}}}}},"summary":"Update meta data of a user.","tags":["Users"]}}}}
````

## List terms acceptances of a user.

> \
> This operation returns all recorded \*\*terms of service\*\* acceptances for a specific user.\
> \
> You identify the user by the partner-provided \*\*token\*\* in the path parameter.\
> Use this endpoint to audit which terms versions a user has accepted and when.<br>

````json
{"openapi":"3.0.3","info":{"title":"Prism Hosted API","version":"1"},"tags":[{"name":"Users","description":"### Create and manage users.\n\nA **User** represents an end-customer whose body scans, 3D assets, and body composition metrics you manage through the Prism Hosted API.\nEach user can have multiple scans over time, which are linked to this user record.\n\nAll Users endpoints require the following headers:\n```http\naccept: application/json;v=1\nauthorization: Bearer {{API_KEY}}\ncontent-type: application/json\n```\nReplace `{{API_KEY}}` with your Prism API key for the selected environment.","parent":"Prism Hosted API"}],"servers":[{"url":"https://api.hosted.prismlabs.tech","description":"Production environment for Prism Hosted API"},{"url":"https://sandbox-api.hosted.prismlabs.tech","description":"Sandbox environment for Prism Hosted API"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","name":"Authorization","in":"header"}},"schemas":{"TermsDto":{"type":"object","properties":{"userId":{"type":"string"},"userToken":{"type":"string"},"accepted":{"type":"boolean"},"version":{"type":"string","nullable":true},"acceptanceDate":{"type":"string"}},"required":["userId","userToken","accepted","version","acceptanceDate"]}}},"paths":{"/users/{token}/terms":{"get":{"description":"\nThis operation returns all recorded **terms of service** acceptances for a specific user.\n\nYou identify the user by the partner-provided **token** in the path parameter.\nUse this endpoint to audit which terms versions a user has accepted and when.\n","operationId":"TermsController_findAll_1","parameters":[{"name":"token","required":true,"in":"path","description":"A unique token for the user provided by the partner. It must not contain an email address or any other PII.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json;v=1":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TermsDto"}}}}}},"summary":"List terms acceptances of a user.","tags":["Users"]}}}}
````

## Create a terms acceptance for a user.

> \
> This operation records a \*\*terms of service\*\* acceptance for a specific user.\
> \
> You identify the user by the partner-provided \*\*token\*\* in the path parameter.\
> Provide the \*\*version\*\* of the terms in the request body; the API stores the acceptance state and timestamp.<br>

````json
{"openapi":"3.0.3","info":{"title":"Prism Hosted API","version":"1"},"tags":[{"name":"Users","description":"### Create and manage users.\n\nA **User** represents an end-customer whose body scans, 3D assets, and body composition metrics you manage through the Prism Hosted API.\nEach user can have multiple scans over time, which are linked to this user record.\n\nAll Users endpoints require the following headers:\n```http\naccept: application/json;v=1\nauthorization: Bearer {{API_KEY}}\ncontent-type: application/json\n```\nReplace `{{API_KEY}}` with your Prism API key for the selected environment.","parent":"Prism Hosted API"}],"servers":[{"url":"https://api.hosted.prismlabs.tech","description":"Production environment for Prism Hosted API"},{"url":"https://sandbox-api.hosted.prismlabs.tech","description":"Sandbox environment for Prism Hosted API"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http","name":"Authorization","in":"header"}},"schemas":{"CreateTermsDto":{"type":"object","properties":{"version":{"type":"string"}}},"TermsDto":{"type":"object","properties":{"userId":{"type":"string"},"userToken":{"type":"string"},"accepted":{"type":"boolean"},"version":{"type":"string","nullable":true},"acceptanceDate":{"type":"string"}},"required":["userId","userToken","accepted","version","acceptanceDate"]}}},"paths":{"/users/{token}/terms":{"post":{"description":"\nThis operation records a **terms of service** acceptance for a specific user.\n\nYou identify the user by the partner-provided **token** in the path parameter.\nProvide the **version** of the terms in the request body; the API stores the acceptance state and timestamp.\n","operationId":"TermsController_create_1","parameters":[{"name":"token","required":true,"in":"path","description":"A unique token for the user provided by the partner. It must not contain an email address or any other PII.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTermsDto"}}}},"responses":{"201":{"description":"","content":{"application/json;v=1":{"schema":{"$ref":"#/components/schemas/TermsDto"}}}}},"summary":"Create a terms acceptance for a user.","tags":["Users"]}}}}
````
