---
title: "Link a Firebase account to an Auth0 account"
description: "Validate both tokens and create a linked account record.\n\nAccepts a Firebase ID token and an Auth0 JWT. Both are validated before\nany record is written. Returns 409 if either account is already linked."
---

> Documentation Index
> Fetch the complete documentation index at: https://truememory-docs.mvstg.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Auth API › Auth

`POST /auth/link_mv_account`

Validate both tokens and create a linked account record.

Accepts a Firebase ID token and an Auth0 JWT. Both are validated before
any record is written. Returns 409 if either account is already linked.

## Request body

_Required._

- `firebase_token` (`link_mv_account_auth_link_mv_account_post.firebase_token`; string, required)
- `auth0_token` (`link_mv_account_auth_link_mv_account_post.auth0_token`; string, required)

## Example request

```json
{
  "firebase_token": "string",
  "auth0_token": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://truememory-auth.mvstg.com/auth/link_mv_account \
  --header 'Content-Type: application/json' \
  --data '
{
  "firebase_token": "string",
  "auth0_token": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://truememory-auth.mvstg.com/auth/link_mv_account';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({firebase_token: 'string', auth0_token: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://truememory-auth.mvstg.com/auth/link_mv_account"

payload = {
    "firebase_token": "string",
    "auth0_token": "string"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Successful Response

#### Example

```json
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "firebase_user_id": "636923ed-630d-4147-9114-1cccc26d0ae7",
  "auth0_user_id": "string",
  "email": "string",
  "created_at": "2019-08-24T14:15:22Z"
}
```

- `id` (`link_mv_account_auth_link_mv_account_post.response.201.id`; string, required)
  - format `uuid`
- `firebase_user_id` (`link_mv_account_auth_link_mv_account_post.response.201.firebase_user_id`; string, required)
  - format `uuid`
- `auth0_user_id` (`link_mv_account_auth_link_mv_account_post.response.201.auth0_user_id`; string, required)
- `email` (`link_mv_account_auth_link_mv_account_post.response.201.email`; string, required)
- `created_at` (`link_mv_account_auth_link_mv_account_post.response.201.created_at`; string, required)
  - format `date-time`

### 422

Validation Error

#### Example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

- `detail` (`link_mv_account_auth_link_mv_account_post.response.422.detail`; array<object>, optional)
  - `loc` (`link_mv_account_auth_link_mv_account_post.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`link_mv_account_auth_link_mv_account_post.response.422.detail.msg`; string, required)
  - `type` (`link_mv_account_auth_link_mv_account_post.response.422.detail.type`; string, required)
  - `input` (`link_mv_account_auth_link_mv_account_post.response.422.detail.input`; unknown, optional)
  - `ctx` (`link_mv_account_auth_link_mv_account_post.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/auth/post-link-mv-account/index.md
