---
title: "Data"
description: "Read your app's configuration, users, roles and activity log from your backend."
url: "/api-data/"
language: "en"
---

# Data

Read-only endpoints to show your app's users, roles and activity in your own backend or admin panel. They only return data from the app that owns the token.

Send an [access token](/api-intro.md#signin) in every request: `Authorization: Bearer <accessToken>`. Lists are [paginated](/api-intro.md#pagination) and errors follow the [common format](/api-intro.md#responses).

---

## Get the app · `GET /api/app`

Returns your app's domain and the login widget configuration you set in the Dashboard: texts in each language, login providers, modules and their parameters. Without a custom configuration you get the default one.

**cURL**

```bash
curl https://wss.block-auth.io/api/app \
  -H 'Authorization: Bearer your_access_token'
```

> **Placeholders in this code:**
>
> - Replace `your_access_token` with the access token you get from `/api/signin`. It lasts 1 hour.

**Response**

```json
{
  "success": true,
  "message": {
    "domain": "your-app.com",
    "config": {
      "content": {
        "title": { "en": "…", "es": "…" }
      },
      "google": { "enabled": true }
    },
    "modules": {
      "kyc": { "enabled": false, "mode": "none" }
    },
    "params": {}
  }
}
```

> **Placeholders in this code:**
>
> - Replace `your-app.com` with your domain, or fill in your data in the SDK Quickstart and it is filled in for you.

---

## Get a user · `GET /api/user`

Returns the profile of one user who has signed into your app, with their roles.

Personal fields (name, document, email, phone, postal address, birth data…) are `null` unless your app requests them in the Dashboard and the user agreed to share them.

### Query

- `address` (string): The user's address, as you got it from the login.

### Errors

`L1 User not found` if the address doesn't exist, and `User not signed yet` if it never signed into your app.

**cURL**

```bash
curl 'https://wss.block-auth.io/api/user?address=0x7F85…46D8' \
  -H 'Authorization: Bearer your_access_token'
```

> **Placeholders in this code:**
>
> - Replace `your_access_token` with the access token you get from `/api/signin`. It lasts 1 hour.
> - Replace the example address with the address of the user you want to look up.

**Response**

```json
{
  "success": true,
  "message": {
    "items": [
      {
        "address": "0x7F85…46D8",
        "did": "0x7F85…46D8",
        "alias": "alice",
        "firstname": null,
        "email": "alice@example.com",
        "roles": [
          { "slug": "acme-x7k2p9", "name": "Admin" }
        ]
      }
    ]
  }
}
```

> **Placeholders in this code:**
>
> - Replace `acme-x7k2p9` with the slug of one of your roles: copy it from the Roles tab in the Dashboard, under the role name.

---

## List users · `GET /api/users`

Users who have signed into your app, newest first.

### Query

- `page` (number): Page to return, from 1. Default `1`.
- `limit` (number): Results per page, 1 to 100. Default `100`.
- `search` (string): Part of an address.
- `fromServices` (string): Only users who logged in with these methods, separated by commas: `blockauth`, `google`, `microsoft`, `metamask`, `phantom`.

### Each item

- `id` (number): ID of the user in your app.
- `user_address` (string): The user's address.
- `user_first_used_at` (string): First login in your app (UTC).
- `user_last_used_at` (string): Last login in your app (UTC).
- `user_total_txns` (number): Number of operations of the user in your app.
- `user_services_names` (array): Login methods the user has used.
- `roles` (array): The user's roles, as `{ slug, name }`.

**cURL**

```bash
curl 'https://wss.block-auth.io/api/users?page=1&limit=20&fromServices=blockauth,google' \
  -H 'Authorization: Bearer your_access_token'
```

> **Placeholders in this code:**
>
> - Replace `your_access_token` with the access token you get from `/api/signin`. It lasts 1 hour.

**Response**

```json
{
  "success": true,
  "message": {
    "pages": 1,
    "total": 1,
    "items": [
      {
        "id": 42,
        "user_address": "0x7F85…46D8",
        "app_name": "My app",
        "user_total_txns": 12,
        "user_first_used_at": "2026-09-02T10:14:00.000Z",
        "user_last_used_at": "2026-11-10T08:31:00.000Z",
        "user_services_names": ["blockauth"],
        "roles": [
          { "app_user_id": 42, "rol_id": 3, "slug": "acme-x7k2p9", "name": "Admin" }
        ]
      }
    ]
  }
}
```

> **Placeholders in this code:**
>
> - Replace `acme-x7k2p9` with the slug of one of your roles: copy it from the Roles tab in the Dashboard, under the role name.

---

## List roles · `GET /api/roles`

The roles you created in the Dashboard for your users. Use the `slug` in your code: the `name` is only for display. See [Roles](/sdk-roles.md) to use them in your UI.

### Query

- `page` (number): Page to return, from 1. Default `1`.
- `limit` (number): Results per page, 1 to 100. Default `100`.
- `search` (string): Part of the name, slug or description.

**cURL**

```bash
curl 'https://wss.block-auth.io/api/roles?page=1&limit=100' \
  -H 'Authorization: Bearer your_access_token'
```

> **Placeholders in this code:**
>
> - Replace `your_access_token` with the access token you get from `/api/signin`. It lasts 1 hour.

**Response**

```json
{
  "success": true,
  "message": {
    "pages": 1,
    "total": 1,
    "items": [
      {
        "id": 3,
        "slug": "acme-x7k2p9",
        "name": "Admin",
        "description": "Full access",
        "public": 0
      }
    ]
  }
}
```

> **Placeholders in this code:**
>
> - Replace `acme-x7k2p9` with the slug of one of your roles: copy it from the Roles tab in the Dashboard, under the role name.

---

## List activity · `GET /api/logs`

Logins, logouts and other operations of your users in your app, newest first, with their state on the Block-Auth chain.

### Query

- `page` (number): Page to return, from 1. Default `1`.
- `limit` (number): Results per page, 1 to 100. Default `100`.
- `methods[]` (string): Only these operations, for example `signin` or `signout`. Repeat the parameter for several values.
- `states[]` (string): Only these states: `initial`, `pending`, `approved`, `cancelled`. Repeat the parameter for several values.
- `fromServices` (string): Only these login methods, separated by commas.

### Each item

- `id` (number): ID of the entry.
- `method` (string): The operation, for example `signin`.
- `state` (string): `initial`, `pending`, `approved` or `cancelled`.
- `hash` (string): Transaction hash on the Block-Auth chain, when there is one. Look it up in the [Explorer](https://explorer.block-auth.io/).
- `fromService` (string): Login method used, for example `blockauth`.
- `created_at` (string): When it happened (UTC).

**cURL**

```bash
curl -g 'https://wss.block-auth.io/api/logs?page=1&limit=20&methods[]=signin&states[]=approved' \
  -H 'Authorization: Bearer your_access_token'
```

> **Placeholders in this code:**
>
> - Replace `your_access_token` with the access token you get from `/api/signin`. It lasts 1 hour.

**Response**

```json
{
  "success": true,
  "message": {
    "pages": 1,
    "total": 1,
    "items": [
      {
        "id": 981,
        "method": "signin",
        "state": "approved",
        "hash": "0x5c1e…a07b",
        "block_number": 120345,
        "fromService": "blockauth",
        "app_name": "My app",
        "app_domain": "your-app.com",
        "created_at": "2026-11-10T08:31:00.000Z"
      }
    ]
  }
}
```

> **Placeholders in this code:**
>
> - Replace `your-app.com` with your domain, or fill in your data in the SDK Quickstart and it is filled in for you.
