Skip to Content
Docs
API referenceManagement API

User imports

Import organizations

POST
/organizations/import

Apply, or with dry_run (default true) plan, a batch of at most 100 organizations and 1,000 member entries under an import run, after their users (pontive-spec 46 §5.3). external_id is each row's key. A member names its user by exactly one of user_id, user_external_id or legacy_subject (the run's source), with roles of the org type; one that names no user fails as a warning on the row, not the organization. A new organization needs at least one resolved member with owner (owners_required). An existing one (same external_id) takes new members and, with on_existing update, its name, metadata and changed roles; its owners change by transfer, never by import (owner_requires_transfer). An organization larger than one batch is sent again with its next members. A b2c instance refuses the call (tenancy_mode_b2c). Needs sys:org:create on the instance root, and sys:member:manage on each existing organization the batch changes.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Request Body

Batch

application/json
  1. body

Batch

dry_run?boolean
organizations?array<>
user_import_id?string

Response Body

OK

application/json
  1. response
batch?integer

Batch is the batch's number in the run; absent in a dry run.

counts?
dry_run?boolean
object?string
records?array<>
user_import_id?string
Example Request
curl -X POST 'https://api.us.pontive.com/v1/organizations/import' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "batch": 0,  "counts": {    "created": 0,    "failed": 0,    "skipped": 0,    "updated": 0  },  "dry_run": true,  "object": "string",  "records": [    {      "errors": [        {          "code": "string",          "field": "string",          "message": "string"        }      ],      "index": 0,      "key": "string",      "organization_id": "string",      "outcome": "created",      "user_id": "string",      "warnings": [        {          "code": "string",          "field": "string",          "message": "string"        }      ]    }  ],  "user_import_id": "string"}

List user imports

GET
/user-imports

The instance's import runs, newest first. Needs sys:user:read on the instance root.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Query Parameters

status?string

Only runs in this status

Value in"open""reverting""reverted"
migration_source_id?string

Only runs from this migration source (msrc_)

created_after?string

Created at or after this time (RFC 3339)

created_before?string

Created before this time (RFC 3339)

page?integer

Page number

limit?integer

Items per page, 1 to 100

Response Body

OK

application/json
  1. response
data?array<>
object?string
pagination?

Pagination is the page answered (api-route-review D9).

Example Request
curl -X GET 'https://api.us.pontive.com/v1/user-imports'
Example Response
{  "data": [    {      "counts": {        "batches": 0,        "memberships_written": 0,        "organizations_created": 0,        "organizations_failed": 0,        "organizations_updated": 0,        "users_created": 0,        "users_failed": 0,        "users_skipped": 0,        "users_updated": 0      },      "created_at": "string",      "id": "string",      "last_batch_at": "string",      "migration_source_id": "string",      "name": "string",      "object": "string",      "options": {        "emit_events": true,        "identity_connections": [          {            "app_id": "string",            "connection_slug": "string",            "connection_type": "google"          }        ],        "on_existing": "skip",        "password_policy_violation": "require_change",        "totp_app_ids": [          "string"        ],        "totp_apps": [          {            "app_id": "string",            "issuer": "string"          }        ]      },      "reverted_at": "string",      "status": "open",      "updated_at": "string"    }  ],  "object": "string",  "pagination": {    "limit": 0,    "page": 0,    "total": 0,    "total_pages": 0  }}

Create user import

POST
/user-imports

Start an import run (pontive-spec 46 §5.1): a migration's batches of users and organizations, its counters, a record per applied row, and revert. migration_source_id is optional; without one, rows match existing users by external_id only and carry no legacy_subject or firebase_scrypt hash. options are checked now and fixed: on_existing (skip, default, or update), password_policy_violation (require_change, default, or allow), identity_connections (at most 20; each app must have that connection, of that type), totp_app_ids (at most 20; each app must have TOTP on with an issuer) and emit_events (default true: pontive.user.created for each user the run creates). Needs sys:user:manage on the instance root.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Request Body

