---
updatedAt: 2026-02-18T14:00:50.000Z
agentTools:
  projectIndex: https://docs.bridgeapi.io/llms.txt
---

# User creation and authentication

# User creation

It's essential to link Users in your backend to your abstraction of a User or Client. When you create a user with our API, you can add an `external_user_id` in the body as an additional reference.

```curl Create a user
curl --request POST \
     --url https://api.bridgeapi.io/v3/aggregation/users \
     --header 'Bridge-Version: 2025-01-15' \
     --header 'accept: application/json' \
     --header 'content-type: application/json'
```
```curl Create a user with an external user id
curl --request POST \
     --url https://api.bridgeapi.io/v3/aggregation/users \
     --header 'Bridge-Version: 2025-01-15' \
     --header 'accept: application/json' \
     --header 'content-type: application/json'
     --data '
{
  "external_user_id": "A6JEJIID1919BDS"
}
'
```

If you create users with an `external_user_id`, you can both [authenticate](https://docs.bridgeapi.io/reference/createuserauthtoken) them and search for users with this reference in our dashboard.

> ⚠️ User lifecycle management
>
> Don't forget to delete the Bridge users associated to your customers when they delete their account on your service.

<br />

# User authentication

Use the following endpoint to authenticate a user:

```curl Authenticate user with the uuid
curl --request POST \
     --url https://api.bridgeapi.io/v3/aggregation/authorization/token \
     --header 'Bridge-Version: 2025-01-15' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "user_uuid": "c2a26c9e-dc23-4f67-b887-bbae0f26c415"
}
'
```
```curl Authenticate user with an external user id
curl --request POST \
     --url https://api.bridgeapi.io/v3/aggregation/authorization/token \
     --header 'Bridge-Version: 2025-01-15' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "external_user_id": "A6JEJIID1919BDS"
}
'
```

The response will contain an `access_token`:

```json Response
{
  "access_token": "...",
  "expires_at": "2019-05-06T11:08:25.040Z",
  "user": {
    "uuid": "c2a26c9e-dc23-4f67-b887-bbae0f26c415",
    "external_user_id": "A6JEJIID1919BDS"
  }
}
```

To perform authenticated API calls, include the `access_token` in the *Authorization request header* using the bearer authentication scheme. Here's an example:

```curl Request example
curl "https://api.bridgeapi.io/v3/aggregation/items?limit=100" \
	-X GET \
	-H 'Bridge-Version: 2025-01-15' \
	-H 'Client-Id: MY_CLIENT_ID' \
	-H 'Client-Secret: MY_CLIENT_SECRET' \
	-H 'Authorization: Bearer TOP_SECRET_ACCESS_TOKEN'
```

> 📘 Session expiration
>
> Keep in mind that the OAuth token is valid for two hours (UTC+0) after issuance. If the token expires, attempts to make calls with it will result in an HTTP 401 error, requiring a new authentication.