# User

Source: https://docs.autessa.com/docs/api/poweruser/user

> Poweruser endpoints for inspecting the authenticated key's linked user, company, and the full endpoint registry.

# User

Introspection endpoints for a poweruser key. Use them to confirm which user and company a key acts as, and to discover every endpoint available on the Poweruser API surface.

> All paths on this page are relative to `https://api.autessa.com/autessa_poweruser/user`. Every request is a POST with a JSON body — send `{}` when there are no parameters. See the [Poweruser API overview](/docs/api/poweruser.md) for authentication and conventions.

---

## Get the current user

**POST** `/user/me`

Returns the identity behind the key: the linked user and the company scope
every request executes in. Call this first when wiring up an integration to
verify you are acting as the account you expect.

### Request parameters

None — send an empty object `{}`.

### Response

- `email` (string) — Email address of the linked user.
- `name` (string) — Display name of the linked user.
- `companyName` (string) — Name of the company the key is scoped to. All resources you create or read belong to this company.
- `errors` (array<string>) — Error messages, if any occurred.

**cURL:**

```bash
curl https://api.autessa.com/autessa_poweruser/user/me \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/autessa_poweruser/user/me',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.POWERUSER_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({})
  }
);

const { email, name, companyName } = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/autessa_poweruser/user/me',
    headers={'Authorization': os.environ['POWERUSER_KEY']},
    json={}
)

data = response.json()
print(data['email'], data['companyName'])
```

```json title="Response"
{
  "email": "jane@acme.com",
  "name": "Jane Doe",
  "companyName": "Acme Corp"
}
```

---

## List available endpoints

**POST** `/user/available-endpoints`

Returns the complete registry of Poweruser API endpoints — every endpoint
key, its request path, and the group it belongs to. This is the same list of
endpoint keys you choose from when creating a **scoped key**, so use it to
build key-provisioning UIs or to check what a given `key` value maps to.

> The registry is static: it always returns every endpoint on the platform,
> regardless of the calling key's own scope. To find out whether *your* key can
> call an endpoint, call it — scoped keys receive HTTP `403` for endpoints
> outside their allow-list.

### Request parameters

None — send an empty object `{}`.

### Response

- `endpoints` (array<EndpointInfo>) — One entry per endpoint on the Poweruser API.
- `endpoints[].key` (string) — Stable enum key for the endpoint (for example `AGENTS_CREATE`). Use these values when defining a scoped key's allow-list.
- `endpoints[].path` (string) — Full request path, including the `/autessa_poweruser` prefix.
- `endpoints[].group` (string) — Human-readable group the endpoint belongs to (for example `"Agents"`, `"AutessaDB Queries"`).
- `errors` (array<string>) — Error messages, if any occurred.

**cURL:**

```bash
curl https://api.autessa.com/autessa_poweruser/user/available-endpoints \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/autessa_poweruser/user/available-endpoints',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.POWERUSER_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({})
  }
);

const { endpoints } = await response.json();
const agentEndpoints = endpoints.filter(e => e.group === 'Agents');
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/autessa_poweruser/user/available-endpoints',
    headers={'Authorization': os.environ['POWERUSER_KEY']},
    json={}
)

endpoints = response.json()['endpoints']
groups = sorted({e['group'] for e in endpoints})
```

```json title="Response (truncated)"
{
  "endpoints": [
    {
      "key": "USER_ME",
      "path": "/autessa_poweruser/user/me",
      "group": "User"
    },
    {
      "key": "AGENTS_CREATE",
      "path": "/autessa_poweruser/agents/create",
      "group": "Agents"
    },
    {
      "key": "AUTESSADB_QUERY_QUERY",
      "path": "/autessa_poweruser/autessadb/query/query",
      "group": "AutessaDB Queries"
    }
  ],
  "errors": []
}
```

---

## Errors

| Status | When |
|--------|------|
| `200` | Success. |
| `401` | Invalid or expired key. |
| `403` | Scoped key without `USER_ME` / `USER_AVAILABLE_ENDPOINTS` in its allow-list. |
| `408` | Server-side error; `errors` contains the message. |

---

## Related

- [Poweruser API overview](/docs/api/poweruser.md)
- [Poweruser Keys guide](/docs/guide/api-management/poweruser-keys.md)
- [Agents](/docs/api/poweruser/agents.md)