Run

application/json
  1. body

Run

migration_source_id?string
name?string
options?

Response Body

Created

application/json
  1. response
counts?
created_at?string
id?string
last_batch_at?string
migration_source_id?string
name?string
object?string
options?
reverted_at?string
status?string
Value in"open""reverting""reverted"
updated_at?string
Example Request
curl -X POST 'https://api.us.pontive.com/v1/user-imports' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "counts": {    "batches": 0,    "memberships_written": 0,    "organizations_created": 0,    "organizations_failed": 0,    "organizations_updated": 0,    "users_created": 0,    "users_failed": 0,    "users_skipped": 0,    "users_updated": 0  },  "created_at": "string",  "id": "string",  "last_batch_at": "string",  "migration_source_id": "string",  "name": "string",  "object": "string",  "options": {    "emit_events": true,    "identity_connections": [      {        "app_id": "string",        "connection_slug": "string",        "connection_type": "google"      }    ],    "on_existing": "skip",    "password_policy_violation": "require_change",    "totp_app_ids": [      "string"    ],    "totp_apps": [      {        "app_id": "string",        "issuer": "string"      }    ]  },  "reverted_at": "string",  "status": "open",  "updated_at": "string"}

Get user import

GET
/user-imports/{user_import_id}

The run with its options and counters. Needs sys:user:read on the instance root.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Path Parameters

user_import_id*string

User import ID (uimp_)

Response Body

OK

application/json
  1. response
counts?
created_at?string
id?string
last_batch_at?string
migration_source_id?string
name?string
object?string
options?
reverted_at?string
status?string
Value in"open""reverting""reverted"
updated_at?string
Example Request
curl -X GET 'https://api.us.pontive.com/v1/user-imports/string'
Example Response
{  "counts": {    "batches": 0,    "memberships_written": 0,    "organizations_created": 0,    "organizations_failed": 0,    "organizations_updated": 0,    "users_created": 0,    "users_failed": 0,    "users_skipped": 0,    "users_updated": 0  },  "created_at": "string",  "id": "string",  "last_batch_at": "string",  "migration_source_id": "string",  "name": "string",  "object": "string",  "options": {    "emit_events": true,    "identity_connections": [      {        "app_id": "string",        "connection_slug": "string",        "connection_type": "google"      }    ],    "on_existing": "skip",    "password_policy_violation": "require_change",    "totp_app_ids": [      "string"    ],    "totp_apps": [      {        "app_id": "string",        "issuer": "string"      }    ]  },  "reverted_at": "string",  "status": "open",  "updated_at": "string"}

List user import records

GET
/user-imports/{user_import_id}/records

The run's records, one per applied row, in the order applied: what matched the row (key), what happened (outcome) and why a row failed (errors, never a value from the row). Records are kept 90 days after the run's last batch. Needs sys:user:read on the instance root.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Path Parameters

user_import_id*string

User import ID (uimp_)

Query Parameters

kind?string

Only records of this kind

Value in"user""organization"
outcome?string

Only records with this outcome

Value in"created""updated""skipped""failed"
page?integer

Page number

limit?integer

Items per page, 1 to 100

Response Body

OK

application/json
  1. response
data?array<>
object?string
pagination?

Pagination is the page answered (api-route-review D9).

Example Request
curl -X GET 'https://api.us.pontive.com/v1/user-imports/string/records'
Example Response
{  "data": [    {      "batch": 0,      "created_at": "string",      "errors": [        {          "code": "string",          "field": "string",          "message": "string"        }      ],      "id": "string",      "index": 0,      "key": "string",      "kind": "user",      "object": "string",      "organization_id": "string",      "outcome": "created",      "reverted": true,      "user_id": "string",      "user_import_id": "string"    }  ],  "object": "string",  "pagination": {    "limit": 0,    "page": 0,    "total": 0,    "total_pages": 0  }}

