Skip to main content

Create and deletes multiple identities

PATCH 

/iam/identities

Creates or delete multiple identities. This endpoint can also be used to import credentials for instance passwords, social sign in configurations or multifactor methods.

Request

Body

    identities object[]

    Identities holds the list of patches to apply

    required

  • Array [
  • create object

    Create Identity Body

    credentials object

    Create Identity and Import Credentials

    oidc object

    Create Identity and Import Social Sign In Credentials

    config object
    config object

    Create Identity and Import Password Credentials Configuration

    hashed_passwordstring

    The hashed password in PHC format

    passwordstring

    The password in plain text if no hash is available.

    providers object[]

    A list of OpenID Connect Providers

  • Array [
  • providerstringrequired

    The OpenID Connect provider to link the subject to. Usually something like google or github.

    subjectstringrequired

    The subject (sub) of the OpenID Connect connection. Usually the sub field of the ID Token.

  • ]
  • password object

    Create Identity and Import Password Credentials

    config object

    Create Identity and Import Password Credentials Configuration

    hashed_passwordstring

    The hashed password in PHC format

    passwordstring

    The password in plain text if no hash is available.

    metadata_admin

    Store metadata about the user which is only accessible through admin APIs such as GET /iam/identities/<id>.

    metadata_public

    Store metadata about the identity which the identity itself can see when calling for example the session endpoint. Do not store sensitive information (e.g. credit score) about the identity in this field.

    recovery_addresses object[]

    RecoveryAddresses contains all the addresses that can be used to recover an identity.

    Use this structure to import recovery addresses for an identity. Please keep in mind that the address needs to be represented in the Identity Schema or this field will be overwritten on the next identity update.

  • Array [
  • created_atstring<date-time>

    CreatedAt is a helper struct field for gobuffalo.pop.

    idstring<uuid>required
    updated_atstring<date-time>

    UpdatedAt is a helper struct field for gobuffalo.pop.

    valuestringrequired
    viaRecoveryAddressType must not exceed 16 characters as that is the limitation in the SQL Schema. (string)required
  • ]
  • schema_idstringrequired

    SchemaID is the ID of the JSON Schema to be used for validating the identity's traits.

    stateAn Identity's State (string)

    The state can either be active or inactive.

    Possible values: [active, inactive]

    traitsobjectrequired

    Traits represent an identity's traits. The identity is able to create, modify, and delete traits in a self-service manner. The input will always be validated against the JSON Schema defined in schema_url.

    verifiable_addresses object[]

    VerifiableAddresses contains all the addresses that can be verified by the user.

    Use this structure to import verified addresses for an identity. Please keep in mind that the address needs to be represented in the Identity Schema or this field will be overwritten on the next identity update.

  • Array [
  • created_atstring<date-time>

    When this entry was created

    Example: 2014-01-01T23:28:56.782Z
    idstring<uuid>

    The ID

    statusidentityVerifiableAddressStatus (string)required

    VerifiableAddressStatus must not exceed 16 characters as that is the limitation in the SQL Schema

    updated_atstring<date-time>

    When this entry was last updated

    Example: 2014-01-01T23:28:56.782Z
    valuestringrequired

    The address value

    example foo@user.com

    verifiedbooleanrequired

    Indicates if the address has already been verified

    Example: true
    verified_atstring<date-time>
    viastringrequired

    The delivery method

    Possible values: [email, sms]

    Example: email
  • ]
  • patch_idstring<uuid>

    The ID of this patch.

    The patch ID is optional. If specified, the ID will be returned in the response, so consumers of this API can correlate the response with the patch.

  • ]

Responses

batchPatchIdentitiesResponse

Schema
    identities object[]

    The patch responses for the individual identities.

  • Array [
  • actionstring

    The action for this specific patch create ActionCreate Create this identity.

    Possible values: [create]

    identitystring<uuid>

    The identity ID payload of this patch

    patch_idstring<uuid>

    The ID of this patch response, if an ID was specified in the patch.

  • ]
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Patch, "https://connhex.com/iam/identities");
request.Headers.Add("Accept", "application/json");
var content = new StringContent("{\n \"identities\": [\n {\n \"create\": {\n \"credentials\": {\n \"oidc\": {\n \"config\": {\n \"config\": {\n \"hashed_password\": \"string\",\n \"password\": \"string\"\n },\n \"providers\": [\n {\n \"provider\": \"string\",\n \"subject\": \"string\"\n }\n ]\n }\n },\n \"password\": {\n \"config\": {\n \"hashed_password\": \"string\",\n \"password\": \"string\"\n }\n }\n },\n \"recovery_addresses\": [\n {\n \"created_at\": \"2024-07-29T15:51:28.071Z\",\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"updated_at\": \"2024-07-29T15:51:28.071Z\",\n \"value\": \"string\",\n \"via\": \"string\"\n }\n ],\n \"schema_id\": \"string\",\n \"state\": \"active\",\n \"traits\": {},\n \"verifiable_addresses\": [\n {\n \"created_at\": \"2014-01-01T23:28:56.782Z\",\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"string\",\n \"updated_at\": \"2014-01-01T23:28:56.782Z\",\n \"value\": \"string\",\n \"verified\": true,\n \"verified_at\": \"2024-07-29T15:51:28.071Z\",\n \"via\": \"email\"\n }\n ]\n },\n \"patch_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Body
{
  "identities": [
    {
      "create": {
        "credentials": {
          "oidc": {
            "config": {
              "config": {
                "hashed_password": "string",
                "password": "string"
              },
              "providers": [
                {
                  "provider": "string",
                  "subject": "string"
                }
              ]
            }
          },
          "password": {
            "config": {
              "hashed_password": "string",
              "password": "string"
            }
          }
        },
        "recovery_addresses": [
          {
            "created_at": "2024-07-29T15:51:28.071Z",
            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "updated_at": "2024-07-29T15:51:28.071Z",
            "value": "string",
            "via": "string"
          }
        ],
        "schema_id": "string",
        "state": "active",
        "traits": {},
        "verifiable_addresses": [
          {
            "created_at": "2014-01-01T23:28:56.782Z",
            "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
            "status": "string",
            "updated_at": "2014-01-01T23:28:56.782Z",
            "value": "string",
            "verified": true,
            "verified_at": "2024-07-29T15:51:28.071Z",
            "via": "email"
          }
        ]
      },
      "patch_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    }
  ]
}