Generate an Instant Key
Last updated
Was this helpful?
Last updated
Was this helpful?
Generates a new for a specified .
Specify the user_identity_id
to receive the instant key.
Code
await seam.userIdentities.generateInstantKey({
user_identity_id: "5c945ab5-c75e-4bcb-8e5f-9410061c401f",
});
Output
{
"instant_key_id": "33fb0384-b2b3-445e-b780-3fad784e9baa",
"instant_key_url": "https://ik.seam.co/EXAMPLE",
"user_identity_id": "48500a8e-5e7e-4bde-b7e5-0be97cae5d7a",
"client_session_id": "7cc9b16b-d139-45e2-8042-5cef6ee101ea",
"workspace_id": "398d80b7-3f96-47c2-b85a-6f8ba21d07be",
"created_at": "2024-01-09T05:45:33.068Z",
"expires_at": "2024-02-09T05:45:33.068Z"
}
Specify the user_identity_id
to receive the instant key.
Code
curl --include --request POST "https://connect.getseam.com/user_identities/generate_instant_key" \
--header "Authorization: Bearer $SEAM_API_KEY" \
--json @- <<EOF
{
"user_identity_id": "5c945ab5-c75e-4bcb-8e5f-9410061c401f"
}
EOF
Output
{
"instant_key": {
"instant_key_id": "33fb0384-b2b3-445e-b780-3fad784e9baa",
"instant_key_url": "https://ik.seam.co/EXAMPLE",
"user_identity_id": "48500a8e-5e7e-4bde-b7e5-0be97cae5d7a",
"client_session_id": "7cc9b16b-d139-45e2-8042-5cef6ee101ea",
"workspace_id": "398d80b7-3f96-47c2-b85a-6f8ba21d07be",
"created_at": "2024-01-09T05:45:33.068Z",
"expires_at": "2024-02-09T05:45:33.068Z"
}
}
Specify the user_identity_id
to receive the instant key.
Code
seam.user_identities.generate_instant_key(
user_identity_id="5c945ab5-c75e-4bcb-8e5f-9410061c401f"
)
Output
InstantKey(
instant_key_id="33fb0384-b2b3-445e-b780-3fad784e9baa",
instant_key_url="https://ik.seam.co/EXAMPLE",
user_identity_id="48500a8e-5e7e-4bde-b7e5-0be97cae5d7a",
client_session_id="7cc9b16b-d139-45e2-8042-5cef6ee101ea",
workspace_id="398d80b7-3f96-47c2-b85a-6f8ba21d07be",
created_at="2024-01-09T05:45:33.068Z",
expires_at="2024-02-09T05:45:33.068Z",
)
Specify the user_identity_id
to receive the instant key.
Code
seam.user_identities.generate_instant_key(user_identity_id: "5c945ab5-c75e-4bcb-8e5f-9410061c401f")
Output
{
"instant_key_id" => "33fb0384-b2b3-445e-b780-3fad784e9baa",
"instant_key_url" => "https://ik.seam.co/EXAMPLE",
"user_identity_id" => "48500a8e-5e7e-4bde-b7e5-0be97cae5d7a",
"client_session_id" => "7cc9b16b-d139-45e2-8042-5cef6ee101ea",
"workspace_id" => "398d80b7-3f96-47c2-b85a-6f8ba21d07be",
"created_at" => "2024-01-09T05:45:33.068Z",
"expires_at" => "2024-02-09T05:45:33.068Z",
}
Specify the user_identity_id
to receive the instant key.
Code
<?php
$seam->user_identities->generate_instant_key(
user_identity_id: "5c945ab5-c75e-4bcb-8e5f-9410061c401f"
);
Output
<?php
[
"instant_key_id" => "33fb0384-b2b3-445e-b780-3fad784e9baa",
"instant_key_url" => "https://ik.seam.co/EXAMPLE",
"user_identity_id" => "48500a8e-5e7e-4bde-b7e5-0be97cae5d7a",
"client_session_id" => "7cc9b16b-d139-45e2-8042-5cef6ee101ea",
"workspace_id" => "398d80b7-3f96-47c2-b85a-6f8ba21d07be",
"created_at" => "2024-01-09T05:45:33.068Z",
"expires_at" => "2024-02-09T05:45:33.068Z",
];
Specify the user_identity_id
to receive the instant key.
Code
package main
import api "github.com/seamapi/go"
func main() {
client.UserIdentities.GenerateInstantKey(
context.Background(),
api.UserIdentitiesGenerateInstantKeyRequest{
UserIdentityId: api.String("5c945ab5-c75e-4bcb-8e5f-9410061c401f"),
},
)
}
Output
api.InstantKey{InstantKeyId: "33fb0384-b2b3-445e-b780-3fad784e9baa", InstantKeyUrl: "https://ik.seam.co/EXAMPLE", UserIdentityId: "48500a8e-5e7e-4bde-b7e5-0be97cae5d7a", ClientSessionId: "7cc9b16b-d139-45e2-8042-5cef6ee101ea", WorkspaceId: "398d80b7-3f96-47c2-b85a-6f8ba21d07be", CreatedAt: "2024-01-09T05:45:33.068Z", ExpiresAt: "2024-02-09T05:45:33.068Z"}
Specify the user_identity_id
to receive the instant key.
Code
seam user-identities generate-instant-key --user_identity_id "5c945ab5-c75e-4bcb-8e5f-9410061c401f"
Output
{
"instant_key_id": "33fb0384-b2b3-445e-b780-3fad784e9baa",
"instant_key_url": "https://ik.seam.co/EXAMPLE",
"user_identity_id": "48500a8e-5e7e-4bde-b7e5-0be97cae5d7a",
"client_session_id": "7cc9b16b-d139-45e2-8042-5cef6ee101ea",
"workspace_id": "398d80b7-3f96-47c2-b85a-6f8ba21d07be",
"created_at": "2024-01-09T05:45:33.068Z",
"expires_at": "2024-02-09T05:45:33.068Z"
}
API key
Personal access token
Must also include the seam-workspace
header in the request.
user_identity_id
String (Required)
ID of the user identity for which you want to generate an instant key.
max_use_count
Number
Maximum number of times the instant key can be used. Default: 1.
To learn more, see .