# Aliases

{% hint style="info" %}
**Use Case**

* Provides a rule to fuzzy match requests with similar paths to a common endpoint
  {% endhint %}

## Examples

Let's say we have the requests with paths `/users/1`, `/users/2`, `/users/100`, etc... and we want to group them together. To capture this behavior when creating an endpoint, mark the `:user_id` path component as an **alias**.

### Example 1

The following endpoint with `:user_id` marked as an alias will match `/users/1`, `/users/2`, `/users/100`, etc...

```
/users/:user_id
```

### Example 2

The following endpoint with `:username` and `:repository` marked as an alias will also matches requests with the paths`/users/1`, `/users/2`, `/users/100`, etc...

```
/:username/:repository
```

This creates an ambiguous situation where it is unclear whether the paths belong to the endpoint in **Example 1** or the endpoint in **Example 2**. To address the ambiguity we match requests to viable endpoints with the **least number** of aliases, which would be the endpoint from **Example 1**.

## How To Create

### Method 1

When creating an endpoint, you have the option to configure path segment(s) as an alias. To configure an alias, select the dropdown menu to the right of the designated path segment.

<figure><img src="https://3980092275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MLvhXOE-py5MDUOXDKD%2Fuploads%2Fgit-blob-4811b6a9b7baa63f602d9cf31222797adf635e0c%2FCapture%20(8).PNG?alt=media" alt=""><figcaption><p>Endpoints Create Modal</p></figcaption></figure>

### Method 2

After creating an endpoint, you also have the option to configure path segment(s) as an alias. To configure an alias, select the pencil icon button underneath the **Alias** column for the desired path segment.

<figure><img src="https://3980092275-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MLvhXOE-py5MDUOXDKD%2Fuploads%2Fgit-blob-f43860a0ddbbd24c62bc5f79f8067e7dc08e3131%2Fendpoint-details.PNG?alt=media" alt=""><figcaption><p>Endpoint Details Page</p></figcaption></figure>
