# Create End User

Create a new end user.

Endpoint: POST /api/v1/end-users
Version: 0.2.0
Security: bearerAuth

## Request fields (application/json):

  - `external_id` (string, required)
    The ID that you assign to an end user.

## Response 201 fields (application/json):

  - `id` (string, required)
    The unique identifier of the object in the Fordefi platform.

  - `created_at` (string, required)
    The date and time when the object was created.

  - `modified_at` (string, required)
    The date and time when the object was last modified. Any change to any field of the resource is considered a modification.

  - `external_id` (string, required)
    The ID that you assigned to the end user.
    Example: "user|1234"

  - `last_login_at` (string, required)
    The timestamp when the end user last logged into the mobile SDK.

  - `desired_key_types` (array)
    Desired key types. This field is populated by the user during keyset generation.
    Enum: "ecdsa_secp256k1", "eddsa_ed25519", "ecdsa_stark", "schnorr_secp256k1"

  - `keyset_id` (string, required)
    The unique identifier of the keyset.

  - `ecdsa` (object)
    ECDSA key. The key is used to generate ECDSA-based vaults (for example, EVM vaults).

  - `ecdsa.id` (string, required)
    The ID of the key.

  - `ecdsa.xpub` (string, required)
    The xpub encoding of the key. For more details, see https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#serialization-format

  - `ecdsa.encrypted_shares` (object, required)
    Encrypted shares for the key.

  - `ecdsa.encrypted_shares.device` (string)
    Device latest encrypted share for the key.
    Example: "SGVsbG8="

  - `ecdsa.encrypted_shares.platform` (array)
    Platform encrypted shares for the key. Whether it contains one or two shares depends on the backup type.
    Example: ["SGVsbG8="]

  - `ecdsa.chain_code` (string, required)
    The chain code of the key. It is used to derive child keys.
    Example: "SGVsbG8="

  - `eddsa` (object)
    EdDSA key. The key is used to generate EdDSA-based vaults (for example, Solana vaults).

  - `ecdsa_stark` (object)
    ECDSA-Stark key. The key is used to generate ECDSA-Stark-based vaults (for example, Stark Blackbox vaults).

  - `schnorr_secp256k1` (object)
    Schnorr Secp256k1 key. The key is used to generate Schnorr-Secp256k1-based vaults.

  - `auth_public_key` (string)
    The public key of the user's auth-key.
    Example: "SGVsbG8="

  - `encrypted_device_shares_backups` (array)
    Encrypted device shares backups.

  - `encrypted_device_shares_backups.id` (string)
    The ID of the backup. Not provided for organization keysets.

  - `encrypted_device_shares_backups.created_at` (string, required)
    The time the backup was created.

  - `encrypted_device_shares_backups.ecdsa` (string)
    Device ECDSA encrypted share
    Example: "SGVsbG8="

  - `encrypted_device_shares_backups.eddsa` (string)
    Device EdDSA encrypted share
    Example: "SGVsbG8="

  - `encrypted_device_shares_backups.ecdsa_stark` (string)
    Device ECDSA stark encrypted share
    Example: "SGVsbG8="

  - `encrypted_device_shares_backups.schnorr_secp256k1` (string)
    Device Schnorr secp256k1 encrypted share
    Example: "SGVsbG8="

  - `encrypted_device_shares_backups.auth_key` (string)
    An encrypted backup of the user's auth-key.
    Example: "SGVsbG8="

  - `last_backup_at` (string, required)
    The last time backup was intitated.

  - `export_allowed` (boolean, required)
    Whether the user is allowed to export the keyset.

  - `last_export_at` (string, required)
    The last time the keyset was exported.

## Response 400 fields (application/json):

  - `title` (string, required)
    Human-readable error message.

  - `detail` (string, required)
    Detailed error message.

  - `full_detail` (string)
    Full error message with additional details, if available.

  - `request_id` (string)
    Request ID - for debugging purposes.

  - `system_error_code` (string)
    An additional system error code in Fordefi.

  - `error_type` (string)
    Enum: "unsupported_organization", "backup_not_ready"

## Response 401 fields (application/json):

  - `title` (string, required)
    Human-readable error message.

  - `detail` (string, required)
    Detailed error message.

  - `full_detail` (string)
    Full error message with additional details, if available.

  - `request_id` (string)
    Request ID - for debugging purposes.

## Response 409 fields (application/json):

  - `title` (string, required)
    Human-readable error message.

  - `detail` (string, required)
    Detailed error message.

  - `full_detail` (string)
    Full error message with additional details, if available.

  - `request_id` (string)
    Request ID - for debugging purposes.

  - `resource` (string)
    The type of resource.
    Enum: "user", "user_change_proposals", "user_group", "user_group_change_proposal", "vault", "vault_address", "vault_group", "address_group", "transaction", "batch_transaction", "path", "keyset", "auth_token", "access_token", "asset", "asset_info", "vault_derivation_path", "blockchain", "export", "quote", "import_keys_request", "vault_address_account", "exchange_asset_mapping", "dapp_group", "safe_address", "audit_log"

## Response 422 fields (application/json):

  - `title` (string, required)
    Human-readable error message.

  - `detail` (array, required)

  - `detail.loc` (array, required)

  - `detail.msg` (string, required)

  - `detail.type` (string, required)

  - `full_detail` (string)
    Full error message with additional details, if available.

  - `request_id` (string)
    Request ID - for debugging purposes.