Revert user import

POST
/user-imports/{user_import_id}/revert

Undo, or with dry_run (default true) plan undoing, up to 1,000 of what the run created (pontive-spec 46 §5.5): the organizations it created whose every member is a user it created who has not signed in, then those users, deleted outright so their identifiers are free for a re-import. Users who signed in, organizations with other members and everything the run updated are kept; kept lists them with why. The run takes no more batches; call again while remaining is above 0, and the run is reverted once a call finds nothing left. Needs sys:user:manage on the instance root, and sys:org:delete on each organization it deletes.

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Path Parameters

user_import_id*string

User import ID (uimp_)

Request Body

Revert

application/json
  1. body

Revert

dry_run?boolean

DryRun (default true) answers what would go and deletes nothing.

Response Body

OK

application/json
  1. response
dry_run?boolean
kept?array<>
object?string
organizations_deleted?integer
remaining?integer

Remaining is what is left for the next call; 0 when the run is reverted.

users_deleted?integer
Example Request
curl -X POST 'https://api.us.pontive.com/v1/user-imports/string/revert' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "dry_run": true,  "kept": [    {      "organization_id": "string",      "reason": "signed_in",      "user_id": "string"    }  ],  "object": "string",  "organizations_deleted": 0,  "remaining": 0,  "users_deleted": 0}

Import users

POST
/users/import

Apply, or with dry_run (default true) plan, a batch of at most 100 users under an import run (pontive-spec 46 §5.2). Each row is POST /v1/users's fields plus legacy_subject (the user's id in the run's migration source), created_at (in the past), status (active or deactivated), and one of password (plaintext, hashed now) or password_hash: bcrypt, argon2, scrypt, firebase_scrypt, pbkdf2, django, werkzeug, aspnet_identity, wordpress, ldap or digest (§6.1). Hashes under OWASP's minimum are wrapped in argon2id; every imported hash is replaced by a native one at the user's first sign-in, when the password is also checked against the password policy (a change is required on failure unless the run allows it). totp (base32 secret, SHA1, 6 digits, 30 seconds, with up to 16 recovery codes) is stored for the run's totp_app_ids; external_identities are written to the run's identity_connections of their type (google, github, apple, oidc; microsoft and entra are identity_not_portable). A row matches an existing user by its legacy subject, else external_id, never by email: a match is skipped or, with on_existing update, updated; an email, phone or username held by a user it does not match fails identifier_conflict. Each row stands alone and answers a record: created, updated, skipped or failed with errors, never a value from the row. Nothing is sent to the users. Without user_import_id an applied batch starts a run with the default options. The call answers 200 whatever its rows' outcomes. Needs sys:user:manage on the instance root, and sys:user:credentials when a row carries password, password_hash, totp or external_identities (never a token acting for a user).

Authorization

headerx-pontive-instance-id<token>

Instance ID for the request

Request Body

Batch

application/json
  1. body

Batch

dry_run?boolean

DryRun (default true) answers the plan and writes nothing.

user_import_id?string

UserImportID names the run; omitted, an applied batch starts a run with the default options and no source.

users?array<>

Response Body

OK

application/json
  1. response
batch?integer

Batch is the batch's number in the run; absent in a dry run.

counts?
dry_run?boolean
object?string
records?array<>
user_import_id?string
Example Request
curl -X POST 'https://api.us.pontive.com/v1/users/import' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "batch": 0,  "counts": {    "created": 0,    "failed": 0,    "skipped": 0,    "updated": 0  },  "dry_run": true,  "object": "string",  "records": [    {      "errors": [        {          "code": "string",          "field": "string",          "message": "string"        }      ],      "index": 0,      "key": "string",      "organization_id": "string",      "outcome": "created",      "user_id": "string",      "warnings": [        {          "code": "string",          "field": "string",          "message": "string"        }      ]    }  ],  "user_import_id": "string"}