> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/vehicle/_getbyuserid.md).

# \_getByUserId

Fetches the Vehicle attached to a User.

### Parameters

#### userid

The ID of the User.

### Example

```
FM_api('Vehicle_getByUserId', ['userid' => '123']);
```

### Result

#### On Success

The ID of the Vehicle attached to the User. For example:

```
{'vehicle_id':'22fea29c9ee8f58daf60cc24cfc5d835'}
```

#### On Failure

If the user is not logged in:

```
{'error':'not logged in'}
```
