Skip to content

Users

B2INST Users API#

User search returns active accounts with confirmed email addresses that your account is permitted to read. The returned fields depend on profile visibility, email visibility, and your permissions.

Authentication and example setup#

User searches require authentication, even when searching for public profiles. Create a personal access token as described in Authentication, then set:

B2INST_HOST='b2inst-test.gwdg.de'
ACCESS_TOKEN='<personal-access-token>'

Reading a public profile directly by its user ID does not require a token. Reading a restricted profile requires authentication as that user or an account with user-management permissions.

Search users#

Search for users visible to your account.

  HTTP method: GET

  URL path: /api/users

  Required parameters: None

  Optional parameters: q, sort, size, page

  Status code on success: 200

  Returns: A list of users visible to your account and matching the query in JSON format.

Command:

curl -H "Authorization: Bearer $ACCESS_TOKEN" "https://$B2INST_HOST/api/users"
Returns:
{
  "hits": {
    "hits": [
      {
        "id": "1",
        "created": "2025-01-01T09:00:00.000000+00:00",
        "updated": "2025-01-01T09:00:00.000000+00:00",
        "links": {
          "self": "https://b2inst-test.gwdg.de/api/users/1",
          "avatar": "https://b2inst-test.gwdg.de/api/users/1/avatar.svg",
          "records_html": "https://b2inst-test.gwdg.de/search/records?q=parent.access.owned_by.user:1"
        },
        "revision_id": 2,
        "active": true,
        "confirmed": true,
        "is_current_user": false,
        "email": "person@eudat.eu",
        "username": "jdoe",
        "profile": {
          "full_name": "John Doe",
          "affiliations": "Affiliation"
        },
        "preferences": {
          "visibility": "public",
          "email_visibility": "public"
        }
      },
      ...
    ],
    "total": 16
  },
  "sortBy": "newest",
  "links": {
    "self": "https://b2inst-test.gwdg.de/api/users?page=1&size=10&sort=newest",
    "next": "https://b2inst-test.gwdg.de/api/users?page=2&size=10&sort=newest"
  }
}

Get a user#

Get a specific user. This example assumes that user 1 has a public profile. For a restricted profile you are allowed to read, add -H "Authorization: Bearer $ACCESS_TOKEN".

  HTTP method: GET

  URL path: /api/users/<user-id>

  Required parameters: user-id

  Status code on success: 200

  Returns: The user in JSON format.

Command:

curl "https://$B2INST_HOST/api/users/1"
Returns:
{
    "id": "1",
    "created": "2025-01-01T09:00:00.000000+00:00",
    "updated": "2025-01-01T09:00:00.000000+00:00",
    "links": {
        "self": "https://b2inst-test.gwdg.de/api/users/1",
        "avatar": "https://b2inst-test.gwdg.de/api/users/1/avatar.svg",
        "records_html": "https://b2inst-test.gwdg.de/search/records?q=parent.access.owned_by.user:1"
    },
    "revision_id": 2,
    "active": true,
    "confirmed": true,
    "is_current_user": false,
    "email": "person@eudat.eu",
    "username": "jdoe",
    "profile": {
        "full_name": "John Doe",
        "affiliations": "Affiliation"
    },
    "preferences": {
        "visibility": "public",
        "email_visibility": "public"
    }
}

Last update : 08.10.2026

Last review : 08.10.2026