Apps

Import users from a collection

Makes the people in a collection (default wp_users, from the Hypamoon Connect plugin for WordPress) users of the app, with role_map from WordPress roles to app roles. No passwords: people sign in with a link or code by email. send_email false (the default) adds them silently; true emails each new person an invitation, within the invitation limits (20 per hour and 100 per day per app; the rest is reported as remaining with retry_after). Idempotent on the WordPress id and the email address: people who can already sign in are left as they are. The app user id is written back into each document (hypamoon_app_users). dry_run shows the plan without changing anything.

post/apps/{id}/users/import

Request

  • Base URL: https://api.hypamoon.com/api/v1
  • URL: https://api.hypamoon.com/api/v1/apps/{id}/users/import
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.hypamoon.com/oauth/authorize, token URL https://api.hypamoon.com/oauth/token, scopes: sites:write)

Path parameters

idstring uuid required

The id of the app.

Request body

collectionstring

The collection with the people, default wp_users (from the Hypamoon Connect plugin). Each document needs email; name comes from display_name, name or first_name and last_name; roles from roles (a list) or role.

role_mapobject

WordPress role to app role, like { "administrator": "admin", "opdrachtgever": "opdrachtgever", "kandidaat": "kandidaat" }. A person gets the app role of the first of their roles that is in the map. Without role_map, a WordPress role with the same name as an app role is used.

default_rolestring nullable

The app role for people whose roles are not in role_map. Leave it out (or null) to skip them; without role_map the app's default_role is used.

send_emailboolean

false (the default): add them silently, no email; they sign in later with a link or code they request on the site. true: email each new person an invitation (counts toward the app's invitation limits and the email budget).

invite_existingboolean

Only with send_email true: also email people who were added earlier (for example silently) and never signed in. Default false, so running the import again sends nothing twice.

dry_runboolean

true: change nothing, only show who would be added with which role.

Response

What happened per person.

app_idstring uuid required
collectionstring required
dry_runboolean required
send_emailboolean required
retry_afterinteger

Seconds to wait before the remaining invitations can go out.

next_stepstring required

Changes

No recorded changes to this operation across all 1 revision of this API.