---
title: "Users"
description: "Interface with the autoZnetwork users."
canonical_url: "https://autoznetwork.com/docs/api/users"
---

> Index of every page on this site: [llms.txt](https://autoznetwork.com/llms.txt)

# Users

## Currently Authenticated User

This returns the user that is authorized using the API Key.

GET Request: `https://api.autoznetwork.com/v1/me`

```bash [CURL]
AUTOZNETWORK_TOKEN="your API token"

curl https://api.autoznetwork.com/v1/me \
  -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
  -H 'Accept: application/json'
```

## List Users

This returns the user that is authorized using the API Key.

GET Request: `https://api.autoznetwork.com/v1/users`

<code-group>

```bash [CURL]
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"

curl https://api.autoznetwork.com/v1/users \
  -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
  -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
  -H 'Accept: application/json'
```

```php [PHP]
<?php 
$apiToken = 'ABCD12345 ...';
$organizationId = '1234';

$autoZnetwork = new AutozNetwork($apiToken);

$users = $autoznetwork
              ->withOrganization($organizationId)
              ->users()
              ->get();

print($users)
```

</code-group>

## Add a User

If the user already exists in the autoZnetwork platform (based on email) then they will be sent an invitation to the specified organization.

POST Request: `https://api.autoznetwork.com/v1/users`

<code-group>

```bash [CURL]
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"

curl -X POST https://api.autoznetwork.com/v1/users \
  -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
  -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "first_name": "John",
    "last_name": "Doe",
    "phone_number": "+1234567890",
    "email": "user@mydealership.com",
  }'
```

```php [PHP]
<?php 
$apiToken = 'ABCD12345 ...';
$organizationId = '1234';

$autoZnetwork = new AutozNetwork($apiToken);

$user = $autoZnetwork
              ->withOrganization($organizationId)
              ->users()
              ->create([
                'first_name' => 'John',
                'last_name' => 'Doe',
                'phone_number' => '+1234567890',
                'email' => 'user@mydealership.com'
              ]);

print($user)
```

</code-group>

## Sitemap

See the full [sitemap](https://autoznetwork.com/sitemap.md) for all pages.
