List Access Passes
Retrieve a paginated list of Access Passes. Optionally provide a template_id to list passes for a specific card template, or omit it to list all passes across all templates in your account. You can also filter by current state and metadata.
template_id
nullable string
state
nullable string
metadata
nullable object
page
nullable integer
per_page
nullable integer
Request
# Build the JSON payload (server only verifies SIG against sig_payload;
# template_id is a filter and travels as an ordinary query param)
TEMPLATE_ID="0xd3adb00b5"
PAYLOAD="{}"
# Sign the payload
PAYLOAD_B64=$(printf '%s' "$PAYLOAD" | openssl base64 -A)
SIG=$(printf '%s' "$PAYLOAD_B64" | openssl dgst -sha256 -hmac "$SECRET_KEY" -hex | awk '{print $NF}')
# Send curl request
curl -v -G \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
--data-urlencode "template_id=$TEMPLATE_ID" \
--data-urlencode "sig_payload=$PAYLOAD" \
"https://api.accessgrid.com/v1/key-cards"
require('accessgrid')
acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid.new(acct_id, secret_key)
# Get filtered keys by template
keys = client.access_cards.list(template_id: "0xd3adb00b5")
# Get filtered keys by state
keys = client.access_cards.list(state: "active")
# Print keys
keys.each do |key|
puts "Key ID: #{key.id}, Name: #{key.full_name}, State: #{key.state}"
end
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const listKeys = async () => {
try {
// Get filtered keys by template
const templateKeys = await client.accessCards.list({ templateId: "0xd3adb00b5" });
// Get filtered keys by state
const activeKeys = await client.accessCards.list({ state: "active" });
// Print keys
allKeys.forEach(key => {
console.log(`Key ID: ${key.id}, Name: ${key.fullName}, State: ${key.state}`);
});
} catch (error) {
console.error('Error listing Access Passes:', error);
}
};
listKeys();
from accessgrid import AccessGrid
import os
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
# Get filtered keys by template
template_keys = client.access_cards.list(template_id="0xd3adb00b5")
# Get filtered keys by state
active_keys = client.access_cards.list(state="active")
# Print keys
for key in active_keys:
print(f"Key ID: {key.id}, Name: {key.full_name}, State: {key.state}")
package main
import (
"context"
"fmt"
"os"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
ctx := context.Background()
// Get filtered keys by template
templateFilter := accessgrid.ListKeysParams{
TemplateID: "0xd3adb00b5",
}
templateKeys, err := client.AccessCards.List(ctx, &templateFilter)
if err != nil {
fmt.Printf("Error listing cards: %v\n", err)
return
}
// Get filtered keys by state
stateFilter := accessgrid.ListKeysParams{
State: "active",
}
activeKeys, err := client.AccessCards.List(ctx, &stateFilter)
if err != nil {
fmt.Printf("Error listing cards: %v\n", err)
return
}
// Print keys
for _, key := range templateKeys {
fmt.Printf("Key ID: %s, Name: %s, State: %s\n", key.ID, key.FullName, key.State)
}
}
using AccessGrid;
using System;
using System.Threading.Tasks;
public async Task ListCardsAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
var client = new AccessGridClient(accountId, secretKey);
// Get filtered keys by template
var templateKeys = await client.AccessCards.ListAsync(new ListKeysRequest
{
TemplateId = "0xd3adb00b5"
});
// Get filtered keys by state
var activeKeys = await client.AccessCards.ListAsync(new ListKeysRequest
{
State = "active"
});
// Print keys
foreach (var key in allKeys)
{
Console.WriteLine($"Key ID: {key.Id}, Name: {key.FullName}, State: {key.State}");
}
}
public class ListKeysRequest
{
public string TemplateId { get; set; }
public string State { get; set; }
}
import com.organization.accessgrid.AccessGridClient;
import com.organization.accessgrid.model.Card;
import com.organization.accessgrid.model.ListKeysParams;
import java.util.List;
public class AccessCardService {
private final AccessGridClient client;
public AccessCardService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void listCards() throws AccessGridException {
// Get filtered keys by template
ListKeysParams templateFilter = ListKeysParams.builder()
.templateId("0xd3adb00b5")
.build();
List<Card> templateKeys = client.accessCards().list(templateFilter);
// Get filtered keys by state
ListKeysParams stateFilter = ListKeysParams.builder()
.state("active")
.build();
List<Card> activeKeys = client.accessCards().list(stateFilter);
// Print keys
for (Card key : allKeys) {
System.out.printf("Key ID: %s, Name: %s, State: %s%n",
key.getId(),
key.getFullName(),
key.getState());
}
}
}
{:ok, client} = AccessGrid.new(
System.get_env("ACCOUNT_ID"),
System.get_env("SECRET_KEY")
)
# Get filtered keys by template
{:ok, keys} = AccessGrid.AccessCards.list(client,
template_id: "0xd3adb00b5"
)
# Get filtered keys by state
{:ok, active_keys} = AccessGrid.AccessCards.list(client, state: "active")
# Print keys
Enum.each(keys, fn key ->
IO.puts("Key ID: #{key.id}, Name: #{key.full_name}, State: #{key.state}")
end)
Response
{
"status": "success",
"count": 2,
"total_count": 2,
"page": 1,
"per_page": 20,
"total_pages": 1,
"keys": [
{
"id": "key_9f3a12bc",
"full_name": "John Doe",
"employee_id": "EMP-10234",
"state": "active",
"install_url": "https://install.accessgrid.io/pass/key_9f3a12bc",
"card_template_id": "0xd3adb00b5",
"expiration_date": "2026-03-31T23:59:59Z",
"created_at": "2025-01-15T10:22:11Z",
"metadata": {
"department": "Engineering",
"location": "HQ"
},
"card_number": "4920-8833-1122",
"site_code": "NYC-HQ",
"direct_install_url": "https://pay.google.com/gp/v/save/abcdef123456"
},
{
"id": "key_b81d77ef",
"full_name": "Jane Smith",
"employee_id": "EMP-10891",
"state": "inactive",
"install_url": "https://install.accessgrid.io/pass/key_b81d77ef",
"card_template_id": "0xhotel98765",
"expiration_date": "2025-12-31T23:59:59Z",
"created_at": "2024-11-03T08:45:00Z",
"metadata": {
"department": "Operations",
"role": "Manager"
},
"file_data": {
"file_name": "hotel_pass.pkpass",
"file_size": 24576
},
"is_pass_ready_to_transact": true
}
]
}
Issue Access Pass
Create a pass that can be installed on a mobile device, using the constraints set in the AccessGrid console and this API call. Returns a landing page for installing the access pass.
You can issue in one of two ways:
- Direct template — pass a single card template id to issue a pass on one platform (Apple or Google).
- Template pair — pass a card template pair id to issue both the Apple and Android passes in a single call using the same attributes.
card_template_id
string
employee_id
string
tag_id
nullable string
site_code
nullable string
card_number
nullable string
file_data
nullable string
full_name
string
nullable string
phone_number
nullable string
classification
nullable string
department
nullable string
location
nullable string
site_name
nullable string
workstation
nullable string
mail_stop
nullable string
company_address
nullable string
start_date
string
temporary
boolean
expiration_date
string
employee_photo
string
title
nullable string
member_id
nullable string
membership_status
nullable string
is_pass_ready_to_transact
nullable boolean
tile_data
nullable object
checkInAvailableWindowStartDateTime
nullable string
ISO8601 timestamp with timezone. Required if isCheckedIn is missing or false
checkInAvailableWindowEndDateTime
nullable string
ISO8601 timestamp with timezone. Required if isCheckedIn is missing or false
checkInDateTime
nullable string
ISO8601 timestamp with timezone. Required if isCheckedIn is true
checkInURL
nullable string
URL for remote check-in. Only used if isCheckedIn is missing or false
isCheckedIn
nullable boolean
Whether the guest has checked in
numberOfRoomsReserved
nullable integer
Number of rooms reserved. Must match the number of roomNumbers if both are present
roomNumbers
nullable array
Array of room numbers. Must match the number of numberOfRoomsReserved if both are present
reservations
nullable object
checkInDateTime
nullable string
ISO8601 timestamp with timezone. Required if isCheckedIn is true
isCheckedIn
nullable boolean
Whether the guest has checked in
numberOfRoomsReserved
nullable integer
Number of rooms reserved. Must match the number of roomNumbers if both are present
propertyLocation
nullable string
Location of the property (e.g., 'Key West')
propertyName
nullable string
Name of the property (e.g., 'Hyatt Centric Resort & Spa')
propertyMapUrl
nullable string
URL to a map of the property
propertyCategory
nullable string
Category of the property. If provided, must be 'travel'
restaurantVoucher
nullable string
Optional voucher for restaurant services
reservationEndDateTime
nullable string
ISO8601 timestamp with timezone for reservation end
reservationNumber
nullable string
Confirmation number for the reservation
reservationStartDateTime
nullable string
ISO8601 timestamp with timezone for reservation start
roomNumbers
nullable array
Array of room numbers. Must match the number of numberOfRoomsReserved if both are present
property_name
nullable string
property_address
nullable string
building_name
nullable string
unit_numbers
nullable array
storage_unit
nullable string
parking_address
nullable string
parking_details
nullable array
label
string
Parking label. Must be one of Apple's allowed values (see above).
value
string
Parking value (e.g., the garage or spot identifier).
barcode_data
nullable string
metadata
nullable object
credential_pool_id
nullable string
credential_profiles
nullable array
system_id
nullable string
qr_code_text
nullable string
top_right_label
nullable string
top_right_value
nullable string
secondary_field_left_label
nullable string
secondary_field_left_value
nullable string
secondary_field_middle_label
nullable string
secondary_field_middle_value
nullable string
secondary_field_right_label
nullable string
secondary_field_right_value
nullable string
Request
# Issue an NFC access pass (corporate_id template)
PAYLOAD=$(cat <<EOF
{
"card_template_id": "0xd3adb00b5",
"employee_id": "123456789",
"tag_id": "DDEADB33FB00B5",
"full_name": "Employee name",
"email": "[email protected]",
"phone_number": "+19547212241",
"classification": "full_time",
"department": "Engineering",
"location": "San Francisco",
"site_name": "HQ Building A",
"workstation": "4F-207",
"mail_stop": "MS-401",
"company_address": "123 Main St, San Francisco, CA 94105",
"start_date": "$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")",
"expiration_date": "$(date -u -v+3m +"%Y-%m-%dT%H:%M:%S.%3NZ")",
"employee_photo": "[image_in_base64_encoded_format]",
"title": "Engineering Manager"
}
EOF)
# Sign the payload
PAYLOAD_B64=$(printf '%s' "$PAYLOAD" | openssl base64 -A)
SIG=$(printf '%s' "$PAYLOAD_B64" | openssl dgst -sha256 -hmac "$SECRET_KEY" -hex | awk '{print $NF}')
curl -v \
-X POST \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
"https://api.accessgrid.com/v1/key-cards"
require('accessgrid')
acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid.new(acct_id, secret_key)
# NFC access pass (corporate_id template)
card = client.access_cards.provision(
card_template_id: "0xd3adb00b5",
employee_id: "123456789",
tag_id: "DDEADB33FB00B5",
full_name: "Employee name",
email: "[email protected]",
phone_number: "+19547212241",
classification: "full_time",
department: "Engineering",
location: "San Francisco",
site_name: "HQ Building A",
workstation: "4F-207",
mail_stop: "MS-401",
company_address: "123 Main St, San Francisco, CA 94105",
start_date: Time.zone.now.utc.iso8601(3),
expiration_date: 3.months.from_now.utc.iso8601(3),
employee_photo: "[image_in_base64_encoded_format]",
title: "Engineering Manager",
metadata: {
"department": "engineering",
"badge_type": "contractor"
}
)
puts "Install URL: #{card.url}"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const provision = async () => {
try {
const card = await client.accessCards.provision({
cardTemplateId: "0xd3adb00b5",
employeeId: "123456789",
tagId: "DDEADB33FB00B5",
allowOnMultipleDevices: true,
fullName: "Employee name",
email: "[email protected]",
phoneNumber: "+19547212241",
classification: "full_time",
department: "Engineering",
location: "San Francisco",
siteName: "HQ Building A",
workstation: "4F-207",
mailStop: "MS-401",
companyAddress: "123 Main St, San Francisco, CA 94105",
startDate: new Date().toISOString(),
expirationDate: new Date(Date.now() + 90 * 24 * 60 * 60 * 1000).toISOString(),
employeePhoto: "[image_in_base64_encoded_format]",
title: "Engineering Manager",
metadata: {
department: "engineering",
badgeType: "contractor"
}
});
console.log(`Install URL: ${card.url}`);
} catch (error) {
console.error('Error provisioning Access Pass:', error);
}
};
provision();
from accessgrid import AccessGrid
import os
from datetime import datetime, timezone
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
card = client.access_cards.provision(
card_template_id="0xd3adb00b5",
employee_id="123456789",
tag_id="DDEADB33FB00B5",
full_name="Employee name",
email="[email protected]",
phone_number="+19547212241",
classification="full_time",
department="Engineering",
location="San Francisco",
site_name="HQ Building A",
workstation="4F-207",
mail_stop="MS-401",
company_address="123 Main St, San Francisco, CA 94105",
start_date=datetime.now(timezone.utc).isoformat(timespec='milliseconds'),
expiration_date="2026-04-01T00:00:00.000Z",
employee_photo="[image_in_base64_encoded_format]",
title="Engineering Manager",
metadata={
"department": "engineering",
"badge_type": "contractor"
}
)
print(f"Install URL: {card.url}")
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
params := accessgrid.ProvisionParams{
CardTemplateID: "0xd3adb00b5",
EmployeeID: "123456789",
TagID: "DDEADB33FB00B5",
AllowOnMultipleDevices: true,
FullName: "Employee name",
Email: "[email protected]",
PhoneNumber: "+19547212241",
Classification: "full_time",
Department: "Engineering",
Location: "San Francisco",
SiteName: "HQ Building A",
Workstation: "4F-207",
MailStop: "MS-401",
CompanyAddress: "123 Main St, San Francisco, CA 94105",
StartDate: time.Now().UTC(),
ExpirationDate: time.Now().UTC().AddDate(0, 3, 0),
EmployeePhoto: "[image_in_base64_encoded_format]",
Title: "Engineering Manager",
Metadata: map[string]interface{}{
"department": "engineering",
"badge_type": "contractor",
},
}
ctx := context.Background()
card, err := client.AccessCards.Provision(ctx, params)
if err != nil {
fmt.Printf("Error provisioning card: %v\n", err)
return
}
fmt.Printf("Install URL: %s\n", card.URL)
}
using AccessGrid;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
public async Task ProvisionCardAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
using var client = new AccessGridClient(accountId, secretKey);
var card = await client.AccessCards.ProvisionAsync(new ProvisionCardRequest
{
CardTemplateId = "0xd3adb00b5",
EmployeeId = "123456789",
TagId = "DDEADB33FB00B5",
FullName = "Employee name",
Email = "[email protected]",
PhoneNumber = "+19547212241",
Classification = "full_time",
Department = "Engineering",
Location = "San Francisco",
SiteName = "HQ Building A",
Workstation = "4F-207",
MailStop = "MS-401",
CompanyAddress = "123 Main St, San Francisco, CA 94105",
StartDate = DateTime.UtcNow,
ExpirationDate = DateTime.UtcNow.AddMonths(3),
EmployeePhoto = "[image_in_base64_encoded_format]",
Title = "Engineering Manager",
Metadata = new Dictionary<string, object>
{
["department"] = "engineering",
["badge_type"] = "contractor"
}
});
Console.WriteLine($"Install URL: {card.Url}");
}
import com.organization.accessgrid.AccessGridClient;
import com.organization.accessgrid.model.ProvisionCardRequest;
import com.organization.accessgrid.model.Card;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
public class AccessCardService {
private final AccessGridClient client;
public AccessCardService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public Card provisionCard() throws AccessGridException {
ProvisionCardRequest request = ProvisionCardRequest.builder()
.cardTemplateId("0xd3adb00b5")
.employeeId("123456789")
.tagId("DDEADB33FB00B5")
.allowOnMultipleDevices(true)
.fullName("Employee name")
.email("[email protected]")
.phoneNumber("+19547212241")
.classification("full_time")
.department("Engineering")
.location("San Francisco")
.siteName("HQ Building A")
.workstation("4F-207")
.mailStop("MS-401")
.companyAddress("123 Main St, San Francisco, CA 94105")
.startDate(ZonedDateTime.now().format(DateTimeFormatter.ISO_INSTANT))
.expirationDate("2026-04-01T00:00:00.000Z")
.employeePhoto("[image_in_base64_encoded_format]")
.title("Engineering Manager")
.metadata(Map.of(
"department", "engineering",
"badge_type", "contractor"
))
.build();
Card card = client.accessCards().provision(request);
System.out.printf("Install URL: %s%n", card.getUrl());
return card;
}
}
@Getter
@Builder
public class ProvisionCardRequest {
private final String cardTemplateId;
private final String employeeId;
private final String tagId;
private final boolean allowOnMultipleDevices;
private final String fullName;
private final String email;
private final String phoneNumber;
private final String classification;
private final String startDate;
private final String expirationDate;
private final String employeePhoto;
private final String title;
}
@Getter
public class Card {
private final String url;
}
public class Example {
public static void main(String[] args) {
try {
AccessCardService service = new AccessCardService();
Card card = service.provisionCard();
} catch (AccessGridException e) {
System.err.println("Error provisioning card: " + e.getMessage());
}
}
}
<?php
require 'vendor/autoload.php';
use AccessGridClient;
$accountId = $_ENV['ACCOUNT_ID'];
$secretKey = $_ENV['SECRET_KEY'];
$client = new Client($accountId, $secretKey);
$card = $client->accessCards->provision([
'card_template_id' => '0xd3adb00b5',
'employee_id' => '123456789',
'tag_id' => 'DDEADB33FB00B5',
'full_name' => 'Employee name',
'email' => '[email protected]',
'phone_number' => '+19547212241',
'classification' => 'full_time',
'department' => 'Engineering',
'location' => 'San Francisco',
'site_name' => 'HQ Building A',
'workstation' => '4F-207',
'mail_stop' => 'MS-401',
'company_address' => '123 Main St, San Francisco, CA 94105',
'start_date' => (new DateTime('now', new DateTimeZone('UTC')))->format('c'),
'expiration_date' => '2026-04-01T00:00:00.000Z',
'employee_photo' => '[image_in_base64_encoded_format]',
'title' => 'Engineering Manager',
'metadata' => [
'department' => 'engineering',
'badge_type' => 'contractor'
]
]);
echo "Install URL: {$card->url}\n";
{:ok, client} = AccessGrid.new(
System.get_env("ACCOUNT_ID"),
System.get_env("SECRET_KEY")
)
# NFC access pass (corporate_id template)
{:ok, card} = AccessGrid.AccessCards.provision(client,
card_template_id: "0xd3adb00b5",
employee_id: "123456789",
tag_id: "DDEADB33FB00B5",
full_name: "Employee name",
email: "[email protected]",
phone_number: "+19547212241",
classification: "full_time",
department: "Engineering",
location: "San Francisco",
site_name: "HQ Building A",
workstation: "4F-207",
mail_stop: "MS-401",
company_address: "123 Main St, San Francisco, CA 94105",
start_date: DateTime.utc_now() |> DateTime.to_iso8601(),
expiration_date: DateTime.utc_now() |> DateTime.add(90, :day) |> DateTime.to_iso8601(),
employee_photo: "[image_in_base64_encoded_format]",
title: "Engineering Manager",
metadata: %{
"department" => "engineering",
"badge_type" => "contractor"
}
)
IO.puts("Install URL: #{card.url}")
Response
{
"status": "success",
"install_url": "https://install.accessgrid.io/pass/key_a91c7e23",
"id": "key_a91c7e23",
"state": "active",
"temporary": false,
"full_name": "Employee name",
"expiration_date": "2026-03-29T15:34:40.072Z",
"metadata": {
"department": "engineering",
"badgeType": "contractor"
},
"card_number": "8472-1093-5561",
"site_code": "ENG-HQ-01",
"file_data": null
}
Get Issued Pass
Retrieve details about a specific issued Access Pass, including its state, devices, and metadata
card_id
string
Request
# Build the JSON payload
PAYLOAD='{"card_id":"0xc4rd1d"}'
# Sign the payload
PAYLOAD_B64=$(printf '%s' "$PAYLOAD" | openssl base64 -A)
SIG=$(printf '%s' "$PAYLOAD_B64" | openssl dgst -sha256 -hmac "$SECRET_KEY" -hex | awk '{print $NF}')
# Send curl request
curl -v -G \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
--data-urlencode "sig_payload=$PAYLOAD" \
"https://api.accessgrid.com/v1/key-cards/0xc4rd1d"
require 'accessgrid'
acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid.new(acct_id, secret_key)
card = client.access_cards.get(card_id: "0xc4rd1d")
puts "Card ID: #{card.id}"
puts "State: #{card.state}"
puts "Full Name: #{card.full_name}"
puts "Install URL: #{card.install_url}"
puts "Expiration Date: #{card.expiration_date}"
puts "Card Number: #{card.card_number}"
puts "Site Code: #{card.site_code}"
puts "Devices: #{card.devices.length}"
puts "Metadata: #{card.metadata}"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const getCard = async () => {
try {
const card = await client.accessCards.get({
cardId: "0xc4rd1d"
});
console.log('Card ID:', card.id);
console.log('State:', card.state);
console.log('Full Name:', card.fullName);
console.log('Install URL:', card.installUrl);
console.log('Expiration Date:', card.expirationDate);
console.log('Card Number:', card.cardNumber);
console.log('Site Code:', card.siteCode);
console.log('Devices:', card.devices);
console.log('Metadata:', card.metadata);
} catch (error) {
console.error('Error retrieving Access Pass:', error);
}
};
getCard();
from accessgrid import AccessGrid
import os
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
card = client.access_cards.get(card_id="0xc4rd1d")
print(f"Card ID: {card.id}")
print(f"State: {card.state}")
print(f"Full Name: {card.full_name}")
print(f"Install URL: {card.install_url}")
print(f"Expiration Date: {card.expiration_date}")
print(f"Card Number: {card.card_number}")
print(f"Site Code: {card.site_code}")
print(f"Devices: {len(card.devices)}")
print(f"Metadata: {card.metadata}")
package main
import (
"context"
"fmt"
"os"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
ctx := context.Background()
card, err := client.AccessCards.Get(ctx, "0xc4rd1d")
if err != nil {
fmt.Printf("Error retrieving card: %v\n", err)
return
}
fmt.Printf("Card ID: %s\n", card.ID)
fmt.Printf("State: %s\n", card.State)
fmt.Printf("Full Name: %s\n", card.FullName)
fmt.Printf("Install URL: %s\n", card.InstallURL)
fmt.Printf("Expiration Date: %s\n", card.ExpirationDate)
fmt.Printf("Card Number: %s\n", card.CardNumber)
fmt.Printf("Site Code: %s\n", card.SiteCode)
fmt.Printf("Devices: %d\n", len(card.Devices))
fmt.Printf("Metadata: %v\n", card.Metadata)
}
using AccessGrid;
using System;
using System.Threading.Tasks;
public async Task GetCardAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
using var client = new AccessGridClient(accountId, secretKey);
var card = await client.AccessCards.GetAsync("0xc4rd1d");
Console.WriteLine($"Card ID: {card.Id}");
Console.WriteLine($"State: {card.State}");
Console.WriteLine($"Full Name: {card.FullName}");
Console.WriteLine($"Install URL: {card.Url}");
Console.WriteLine($"Expiration Date: {card.ExpirationDate}");
Console.WriteLine($"Card Number: {card.CardNumber}");
Console.WriteLine($"Site Code: {card.SiteCode}");
Console.WriteLine($"Devices: {card.Devices.Count}");
Console.WriteLine($"Metadata: {card.Metadata}");
}
import com.organization.accessgrid.AccessGridClient;
import com.organization.accessgrid.model.Card;
public class AccessCardService {
private final AccessGridClient client;
public AccessCardService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void getCard() throws AccessGridException {
Card card = client.accessCards().get("0xc4rd1d");
System.out.println("Card ID: " + card.getId());
System.out.println("State: " + card.getState());
System.out.println("Full Name: " + card.getFullName());
System.out.println("Install URL: " + card.getInstallUrl());
System.out.println("Expiration Date: " + card.getExpirationDate());
System.out.println("Card Number: " + card.getCardNumber());
System.out.println("Site Code: " + card.getSiteCode());
System.out.println("Devices: " + card.getDevices().size());
System.out.println("Metadata: " + card.getMetadata());
}
}
<?php
require 'vendor/autoload.php';
use AccessGridClient;
$accountId = $_ENV['ACCOUNT_ID'];
$secretKey = $_ENV['SECRET_KEY'];
$client = new Client($accountId, $secretKey);
$card = $client->accessCards->get('0xc4rd1d');
echo "Card ID: {$card->id}\n";
echo "State: {$card->state}\n";
echo "Full Name: {$card->full_name}\n";
echo "Install URL: {$card->install_url}\n";
echo "Expiration Date: {$card->expiration_date}\n";
echo "Card Number: {$card->card_number}\n";
echo "Site Code: {$card->site_code}\n";
echo "Devices: " . count($card->devices) . "\n";
echo "Metadata: " . json_encode($card->metadata) . "\n";
{:ok, client} = AccessGrid.new(
System.get_env("ACCOUNT_ID"),
System.get_env("SECRET_KEY")
)
{:ok, card} = AccessGrid.AccessCards.get(client, card_id: "0xc4rd1d")
IO.puts("Card ID: #{card.id}")
IO.puts("State: #{card.state}")
IO.puts("Full Name: #{card.full_name}")
IO.puts("Install URL: #{card.install_url}")
IO.puts("Expiration Date: #{card.expiration_date}")
IO.puts("Card Number: #{card.card_number}")
IO.puts("Site Code: #{card.site_code}")
IO.puts("Devices: #{length(card.devices)}")
IO.puts("Metadata: #{inspect(card.metadata)}")
Response
{
"status": "success",
"install_url": "https://install.accessgrid.io/pass/key_a91c7e23",
"id": "key_a91c7e23",
"state": "active",
"temporary": false,
"full_name": "Employee name",
"expiration_date": "2026-03-29T15:34:40.072Z",
"metadata": {
"department": "engineering",
"badgeType": "contractor"
},
"card_number": "8472-1093-5561",
"site_code": "ENG-HQ-01",
"file_data": {
"file_name": "access_pass.pkpass",
"file_size": 31245,
"content_type": "application/vnd.apple.pkpass"
},
"devices": [
{
"id": "dev_7f3b2a9c",
"platform": "apple",
"device_type": "iphone",
"status": "active"
},
{
"id": "dev_c91d88aa",
"platform": "android",
"device_type": "phone",
"status": "pending_install"
}
]
}
Update Access Pass
When you need to make an informational update to an Access Pass such as name, photo, etc. Use update_type to control whether only metadata is updated or whether credential payload is also reprovisioned on the device.
card_id
string
update_type
nullable string
employee_id
nullable string
full_name
nullable string
classification
nullable string
department
nullable string
location
nullable string
site_name
nullable string
workstation
nullable string
mail_stop
nullable string
company_address
nullable string
expiration_date
nullable string
employee_photo
nullable string
title
nullable string
property_name
nullable string
property_address
nullable string
building_name
nullable string
unit_numbers
nullable array
storage_unit
nullable string
parking_address
nullable string
parking_details
nullable array
label
string
Parking label. Must be one of Apple's allowed values (see above).
value
string
Parking value (e.g., the garage or spot identifier).
barcode_data
nullable string
file_data
nullable string
is_pass_ready_to_transact
nullable boolean
tile_data
nullable object
checkInAvailableWindowStartDateTime
nullable string
ISO8601 timestamp with timezone. Required if isCheckedIn is missing or false
checkInAvailableWindowEndDateTime
nullable string
ISO8601 timestamp with timezone. Required if isCheckedIn is missing or false
checkInDateTime
nullable string
ISO8601 timestamp with timezone. Required if isCheckedIn is true
checkInURL
nullable string
URL for remote check-in. Only used if isCheckedIn is missing or false
isCheckedIn
nullable boolean
Whether the guest has checked in
numberOfRoomsReserved
nullable integer
Number of rooms reserved. Must match the number of roomNumbers if both are present
roomNumbers
nullable array
Array of room numbers. Must match the number of numberOfRoomsReserved if both are present
reservations
nullable object
checkInDateTime
nullable string
ISO8601 timestamp with timezone. Required if isCheckedIn is true
isCheckedIn
nullable boolean
Whether the guest has checked in
numberOfRoomsReserved
nullable integer
Number of rooms reserved. Must match the number of roomNumbers if both are present
propertyLocation
nullable string
Location of the property (e.g., 'Key West')
propertyName
nullable string
Name of the property (e.g., 'Hyatt Centric Resort & Spa')
propertyMapUrl
nullable string
URL to a map of the property
propertyCategory
nullable string
Category of the property. If provided, must be 'travel'
restaurantVoucher
nullable string
Optional voucher for restaurant services
reservationEndDateTime
nullable string
ISO8601 timestamp with timezone for reservation end
reservationNumber
nullable string
Confirmation number for the reservation
reservationStartDateTime
nullable string
ISO8601 timestamp with timezone for reservation start
roomNumbers
nullable array
Array of room numbers. Must match the number of numberOfRoomsReserved if both are present
qr_code_text
nullable string
top_right_label
nullable string
top_right_value
nullable string
secondary_field_left_label
nullable string
secondary_field_left_value
nullable string
secondary_field_middle_label
nullable string
secondary_field_middle_value
nullable string
secondary_field_right_label
nullable string
secondary_field_right_value
nullable string
metadata
nullable object
Request
# Build the JSON payload
PAYLOAD=$(cat <<EOF
{
"card_id": "0xc4rd1d",
"employee_id": "987654321",
"full_name": "Updated Employee Name",
"classification": "contractor",
"department": "Marketing",
"location": "New York",
"site_name": "NYC Office",
"workstation": "2F-105",
"mail_stop": "MS-200",
"company_address": "456 Broadway, New York, NY 10013",
"expiration_date": "2025-02-22T21:04:03.664Z",
"title": "Senior Developer"
}
EOF)
# Sign the payload
PAYLOAD_B64=$(printf '%s' "$PAYLOAD" | openssl base64 -A)
SIG=$(printf '%s' "$PAYLOAD_B64" | openssl dgst -sha256 -hmac "$SECRET_KEY" -hex | awk '{print $NF}')
curl -v \
-X PATCH \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
"https://api.accessgrid.com/v1/key-cards/{card_id}"
require 'accessgrid'
acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid.new(acct_id, secret_key)
card = client.access_cards.update(
card_id: "0xc4rd1d",
employee_id: "987654321",
full_name: "Updated Employee Name",
classification: "contractor",
department: "Marketing",
location: "New York",
site_name: "NYC Office",
workstation: "2F-105",
mail_stop: "MS-200",
company_address: "456 Broadway, New York, NY 10013",
expiration_date: 3.months.from_now.utc.iso8601(3),
employee_photo: "[image_in_base64_encoded_format]",
title: "Senior Developer"
)
puts "Card updated successfully"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const update = async () => {
try {
const card = await client.accessCards.update({
cardId: "0xc4rd1d",
employeeId: "987654321",
fullName: "Updated Employee Name",
classification: "contractor",
department: "Marketing",
location: "New York",
siteName: "NYC Office",
workstation: "2F-105",
mailStop: "MS-200",
companyAddress: "456 Broadway, New York, NY 10013",
expirationDate: "2025-02-22T21:04:03.664Z",
employeePhoto: "[image_in_base64_encoded_format]",
title: "Senior Developer"
});
console.log('Card updated successfully');
} catch (error) {
console.error('Error updating Access Pass:', error);
}
};
update();
from accessgrid import AccessGrid
import os
from datetime import datetime, timezone, timedelta
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
card = client.access_cards.update(
card_id="0xc4rd1d",
employee_id="987654321",
full_name="Updated Employee Name",
classification="contractor",
department="Marketing",
location="New York",
site_name="NYC Office",
workstation="2F-105",
mail_stop="MS-200",
company_address="456 Broadway, New York, NY 10013",
expiration_date=(datetime.now(timezone.utc) + timedelta(days=90)).isoformat(),
employee_photo="[image_in_base64_encoded_format]",
title="Senior Developer"
)
print("Card updated successfully")
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
expDate := time.Now().UTC().AddDate(0, 3, 0)
params := accessgrid.UpdateParams{
CardID: "0xc4rd1d",
EmployeeID: "987654321",
FullName: "Updated Employee Name",
Classification: "contractor",
Department: "Marketing",
Location: "New York",
SiteName: "NYC Office",
Workstation: "2F-105",
MailStop: "MS-200",
CompanyAddress: "456 Broadway, New York, NY 10013",
ExpirationDate: &expDate,
EmployeePhoto: "[image_in_base64_encoded_format]",
Title: "Senior Developer",
}
ctx := context.Background()
card, err := client.AccessCards.Update(ctx, params)
if err != nil {
fmt.Printf("Error updating card: %v\n", err)
return
}
fmt.Println("Card updated successfully")
}
using AccessGrid;
using System;
using System.Threading.Tasks;
public async Task UpdateCardAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
using var client = new AccessGridClient(accountId, secretKey);
await client.AccessCards.UpdateAsync("0xc4rd1d", new UpdateCardRequest
{
EmployeeId = "987654321",
FullName = "Updated Employee Name",
Classification = "contractor",
Department = "Marketing",
Location = "New York",
SiteName = "NYC Office",
Workstation = "2F-105",
MailStop = "MS-200",
CompanyAddress = "456 Broadway, New York, NY 10013",
ExpirationDate = DateTime.UtcNow.AddMonths(3),
EmployeePhoto = "[image_in_base64_encoded_format]",
Title = "Senior Developer"
});
Console.WriteLine("Card updated successfully");
}
import com.organization.accessgrid.AccessGridClient;
import com.organization.accessgrid.model.UpdateCardRequest;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
public class AccessCardService {
private final AccessGridClient client;
public AccessCardService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void updateCard() throws AccessGridException {
UpdateCardRequest request = UpdateCardRequest.builder()
.cardId("0xc4rd1d")
.employeeId("987654321")
.fullName("Updated Employee Name")
.classification("contractor")
.department("Marketing")
.location("New York")
.siteName("NYC Office")
.workstation("2F-105")
.mailStop("MS-200")
.companyAddress("456 Broadway, New York, NY 10013")
.expirationDate(ZonedDateTime.now().plusMonths(3).format(DateTimeFormatter.ISO_INSTANT))
.employeePhoto("[image_in_base64_encoded_format]")
.title("Senior Developer")
.build();
client.accessCards().update(request);
System.out.println("Card updated successfully");
}
}
<?php
require 'vendor/autoload.php';
use AccessGridClient;
$accountId = $_ENV['ACCOUNT_ID'];
$secretKey = $_ENV['SECRET_KEY'];
$client = new Client($accountId, $secretKey);
$card = $client->accessCards->update([
'card_id' => '0xc4rd1d',
'employee_id' => '987654321',
'full_name' => 'Updated Employee Name',
'classification' => 'contractor',
'department' => 'Marketing',
'location' => 'New York',
'site_name' => 'NYC Office',
'workstation' => '2F-105',
'mail_stop' => 'MS-200',
'company_address' => '456 Broadway, New York, NY 10013',
'expiration_date' => (new DateTime('now', new DateTimeZone('UTC')))->modify('+3 months')->format('c'),
'employee_photo' => '[image_in_base64_encoded_format]',
'title' => 'Senior Developer'
]);
echo "Card updated successfully\n";
{:ok, client} = AccessGrid.new(
System.get_env("ACCOUNT_ID"),
System.get_env("SECRET_KEY")
)
{:ok, card} = AccessGrid.AccessCards.update(client,
card_id: "0xc4rd1d",
employee_id: "987654321",
full_name: "Updated Employee Name",
classification: "contractor",
department: "Marketing",
location: "New York",
site_name: "NYC Office",
workstation: "2F-105",
mail_stop: "MS-200",
company_address: "456 Broadway, New York, NY 10013",
expiration_date: DateTime.utc_now() |> DateTime.add(90, :day) |> DateTime.to_iso8601(),
employee_photo: "[image_in_base64_encoded_format]",
title: "Senior Developer"
)
IO.puts("Card updated successfully")
Response
{
"status": "success",
"install_url": "https://install.accessgrid.io/pass/key_a91c7e23",
"id": "key_a91c7e23",
"state": "active",
"temporary": false,
"full_name": "Updated Employee Name",
"expiration_date": "2026-06-15T23:59:59Z",
"metadata": {
"department": "engineering",
"badgeType": "contractor"
},
"card_number": "8472-1093-5561",
"site_code": "ENG-HQ-01",
"file_data": null
}
Suspend Access Pass
When you need to temporarily disable an Access Pass for a short period of time
card_id
string
Request
# Build the JSON payload
PAYLOAD='{"card_id":"0xc4rd1d"}'
# Sign the payload
PAYLOAD_B64=$(printf '%s' "$PAYLOAD" | openssl base64 -A)
SIG=$(printf '%s' "$PAYLOAD_B64" | openssl dgst -sha256 -hmac "$SECRET_KEY" -hex | awk '{print $NF}')
curl -v \
-X POST \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
"https://api.accessgrid.com/v1/key-cards/{card_id}/suspend"
require 'accessgrid'
acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid.new(acct_id, secret_key)
card = client.access_cards.suspend(
card_id: "0xc4rd1d"
)
puts "Card suspended successfully"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const suspend = async () => {
try {
await client.accessCards.suspend({
cardId: "0xc4rd1d"
});
console.log('Card suspended successfully');
} catch (error) {
console.error('Error suspending Access Pass:', error);
}
};
suspend();
from accessgrid import AccessGrid
import os
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
card = client.access_cards.suspend(
card_id="0xc4rd1d"
)
print("Card suspended successfully")
package main
import (
"context"
"fmt"
"os"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
ctx := context.Background()
err = client.AccessCards.Suspend(ctx, "0xc4rd1d")
if err != nil {
fmt.Printf("Error suspending card: %v\n", err)
return
}
fmt.Println("Card suspended successfully")
}
using AccessGrid;
public async Task SuspendCardAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
var client = new AccessGridClient(accountId, secretKey);
await client.AccessCards.SuspendAsync("0xc4rd1d");
Console.WriteLine("Card suspended successfully");
}
import com.organization.accessgrid.AccessGridClient;
public class AccessCardService {
private final AccessGridClient client;
public AccessCardService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void suspendCard() throws AccessGridException {
client.accessCards().suspend("0xc4rd1d");
System.out.println("Card suspended successfully");
}
}
<?php
require 'vendor/autoload.php';
use AccessGridClient;
$accountId = $_ENV['ACCOUNT_ID'];
$secretKey = $_ENV['SECRET_KEY'];
$client = new Client($accountId, $secretKey);
$client->accessCards->suspend([
'card_id' => '0xc4rd1d'
]);
echo "Card suspended successfully\n";
{:ok, client} = AccessGrid.new(
System.get_env("ACCOUNT_ID"),
System.get_env("SECRET_KEY")
)
{:ok, _card} = AccessGrid.AccessCards.suspend(client,
card_id: "0xc4rd1d"
)
IO.puts("Card suspended successfully")
Response
{
"status": "success",
"install_url": "https://install.accessgrid.io/pass/key_a91c7e23",
"id": "key_a91c7e23",
"state": "suspended",
"temporary": false,
"full_name": "Employee name",
"expiration_date": "2026-06-15T23:59:59Z",
"metadata": {},
"card_number": "8472-1093-5561",
"site_code": "ENG-HQ-01",
"file_data": null
}
Resume Access Pass
If you have previously suspended an Access Pass, you can re-enable it with the resume action
card_id
string
Request
# Build the JSON payload
PAYLOAD='{"card_id":"0xc4rd1d"}'
# Sign the payload
PAYLOAD_B64=$(printf '%s' "$PAYLOAD" | openssl base64 -A)
SIG=$(printf '%s' "$PAYLOAD_B64" | openssl dgst -sha256 -hmac "$SECRET_KEY" -hex | awk '{print $NF}')
curl -v \
-X POST \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
"https://api.accessgrid.com/v1/key-cards/{card_id}/resume"
require 'accessgrid'
acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid.new(acct_id, secret_key)
card = client.access_cards.resume(
card_id: "0xc4rd1d"
)
puts "Card resumed successfully"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const resume = async () => {
try {
await client.accessCards.resume({
cardId: "0xc4rd1d"
});
console.log('Card resumed successfully');
} catch (error) {
console.error('Error resuming Access Pass:', error);
}
};
resume();
from accessgrid import AccessGrid
import os
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
card = client.access_cards.resume(
card_id="0xc4rd1d"
)
print("Card resumed successfully")
package main
import (
"context"
"fmt"
"os"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
ctx := context.Background()
err = client.AccessCards.Resume(ctx, "0xc4rd1d")
if err != nil {
fmt.Printf("Error resuming card: %v\n", err)
return
}
fmt.Println("Card resumed successfully")
}
using AccessGrid;
public async Task ResumeCardAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
var client = new AccessGridClient(accountId, secretKey);
await client.AccessCards.ResumeAsync("0xc4rd1d");
Console.WriteLine("Card resumed successfully");
}
import com.organization.accessgrid.AccessGridClient;
public class AccessCardService {
private final AccessGridClient client;
public AccessCardService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void resumeCard() throws AccessGridException {
client.accessCards().resume("0xc4rd1d");
System.out.println("Card resumed successfully");
}
}
<?php
require 'vendor/autoload.php';
use AccessGridClient;
$accountId = $_ENV['ACCOUNT_ID'];
$secretKey = $_ENV['SECRET_KEY'];
$client = new Client($accountId, $secretKey);
$client->accessCards->resume([
'card_id' => '0xc4rd1d'
]);
echo "Card resumed successfully\n";
{:ok, client} = AccessGrid.new(
System.get_env("ACCOUNT_ID"),
System.get_env("SECRET_KEY")
)
{:ok, _card} = AccessGrid.AccessCards.resume(client,
card_id: "0xc4rd1d"
)
IO.puts("Card resumed successfully")
Response
{
"status": "success",
"install_url": "https://install.accessgrid.io/pass/key_a91c7e23",
"id": "key_a91c7e23",
"state": "active",
"temporary": false,
"full_name": "Employee name",
"expiration_date": "2026-06-15T23:59:59Z",
"metadata": {},
"card_number": "8472-1093-5561",
"site_code": "ENG-HQ-01",
"file_data": null
}
Unlink Access Pass
If you'd like to force the removal of an Access Pass from it's current holder - unlinking does not make a key uninstallable, it simply disables it on the users phone.
card_id
string
Request
# Build the JSON payload
PAYLOAD='{"card_id":"0xc4rd1d"}'
# Sign the payload
PAYLOAD_B64=$(printf '%s' "$PAYLOAD" | openssl base64 -A)
SIG=$(printf '%s' "$PAYLOAD_B64" | openssl dgst -sha256 -hmac "$SECRET_KEY" -hex | awk '{print $NF}')
curl -v \
-X POST \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
"https://api.accessgrid.com/v1/key-cards/{card_id}/unlink"
require 'accessgrid'
acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid.new(acct_id, secret_key)
card = client.access_cards.unlink(
card_id: "0xc4rd1d"
)
puts "Card unlinked successfully"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const unlink = async () => {
try {
await client.accessCards.unlink({
cardId: "0xc4rd1d"
});
console.log('Card unlinked successfully');
} catch (error) {
console.error('Error unlinking Access Pass:', error);
}
};
unlink();
from accessgrid import AccessGrid
import os
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
card = client.access_cards.unlink(
card_id="0xc4rd1d"
)
print("Card unlinked successfully")
package main
import (
"context"
"fmt"
"os"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
ctx := context.Background()
err = client.AccessCards.Unlink(ctx, "0xc4rd1d")
if err != nil {
fmt.Printf("Error unlinking card: %v\n", err)
return
}
fmt.Println("Card unlinked successfully")
}
using AccessGrid;
public async Task UnlinkCardAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
var client = new AccessGridClient(accountId, secretKey);
await client.AccessCards.UnlinkAsync("0xc4rd1d");
Console.WriteLine("Card unlinked successfully");
}
import com.organization.accessgrid.AccessGridClient;
public class AccessCardService {
private final AccessGridClient client;
public AccessCardService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void unlinkCard() throws AccessGridException {
client.accessCards().unlink("0xc4rd1d");
System.out.println("Card unlinked successfully");
}
}
<?php
require 'vendor/autoload.php';
use AccessGridClient;
$accountId = $_ENV['ACCOUNT_ID'];
$secretKey = $_ENV['SECRET_KEY'];
$client = new Client($accountId, $secretKey);
$client->accessCards->unlink([
'card_id' => '0xc4rd1d'
]);
echo "Card unlinked successfully\n";
{:ok, client} = AccessGrid.new(
System.get_env("ACCOUNT_ID"),
System.get_env("SECRET_KEY")
)
{:ok, _card} = AccessGrid.AccessCards.unlink(client,
card_id: "0xc4rd1d"
)
IO.puts("Card unlinked successfully")
Response
{
"status": "success",
"install_url": "https://install.accessgrid.io/pass/key_a91c7e23",
"id": "key_a91c7e23",
"state": "unlink",
"temporary": false,
"full_name": "Employee name",
"expiration_date": "2026-06-15T23:59:59Z",
"metadata": {},
"card_number": "8472-1093-5561",
"site_code": "ENG-HQ-01",
"file_data": null
}
Delete Access Pass
If you'd like to delete Access Pass and prevent additional installs - deleting a key unlinks it and makes prevents any additional installs
card_id
string
Request
# Build the JSON payload
PAYLOAD='{"card_id":"0xc4rd1d"}'
# Sign the payload
PAYLOAD_B64=$(printf '%s' "$PAYLOAD" | openssl base64 -A)
SIG=$(printf '%s' "$PAYLOAD_B64" | openssl dgst -sha256 -hmac "$SECRET_KEY" -hex | awk '{print $NF}')
curl -v \
-X POST \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
"https://api.accessgrid.com/v1/key-cards/{card_id}/delete"
require 'accessgrid'
acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid.new(acct_id, secret_key)
card = client.access_cards.delete(
card_id: "0xc4rd1d"
)
puts "Card deleted successfully"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const del = async () => {
try {
await client.accessCards.delete({
cardId: "0xc4rd1d"
});
console.log('Card delete successfully');
} catch (error) {
console.error('Error deleting Access Pass:', error);
}
};
del();
from accessgrid import AccessGrid
import os
account_id = os.getenv('ACCOUNT_ID')
secret_key = os.getenv('SECRET_KEY')
client = AccessGrid(account_id, secret_key)
card = client.access_cards.delete(
card_id="0xc4rd1d"
)
print("Card deleted successfully")
package main
import (
"context"
"fmt"
"os"
"github.com/Access-Grid/accessgrid-go"
)
func main() {
accountID := os.Getenv("ACCOUNT_ID")
secretKey := os.Getenv("SECRET_KEY")
client, err := accessgrid.NewClient(accountID, secretKey)
if err != nil {
fmt.Printf("Error creating client: %v\n", err)
return
}
ctx := context.Background()
err = client.AccessCards.Delete(ctx, "0xc4rd1d")
if err != nil {
fmt.Printf("Error deleting card: %v\n", err)
return
}
fmt.Println("Card deleted successfully")
}
using AccessGrid;
public async Task DeleteCardAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
var client = new AccessGridClient(accountId, secretKey);
await client.AccessCards.DeleteAsync("0xc4rd1d");
Console.WriteLine("Card deleted successfully");
}
import com.organization.accessgrid.AccessGridClient;
public class AccessCardService {
private final AccessGridClient client;
public AccessCardService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void deleteCard() throws AccessGridException {
client.accessCards().delete("0xc4rd1d");
System.out.println("Card deleted successfully");
}
}
<?php
require 'vendor/autoload.php';
use AccessGridClient;
$accountId = $_ENV['ACCOUNT_ID'];
$secretKey = $_ENV['SECRET_KEY'];
$client = new Client($accountId, $secretKey);
$client->accessCards->delete([
'card_id' => '0xc4rd1d'
]);
echo "Card deleted successfully\n";
{:ok, client} = AccessGrid.new(
System.get_env("ACCOUNT_ID"),
System.get_env("SECRET_KEY")
)
{:ok, _card} = AccessGrid.AccessCards.delete(client,
card_id: "0xc4rd1d"
)
IO.puts("Card deleted successfully")
Response
{
"status": "success",
"install_url": "https://install.accessgrid.io/pass/key_a91c7e23",
"id": "key_a91c7e23",
"state": "deleted",
"temporary": false,
"full_name": "Employee name",
"expiration_date": "2026-06-15T23:59:59Z",
"metadata": {},
"card_number": "8472-1093-5561",
"site_code": "ENG-HQ-01",
"file_data": null
}