Skip to main content
POST
/
access_grants
/
create
await seam.accessGrants.create({
  user_identity_id: "e3d736c1-540d-4d10-83e5-9a4e135453b4",
  device_ids: ["6ba7b811-9dad-11d1-80b4-00c04fd430c8"],
  requested_access_methods: [{ mode: "code" }],
  starts_at: "2025-06-16T16:54:17.946606Z",
  ends_at: "2025-06-18T16:54:17.946606Z",
});

/*
{
  "access_grant_id": "ef83cca9-5fdf-4ac2-93f3-c21c5a8be54b",
  "access_method_ids": [
    "a1b2c3d4-e5f6-4a3b-2c1d-0e9f8a7b6c5d"
  ],
  "created_at": "2025-06-16T16:54:17.946606Z",
  "display_name": "My Access Grant",
  "ends_at": "2025-06-18T16:54:17.946606Z",
  "requested_access_methods": [
    {
      "display_name": "PIN Code Credential",
      "mode": "code",
      "created_at": "2025-06-16T16:54:17.946606Z",
      "created_access_method_ids": [
        "a1b2c3d4-e5f6-4a3b-2c1d-0e9f8a7b6c5d"
      ]
    }
  ],
  "starts_at": "2025-06-16T16:54:17.946606Z",
  "user_identity_id": "e3d736c1-540d-4d10-83e5-9a4e135453b4",
  "workspace_id": "750fc0bc-4450-4356-8d9f-18c6a3a6b2c7"
}
*/
{
  "access_grant": {
    "access_grant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "access_method_ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "created_at": "2023-11-07T05:31:56Z",
    "display_name": "<string>",
    "ends_at": "2023-11-07T05:31:56Z",
    "errors": [
      {
        "created_at": "2023-11-07T05:31:56Z",
        "message": "<string>"
      }
    ],
    "location_ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "name": "<string>",
    "pending_mutations": [
      {
        "created_at": "2023-11-07T05:31:56Z",
        "from": {
          "device_ids": [
            "3c90c3cc-0d44-4b50-8888-8dd25736052a"
          ]
        },
        "message": "<string>",
        "to": {
          "device_ids": [
            "3c90c3cc-0d44-4b50-8888-8dd25736052a"
          ],
          "common_code_key": "<string>"
        }
      }
    ],
    "requested_access_methods": [
      {
        "created_access_method_ids": [
          "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        ],
        "created_at": "2023-11-07T05:31:56Z",
        "display_name": "<string>",
        "code": "<string>",
        "instant_key_max_use_count": 2
      }
    ],
    "space_ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "starts_at": "2023-11-07T05:31:56Z",
    "user_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "warnings": [
      {
        "error_code": "<string>",
        "message": "<string>",
        "created_at": "2023-11-07T05:31:56Z"
      }
    ],
    "workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "access_grant_key": "<string>",
    "client_session_token": "<string>",
    "customization_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "instant_key_url": "<string>",
    "reservation_key": "<string>"
  },
  "ok": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
user_identity_id
string<uuid>
required

ID of user identity for whom access is being granted.

requested_access_methods
object[]
required
access_grant_key
string

Unique key for the access grant within the workspace.

Minimum string length: 1
acs_entrance_ids
string<uuid>[]

Set of IDs of the entrances to which access is being granted.

customization_profile_id
string<uuid>

ID of the customization profile to apply to the Access Grant and its access methods.

device_ids
string<uuid>[]

Set of IDs of the devices to which access is being granted.

ends_at
string | null

Date and time at which the validity of the new grant ends, in ISO 8601 format. Must be a time in the future and after starts_at.

location
object

When used, creates a new location with the given entrances and devices, and gives the user access to this location.

location_ids
string<uuid>[]
deprecated
name
string | null

Name for the access grant.

reservation_key
string

Reservation key for the access grant.

space_ids
string<uuid>[]

Set of IDs of existing spaces to which access is being granted.

space_keys
string[]

Set of keys of existing spaces to which access is being granted.

Minimum string length: 1
starts_at
string

Date and time at which the validity of the new grant starts, in ISO 8601 format.

Response

OK

access_grant
object
required

Represents an Access Grant. Access Grants enable you to grant a user identity access to spaces, entrances, and devices through one or more access methods, such as mobile keys, plastic cards, and PIN codes. You can create an Access Grant for an existing user identity, or you can create a new user identity while creating the new Access Grant.

ok
boolean
required