API documentation for Apple + Google NFC wallet credentials - AccessGrid
API Documentation
Everything you need to interact with AccessGrid.
Terminal
JavaScript
Ruby
GO
Python
C#
Java
php
Elixir
Terminal
JavaScript
Ruby
GO
Python
C#
Java
php
Elixir
List Access Passes
Copy for LLMCopied
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.
Open all
Collapse
template_id
nullable string
All
Optional. The card template ID to list keys for. If omitted, returns keys for all templates in the account.
state
nullable string
All
Filter keys by state (active, suspended, unlink, deleted)
metadata
nullable object
All
Filter keys by metadata key/value pairs (maximum of 2 key/value pairs). Example: metadata[department]=engineering&metadata[floor]=3
page
nullable integer
All
Page number for pagination (default: 1)
per_page
nullable integer
All
Number of results per page (default: 25, max: 100)
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
// Get filtered keys by state
ListKeysParams stateFilter = ListKeysParams.builder()
.state("active")
.build();
List
// 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
Copy for LLMCopied
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.
Open all
Collapse
card_template_id
string
All
Unique identifier for the card template OR card template pair to use. When you pass a pair's id, AccessGrid issues both the Apple and Android passes in a single call using the same attributes.
employee_id
string
Corporate
Unique identifier for the employee
tag_id
nullable string
All
Tag identifier associated with the Access Pass, only allowed if your card template has key diversification enabled. Must be 7 bytes, 14 chars, ex: DF517FC87144DF
site_code
nullable string
All
Site code from H10301 (26 bit) format. Must be number under 255. Required if `file_data` not present.
card_number
nullable string
All
Card number from H10301 (26 bit) format. Must be number under 65,535. Required if `file_data` not present.
file_data
nullable string
All
Hexadecimal data (0-9, A-F). Up to 64 characters by default; if using a key diversification profile, can be up to 1028 characters. Smart Tap supports up to 4096 characters, however we recommend aligning your Smart Tap data size with your Apple DESFire credential profile maximum file size. Only used when implementing proprietary data formats. For QR templates, this field overrides the template's default qr_code_value and is encoded in the barcode (up to 2048 characters).
full_name
string
All
Full name of the Access Pass owner
nullable string
All
Email address of the Access Pass owner - if you have a SendGrid or Postmark integration, then we will send a text message on your behalf
phone_number
nullable string
All
Contact phone number for the Access Pass owner - if you have a Twilio integration, then we will send a text message on your behalf
classification
nullable string
Corporate
Multi family
Apple
Employment classification (e.g., full_time, contractor). For 'multi_family', the resident classification (e.g., Tenant).
department
nullable string
Corporate
Apple
Department of the employee (e.g., Engineering, Marketing)
location
nullable string
Corporate
Multi family
Apple
Workplace location of the employee. For 'multi_family', the property location (e.g., Austin, Texas).
site_name
nullable string
Corporate
Apple
Building or site name where the employee works
workstation
nullable string
Corporate
Apple
Workstation identifier for the employee
mail_stop
nullable string
Corporate
Multi family
Apple
Mail stop code for the employee. For 'multi_family', the resident's mail stop.
company_address
nullable string
Corporate
Apple
Company address associated with the employee
start_date
string
All
ISO8601 timestamp when the key card becomes active
temporary
boolean
Corporate
Apple
Android
False by default. Set to true if you'd like to configure the pass to be temporary. Temporary access cards may only be used for 24 hours.
expiration_date
string
All
ISO8601 timestamp when the key card expires. For temporary passes, this value must be less than 24 hours into the future.
employee_photo
string
Corporate
Multi family
Apple
Member
QR
Base64 encoded PNG image of the employee (max 10MB). For 'multi_family', the resident's photo.
title
nullable string
Corporate
Multi family
Android
Job title or department of the employee. For 'multi_family', used as the label above the resident's name (defaults to 'Resident').
member_id
nullable string
Hotel
Apple
Only for 'hotel' use case. Loyalty/membership ID of the guest
membership_status
nullable string
Hotel
Apple
Only for 'hotel' use case. Status of the guest's membership
is_pass_ready_to_transact
nullable boolean
Hotel
Apple
Only for 'hotel' use case. Whether the pass is ready to be used for NFC transactions
tile_data
nullable object
Hotel
Only for 'hotel' use case. Data for the hotel tile display
checkInAvailableWindowStartDateTime
nullable string
Hotel
Apple
ISO8601 timestamp with timezone. Required if isCheckedIn is missing or false
checkInAvailableWindowEndDateTime
nullable string
Hotel
Apple
ISO8601 timestamp with timezone. Required if isCheckedIn is missing or false
checkInDateTime
nullable string
Hotel
Android
ISO8601 timestamp with timezone. Required if isCheckedIn is true
checkInURL
nullable string
Hotel
All
URL for remote check-in. Only used if isCheckedIn is missing or false
isCheckedIn
nullable boolean
Hotel
All
Whether the guest has checked in
numberOfRoomsReserved
nullable integer
Hotel
All
Number of rooms reserved. Must match the number of roomNumbers if both are present
roomNumbers
nullable array
Hotel
All
Array of room numbers. Must match the number of numberOfRoomsReserved if both are present
reservations
nullable object
Hotel
Apple
Only for 'hotel' use case. Data for the hotel reservation
checkInDateTime
nullable string
Hotel
Apple
ISO8601 timestamp with timezone. Required if isCheckedIn is true
isCheckedIn
nullable boolean
Hotel
Apple
Whether the guest has checked in
numberOfRoomsReserved
nullable integer
Hotel
Apple
Number of rooms reserved. Must match the number of roomNumbers if both are present
propertyLocation
nullable string
Hotel
Apple
Location of the property (e.g., 'Key West')
propertyName
nullable string
Hotel
Apple
Name of the property (e.g., 'Hyatt Centric Resort & Spa')
propertyMapUrl
nullable string
Hotel
Apple
URL to a map of the property
propertyCategory
nullable string
Hotel
Apple
Category of the property. If provided, must be 'travel'
restaurantVoucher
nullable string
Hotel
Apple
Optional voucher for restaurant services
reservationEndDateTime
nullable string
Hotel
Apple
ISO8601 timestamp with timezone for reservation end
reservationNumber
nullable string
Hotel
Apple
Confirmation number for the reservation
reservationStartDateTime
nullable string
Hotel
Apple
ISO8601 timestamp with timezone for reservation start
roomNumbers
nullable array
Hotel
Apple
Array of room numbers. Must match the number of numberOfRoomsReserved if both are present
property_name
nullable string
Multi family
Apple
Only for 'multi_family' use case. Name of the property (e.g., ACME Condos). Falls back to your organization name if omitted.
property_address
nullable string
Multi family
Apple
Only for 'multi_family' use case. Street address of the property.
building_name
nullable string
Multi family
Apple
Only for 'multi_family' use case. Name of the building on the property (e.g., Western Tower).
unit_numbers
nullable array
Multi family
Apple
Only for 'multi_family' use case. Array of the resident's unit numbers. Shown on the pass as a single comma-separated Unit field.
storage_unit
nullable string
Multi family
Apple
Only for 'multi_family' use case. The resident's storage unit identifier.
parking_address
nullable string
Multi family
Apple
Only for 'multi_family' use case. Address details for the resident's parking.
parking_details
nullable array
Multi family
Apple
Only for 'multi_family' use case. Up to 5 parking entries, each a { "label", "value" } object. label must be one of: Garage, Building, Facility, Place, Location, Lot, Level, Zone, Spot, Car Park, Deck, Stall, Space, Section.
label
string
Multi family
Apple
Parking label. Must be one of Apple's allowed values (see above).
value
string
Multi family
Apple
Parking value (e.g., the garage or spot identifier).
barcode_data
nullable string
Multi family
Apple
Only for 'multi_family' use case. Message for a single QR barcode shown on the pass for non-NFC readers (e.g., a URL or resident identifier).
metadata
nullable object
All
Custom JSON object for storing additional metadata associated with the access pass. Can contain any valid JSON data.
credential_pool_id
nullable string
All
Optional credential pool ID to use for automatic credential assignment. When provided, the system will automatically assign site_code and card_number from the pool.
credential_profiles
nullable array
Apple
Optional array of credential profile `ex_id` strings used to override the pass template's credential profiles for this Access Pass only. IDs must belong to profiles on the requesting account. If omitted, the pass template's credential profiles are used. When any override profile has key diversification enabled, `tag_id` must be supplied.
system_id
nullable string
All
Optional system identifier used for MIFARE DESFire key diversification. If omitted, one is generated automatically. Cannot be combined with `skip_system_id`.
qr_code_text
nullable string
QR
Human-readable text displayed below the QR barcode on the pass. Overrides the template default.
top_right_label
nullable string
QR
Label displayed in the top-right header field of the pass. Overrides the template default.
top_right_value
nullable string
QR
Value displayed in the top-right header field of the pass. Overrides the template default.
secondary_field_left_label
nullable string
QR
Label for the left secondary field on the pass. Overrides the template default.
secondary_field_left_value
nullable string
QR
Value for the left secondary field on the pass. Overrides the template default.
secondary_field_middle_label
nullable string
QR
Label for the middle secondary field on the pass. Overrides the template default.
secondary_field_middle_value
nullable string
QR
Value for the middle secondary field on the pass. Overrides the template default.
secondary_field_right_label
nullable string
QR
Label for the right secondary field on the pass. Overrides the template default.
secondary_field_right_value
nullable string
QR
Value for the right secondary field on the pass. Overrides the template default.
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": "employee@yourwebsite.com", "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)
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: "employee@yourwebsite.com", 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: "employee@yourwebsite.com", 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="employee@yourwebsite.com", 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: "employee@yourwebsite.com", 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 = "employee@yourwebsite.com", 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 Card provisionCard() throws AccessGridException { ProvisionCardRequest request = ProvisionCardRequest.builder() .cardTemplateId("0xd3adb00b5") .employeeId("123456789") .tagId("DDEADB33FB00B5") .allowOnMultipleDevices(true) .fullName("Employee name") .email("employee@yourwebsite.com") .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' => 'employee@yourwebsite.com',
'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: "employee@yourwebsite.com", 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
Copy for LLMCopied
Retrieve details about a specific issued Access Pass, including its state, devices, and metadata
Open all
Collapse
card_id
string
All
Unique identifier of the Access Pass to retrieve, sent as part of the URL
Request
`# Build the JSON payload PAYLOAD='{"card_id":"0xc4rd1d"}'
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 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
Copy for LLMCopied
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.
Open all
Collapse
card_id
string
All
Unique identifier of the Access Pass to update, sent as part of the URL
update_type
nullable string
All
Controls the scope of the update. metadata (default) updates only the pass metadata in the system. metadata+payload additionally triggers a credential payload reprovision on the device (Apple DESFire / Google SmartTap).
employee_id
nullable string
Corporate
Updated unique identifier for the employee
full_name
nullable string
All
Updated full name of the Access Pass owner
classification
nullable string
Corporate
Multi family
Apple
Updated employment classification (e.g., full_time, contractor). For 'multi_family', the resident classification (e.g., Tenant).
department
nullable string
Corporate
Apple
Updated department of the employee
location
nullable string
Corporate
Multi family
Apple
Updated workplace location of the employee. For 'multi_family', the property location (e.g., Austin, Texas).
site_name
nullable string
Corporate
Apple
Updated building or site name where the employee works
workstation
nullable string
Corporate
Apple
Updated workstation identifier for the employee
mail_stop
nullable string
Corporate
Multi family
Apple
Updated mail stop code for the employee. For 'multi_family', the resident's mail stop.
company_address
nullable string
Corporate
Apple
Updated company address associated with the employee
expiration_date
nullable string
All
Updated ISO8601 timestamp when the card expires
employee_photo
nullable string
Corporate
Multi family
Apple
Member
QR
Updated base64 encoded PNG image of the employee (max 10MB). For 'multi_family', the resident's photo.
title
nullable string
Corporate
Multi family
Android
Updated job title or department of the employee. For 'multi_family', used as the label above the resident's name (defaults to 'Resident').
property_name
nullable string
Multi family
Apple
Only for 'multi_family' use case. Updated name of the property (e.g., ACME Condos).
property_address
nullable string
Multi family
Apple
Only for 'multi_family' use case. Updated street address of the property.
building_name
nullable string
Multi family
Apple
Only for 'multi_family' use case. Updated name of the building on the property.
unit_numbers
nullable array
Multi family
Apple
Only for 'multi_family' use case. Updated array of the resident's unit numbers.
storage_unit
nullable string
Multi family
Apple
Only for 'multi_family' use case. Updated storage unit identifier.
parking_address
nullable string
Multi family
Apple
Only for 'multi_family' use case. Updated parking address details.
parking_details
nullable array
Multi family
Apple
label
string
Multi family
Apple
Parking label. Must be one of Apple's allowed values (see above).
value
string
Multi family
Apple
Parking value (e.g., the garage or spot identifier).
barcode_data
nullable string
Multi family
Apple
Only for 'multi_family' use case. Message for a single QR barcode shown on the pass for non-NFC readers (e.g., a URL or resident identifier).
file_data
nullable string
Android
is_pass_ready_to_transact
nullable boolean
Hotel
Apple
Only for 'hotel' use case. Whether the pass is ready to be used for NFC transactions
tile_data
nullable object
Hotel
Only for 'hotel' use case. Data for the hotel tile display
checkInAvailableWindowStartDateTime
nullable string
Hotel
Apple
ISO8601 timestamp with timezone. Required if isCheckedIn is missing or false
checkInAvailableWindowEndDateTime
nullable string
Hotel
Apple
ISO8601 timestamp with timezone. Required if isCheckedIn is missing or false
checkInDateTime
nullable string
Hotel
Android
ISO8601 timestamp with timezone. Required if isCheckedIn is true
checkInURL
nullable string
Hotel
All
URL for remote check-in. Only used if isCheckedIn is missing or false
isCheckedIn
nullable boolean
Hotel
All
Whether the guest has checked in
numberOfRoomsReserved
nullable integer
Hotel
All
Number of rooms reserved. Must match the number of roomNumbers if both are present
roomNumbers
nullable array
Hotel
All
Array of room numbers. Must match the number of numberOfRoomsReserved if both are present
reservations
nullable object
Hotel
Apple
Only for 'hotel' use case. Data for the hotel reservation
checkInDateTime
nullable string
Hotel
Apple
ISO8601 timestamp with timezone. Required if isCheckedIn is true
isCheckedIn
nullable boolean
Hotel
Apple
Whether the guest has checked in
numberOfRoomsReserved
nullable integer
Hotel
Apple
Number of rooms reserved. Must match the number of roomNumbers if both are present
propertyLocation
nullable string
Hotel
Apple
Location of the property (e.g., 'Key West')
propertyName
nullable string
Hotel
Apple
Name of the property (e.g., 'Hyatt Centric Resort & Spa')
propertyMapUrl
nullable string
Hotel
Apple
URL to a map of the property
propertyCategory
nullable string
Hotel
Apple
Category of the property. If provided, must be 'travel'
restaurantVoucher
nullable string
Hotel
Apple
Optional voucher for restaurant services
reservationEndDateTime
nullable string
Hotel
Apple
ISO8601 timestamp with timezone for reservation end
reservationNumber
nullable string
Hotel
Apple
Confirmation number for the reservation
reservationStartDateTime
nullable string
Hotel
Apple
ISO8601 timestamp with timezone for reservation start
roomNumbers
nullable array
Hotel
Apple
Array of room numbers. Must match the number of numberOfRoomsReserved if both are present
qr_code_text
nullable string
QR
Updated human-readable text displayed below the QR barcode on the pass. Overrides the template default.
top_right_label
nullable string
QR
Updated label displayed in the top-right header field of the pass. Overrides the template default.
top_right_value
nullable string
QR
Updated value displayed in the top-right header field of the pass. Overrides the template default.
secondary_field_left_label
nullable string
QR
Updated label for the left secondary field on the pass. Overrides the template default.
secondary_field_left_value
nullable string
QR
Updated value for the left secondary field on the pass. Overrides the template default.
secondary_field_middle_label
nullable string
QR
Updated label for the middle secondary field on the pass. Overrides the template default.
secondary_field_middle_value
nullable string
QR
Updated value for the middle secondary field on the pass. Overrides the template default.
secondary_field_right_label
nullable string
QR
Updated label for the right secondary field on the pass. Overrides the template default.
secondary_field_right_value
nullable string
QR
Updated value for the right secondary field on the pass. Overrides the template default.
metadata
nullable object
All
Custom JSON object for storing additional metadata associated with the access pass. Can contain any valid JSON data.
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)
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 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
Copy for LLMCopied
When you need to temporarily disable an Access Pass for a short period of time
Open all
Collapse
card_id
string
All
Unique identifier of the Access Pass to suspend, sent as part of the URL
Request
`# Build the JSON payload PAYLOAD='{"card_id":"0xc4rd1d"}'
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 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
Copy for LLMCopied
If you have previously suspended an Access Pass, you can re-enable it with the resume action
Open all
Collapse
card_id
string
All
Unique identifier of the Access Pass to resume, sent as part of the URL
Request
`# Build the JSON payload PAYLOAD='{"card_id":"0xc4rd1d"}'
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 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
Copy for LLMCopied
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.
Open all
Collapse
card_id
string
All
Unique identifier of the Access Pass to unlink from its current holder, sent as part of the URL
Request
`# Build the JSON payload PAYLOAD='{"card_id":"0xc4rd1d"}'
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 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
Copy for LLMCopied
If you'd like to delete Access Pass and prevent additional installs - deleting a key unlinks it and makes prevents any additional installs
Open all
Collapse
card_id
string
All
Unique identifier of the Access Pass to delete, sent as part of the URL
Request
`# Build the JSON payload PAYLOAD='{"card_id":"0xc4rd1d"}'
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 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 }
- Installation - Install SDK
- Access Pass - List Access Passes
- Card Template - Create Card Template
- Event Log - Read Event Log
- HID Org - Create HID Org
- iOS - iOS Preflight
- Landing Page - List Landing Pages
- Credential Profile - List Credential Profiles
- Ledger Item - List Ledger Items
- Card Template Pairs - List Card Template Pairs
- Webhook - Webhooks