# Create Thryve user

When you integrate Thryve with your web application, you will need to first create a Thryve user. All data connections and data stored at Thryve are always linked to a Thryve user. Unlike mobile apps using the Thryve SDK, where user management is handled automatically, web applications need to manually create a new user or retrieve an existing one using the `accessToken` interface.

{% hint style="warning" %}
Please note that `accessToken/authenticationToken` is used synonymous to `endUserId` and is used in the Thryve API v5. The same is true for `partnerUserId` and `endUserAlias` parameters. With the introduction of Thryve API v6, all interfaces will migrate to use `endUserId`  and `endUserAlias`.
{% endhint %}

We recommend setting an alias for the Thryve user. We call this the `partnerUserID`. (or `endUserAlias` ). Please ensure that the alias is an unguessable string generated, e.g., through a hash function. We suggest at least 32 digits, which may contain both digits, characters, and a dash „-„, as a special character. A `partnerUserID` can have a maximum length of 80 characters.

## Get accessToken of new or existing user

> Retrieve an accessToken for a Thryve user. Automatically creates a user if partnerUserID is empty or no existing user with specified partnerUserID exists.<br>

```json
{"openapi":"3.1.0","info":{"title":"Thryve API","version":"5.0.0"},"servers":[{"url":"https://api.thryve.de"}],"paths":{"/v5/accessToken":{"post":{"summary":"Get accessToken of new or existing user","tags":["End User"],"description":"Retrieve an accessToken for a Thryve user. Automatically creates a user if partnerUserID is empty or no existing user with specified partnerUserID exists.\n","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Basic Auth for your username:password. Required for all endpoints"},{"name":"AppAuthorization","in":"header","required":true,"schema":{"type":"string"},"description":"Basic Auth for your authID:authSecret. Required for all endpoints."}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/AccessTokenRequest"}}}},"responses":{"200":{"description":"Request successful. Returns the accessToken of a user.","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/AccessTokenResponse"}}}},"400":{"description":"Error response (invalid parameters, unauthorized, etc.).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"AccessTokenRequest":{"type":"object","properties":{"partnerUserID":{"type":"string","description":"Set this optional parameter to add your an alias to a Thryve user. If no alias is set, it is not possible to retrieve an accessToken/authenticationToken for an existing user. Newer interfaces call this parameter endUserAlias."}}},"AccessTokenResponse":{"type":"string"},"ErrorResponse":{"type":"string"}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thryve.health/integrate-your-web-app/create-thryve-user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
