Granting Access Using Seam Instant Keys

Create a User Identity
Create an Access Grant
Deliver the Instant Key

Last updated
Was this helpful?


Last updated
Was this helpful?
Was this helpful?
# Create a user identity for your user.
jane_user = seam.user_identities.create(
full_name = "Jane Doe",
phone_number = "+15555550100"
)UserIdentity(
user_identity_id='43947360-cdc8-4db6-8b22-e079416d1d8b',
full_name='Jane Doe',
phone_number='+15555550100',
...
)# Create a user identity for your user.
jane_user=$(curl -X 'POST' \
'https://connect.getseam.com/user_identities/create' \
-H 'accept: application/json' \
-H "Authorization: Bearer ${SEAM_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"full_name": "Jane Doe",
"phone_number": "+15555550100"
}'){
"user_identity": {
"user_identity_id": "43947360-cdc8-4db6-8b22-e079416d1d8b",
"full_name": "Jane Doe",
"phone_number": "+15555550100",
...
},
"ok": true
}// Create a user identity for your user.
const janeUser = await seam.userIdentities.create({
full_name: "Jane Doe",
phone_number: "+15555550100"
});{
"user_identity_id": "43947360-cdc8-4db6-8b22-e079416d1d8b",
"full_name": "Jane Doe",
"phone_number": "+15555550100",
...
}# Create a user identity for your user.
jane_user = seam.user_identities.create(
full_name: "Jane Doe",
phone_number: "+15555550100"
)<Seam::Resources::UserIdentity:0x005f0
user_identity_id="43947360-cdc8-4db6-8b22-e079416d1d8b"
full_name="Jane Doe"
phone_number="+15555550100"
...
>// Create a user identity for your user.
$jane_user = $seam->user_identities->create(
full_name: "Jane Doe",
phone_number: "+15555550100"
);{
"user_identity_id": "43947360-cdc8-4db6-8b22-e079416d1d8b",
"full_name": "Jane Doe",
"phone_number": "+15555550100",
...
}// Coming soon!// Coming soon!seam.access_grants.create(
# You can specify the ID of an existing user identity or
# use the user_identity parameter to create a new one.
user_identity_id=jane_user.user_identity_id,
# You can specify acs_entrance_ids, space_ids, or both.
acs_entrance_ids=[
"48ebfb50-c531-43c5-b9ea-409f26dabbd7",
"f74e4879-5991-4e2f-a368-888983dcfbfc"
],
requested_access_methods=[
{"mode": "mobile_key"}
],
starts_at="2025-07-13T15:00:00.000Z",
ends_at="2025-07-16T11:00:00.000Z"
)AccessGrant(
access_grant_id="ef83cca9-5fdf-4ac2-93f3-c21c5a8be54b",
display_name="My Access Grant",
user_identity_id="43947360-cdc8-4db6-8b22-e079416d1d8b",
starts_at="2025-07-13T15:00:00.000Z",
ends_at="2025-07-16T11:00:00.000Z",
instant_key_url="https://ik.seam.co/ABCXYZ",
...
)
# Share the instant_key_url with your user.# You can specify the ID of an existing user identity or
# use the user_identity parameter to create a new one.
# Also, you can specify acs_entrance_ids, space_ids, or both.
curl -X 'POST' \
'https://connect.getseam.com/access_methods/get' \
-H 'accept: application/json' \
-H "Authorization: Bearer ${SEAM_API_KEY}" \
-H 'Content-Type: application/json' \
-d "{
\"user_identity_id\": \"$(jq -r '.user_identity.user_identity_id' <<< ${jane_user})\"
\"acs_entrance_ids\": [
\"48ebfb50-c531-43c5-b9ea-409f26dabbd7\",
\"f74e4879-5991-4e2f-a368-888983dcfbfc\"
],
\"requested_access_methods\": [
{\"mode\": \"mobile_key\"}
],
\"starts_at\": \"2025-07-13T15:00:00.000Z\",
\"ends_at\": \"2025-07-16T11:00:00.000Z\"
}"{
"access_grant": {
"access_grant_id": "ef83cca9-5fdf-4ac2-93f3-c21c5a8be54b",
"display_name": "My Access Grant",
"user_identity_id": "43947360-cdc8-4db6-8b22-e079416d1d8b",
"starts_at": "2025-07-13T15:00:00.000Z",
"ends_at": "2025-07-16T11:00:00.000Z",
"instant_key_url": "https://ik.seam.co/ABCXYZ",
...
}
}
# Share the instant_key_url with your user.await seam.accessGrants.create({
// You can specify the ID of an existing user identity or
// use the user_identity parameter to create a new one.
user_identity_id: janeUser.user_identity_id,
// You can specify acs_entrance_ids, space_ids, or both.
acs_entrance_ids: [
"48ebfb50-c531-43c5-b9ea-409f26dabbd7",
"f74e4879-5991-4e2f-a368-888983dcfbfc"
],
requested_access_methods: [
{"mode": "mobile_key"}
],
starts_at: "2025-07-13T15:00:00.000Z",
ends_at: "2025-07-16T11:00:00.000Z"
});{
"access_grant_id": "ef83cca9-5fdf-4ac2-93f3-c21c5a8be54b",
"display_name": "My Access Grant",
"user_identity_id": "43947360-cdc8-4db6-8b22-e079416d1d8b",
"starts_at": "2025-07-13T15:00:00.000Z",
"ends_at": "2025-07-16T11:00:00.000Z",
"instant_key_url": "https://ik.seam.co/ABCXYZ",
...
}
// Share the instant_key_url with your user.seam.access_grants.create(
# You can specify the ID of an existing user identity or
# use the user_identity parameter to create a new one.
user_identity_id: jane_user.user_identity_id,
# You can specify acs_entrance_ids, space_ids, or both.
acs_entrance_ids: %w[48ebfb50-c531-43c5-b9ea-409f26dabbd7 f74e4879-5991-4e2f-a368-888983dcfbfc],
requested_access_methods: [
{"mode": "mobile_key"}
],
starts_at: "2025-07-13T15:00:00.000Z",
ends_at: "2025-07-16T11:00:00.000Z"
){
"access_grant_id" => "ef83cca9-5fdf-4ac2-93f3-c21c5a8be54b",
"display_name" => "My Access Grant",
"user_identity_id" => "43947360-cdc8-4db6-8b22-e079416d1d8b",
"starts_at" => "2025-07-13T15:00:00.000Z",
"ends_at" => "2025-07-16T11:00:00.000Z",
"instant_key_url" => "https://ik.seam.co/ABCXYZ",
...
}
# Share the instant_key_url with your user.$seam->access_grants->create(
// You can specify the ID of an existing user identity or
// use the user_identity parameter to create a new one.
user_identity_id: $jane_user->user_identity_id,
// You can specify acs_entrance_ids, space_ids, or both.
acs_entrance_ids: [
"48ebfb50-c531-43c5-b9ea-409f26dabbd7",
"f74e4879-5991-4e2f-a368-888983dcfbfc",
],
requested_access_methods: [
["mode" => "mobile_key"],
],
starts_at: "2025-07-13T15:00:00.000Z",
ends_at: "2025-07-16T11:00:00.000Z"
);[
"access_grant_id" => "ef83cca9-5fdf-4ac2-93f3-c21c5a8be54b",
"display_name" => "My Access Grant",
"user_identity_id" => "43947360-cdc8-4db6-8b22-e079416d1d8b",
"starts_at" => "2025-07-13T15:00:00.000Z",
"ends_at" => "2025-07-16T11:00:00.000Z",
"instant_key_url" => "https://ik.seam.co/ABCXYZ",
...
];
// Share the instant_key_url with your user.// Coming Soon!// Coming Soon!