# Generate an auth token for a given user identifier

> You're reading the Mindset v3 documentation. v3 is no longer sold; this is reference for existing customers. Mindset 4 docs are at /docs.

Mindset v3 REST API reference: SDK Users.

**POST** `/api/v1/appuid/{appUid}/sdkusers/auth`

## Base URL

Requests go to your region's API host, for example `https://a.api.mindset.ai`. Hosts: `https://a.api.mindset.ai`, `https://b.api.mindset.ai`, `https://c.api.mindset.ai`, `https://d.api.mindset.ai`.

## Authorization

- `x-api-key` (string, required, header)

  Your API key.

## Path parameters

- `appUid` (string, required, path)

  Your application's uid

## Request body

Content type: `application/json`.

- `name` (string, body)

  Friendly name to be set for the user

* `userEmail` (string, body)

  email address format user identifier. Deprecated. Prefer using externalId.

- `sdkUserEmail` (string, body)

  SDK user email address. Alias for userEmail.

* `externalId` (string, body)

  Unique user identifier. Valid characters are A-Za-z0-9\_-.

- `accountUids` (string\[], body)

  Array of account uids (max 10). The user will be added to these accounts to allow access to restricted agents.

* `externalTenantId` (string, body)

  Unique tenant identifier. Valid characters are A-Za-z0-9\_-.

```json
{
  "name": "string",
  "userEmail": "string",
  "sdkUserEmail": "string",
  "externalId": "string",
  "accountUids": [
    "string"
  ],
  "externalTenantId": "string"
}
```

## Responses

### 201

User found or created. Auth token generated

```json
{
  "authToken": "string"
}
```

### 400

Bad Request

### 401

Unauthorized

### 403

Forbidden

### 404

A specified account was not found

### 422

Some error occured creating the user or generating the token

### 500

Internal Server Error

## Example request

```bash
curl -X POST "https://a.api.mindset.ai/api/v1/appuid/{appUid}/sdkusers/auth" \
  -H "x-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","userEmail":"string","sdkUserEmail":"string","externalId":"string","accountUids":["string"],"externalTenantId":"string"}'
```
