List Card Template Pairs
Only available for enterprise customers - allows you to retrieve a paginated list of Card Template Pairs. Card Template Pairs link iOS and Android card templates together for unified pass issuance.
page
nullable integer
Page number for pagination (default: 1)
per_page
nullable integer
Number of results per page (default: 50, max: 100)
Request
curl -v \
-X GET \
-H 'X-ACCT-ID: 123' \
-H "X-PAYLOAD-SIG: $HASH" \
"https://api.accessgrid.com/v1/console/card-template-pairs?page=1&per_page=50"
require 'accessgrid'
acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid.new(acct_id, secret_key)
response = client.console.list_pass_template_pairs(
page: 1,
per_page: 50
)
response['pass_template_pairs'].each do |pair|
puts "Pair: #{pair.name} (ID: #{pair.id})"
puts " Android: #{pair.android_template&.name}"
puts " iOS: #{pair.ios_template&.name}"
end
puts "Total: #{response['pagination']['total_count']} pairs"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const listPairs = async () => {
try {
const result = await client.console.listPassTemplatePairs({
page: 1,
perPage: 50
});
result.passTemplatePairs.forEach(pair => {
console.log(`Pair: ${pair.name} (ID: ${pair.id})`);
console.log(` Android: ${pair.androidTemplate?.name}`);
console.log(` iOS: ${pair.iosTemplate?.name}`);
});
console.log(`Total: ${result.pagination.total_count} pairs`);
} catch (error) {
console.error('Error listing pairs:', error);
}
};
listPairs();
import os
from accessgrid import AccessGrid
acct_id = os.environ.get('ACCOUNT_ID')
secret_key = os.environ.get('SECRET_KEY')
client = AccessGrid(acct_id, secret_key)
result = client.console.list_pass_template_pairs(
page=1,
per_page=50
)
for pair in result['pass_template_pairs']:
print(f"Pair: {pair.name} (ID: {pair.id})")
if pair.android_template:
print(f" Android: {pair.android_template.name}")
if pair.ios_template:
print(f" iOS: {pair.ios_template.name}")
print(f"Total: {result['pagination']['total_count']} pairs")
<?php
require 'vendor/autoload.php';
use AccessGrid\AccessGridClient;
$acctId = getenv('ACCOUNT_ID');
$secretKey = getenv('SECRET_KEY');
$client = new AccessGridClient($acctId, $secretKey);
$result = $client->console->listPassTemplatePairs([
'page' => 1,
'per_page' => 50
]);
foreach ($result['pass_template_pairs'] as $pair) {
echo "Pair: {$pair->name} (ID: {$pair->id})\n";
if ($pair->androidTemplate) {
echo " Android: {$pair->androidTemplate->name}\n";
}
if ($pair->iosTemplate) {
echo " iOS: {$pair->iosTemplate->name}\n";
}
}
echo "Total: {$result['pagination']['total_count']} pairs\n";
package main
import (
"context"
"fmt"
"os"
"github.com/Access-Grid/accessgrid-go"
"github.com/Access-Grid/accessgrid-go/models"
)
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()
result, err := client.Console.ListPassTemplatePairs(ctx, models.ListPassTemplatePairsParams{
Page: 1,
PerPage: 50,
})
if err != nil {
fmt.Printf("Error listing pairs: %v\n", err)
return
}
for _, pair := range result.PassTemplatePairs {
fmt.Printf("Pair: %s (ID: %s)\n", pair.Name, pair.ID)
if pair.IOSTemplate != nil {
fmt.Printf(" iOS: %s\n", pair.IOSTemplate.Name)
}
if pair.AndroidTemplate != nil {
fmt.Printf(" Android: %s\n", pair.AndroidTemplate.Name)
}
}
fmt.Printf("Total: %d pairs\n", result.Pagination.TotalCount)
}
using AccessGrid;
public async Task ListPassTemplatePairsAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
using var client = new AccessGridClient(accountId, secretKey);
var result = await client.Console.ListPassTemplatePairsAsync(page: 1, perPage: 50);
foreach (var pair in result.PassTemplatePairs)
{
Console.WriteLine($"Pair: {pair.Name} (ID: {pair.Id})");
Console.WriteLine($" iOS: {pair.IosTemplate?.Name ?? "none"}");
Console.WriteLine($" Android: {pair.AndroidTemplate?.Name ?? "none"}");
}
Console.WriteLine($"Total: {result.Pagination.TotalCount} pairs");
}
import com.organization.accessgrid.AccessGridClient;
import com.organization.accessgrid.Models;
public class CardTemplatePairService {
private final AccessGridClient client;
public CardTemplatePairService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public void listPairs() {
Models.ListPassTemplatePairsParams params = Models.ListPassTemplatePairsParams.builder()
.page(1)
.perPage(50)
.build();
Models.PassTemplatePairsResult result = client.console().listPassTemplatePairs(params);
for (Models.PassTemplatePair pair : result.getPassTemplatePairs()) {
System.out.printf("Pair: %s (ID: %s)%n", pair.getName(), pair.getId());
if (pair.getIosTemplate() != null) {
System.out.printf(" iOS: %s%n", pair.getIosTemplate().getName());
}
if (pair.getAndroidTemplate() != null) {
System.out.printf(" Android: %s%n", pair.getAndroidTemplate().getName());
}
}
System.out.printf("Total: %d pairs%n", result.getPagination().getTotalCount());
}
}
Response
{
"card_template_pairs": [
{
"id": "pair_9f3a12bc",
"ex_id": "pair_9f3a12bc",
"name": "Corporate Access Badge",
"created_at": "2025-12-01T09:15:30Z",
"android_template": {
"id": "tpl_android123",
"ex_id": "tpl_android123",
"name": "Android Corporate Badge",
"platform": "android"
},
"ios_template": {
"id": "tpl_ios456",
"ex_id": "tpl_ios456",
"name": "iOS Corporate Badge",
"platform": "apple"
}
},
{
"id": "pair_b81d77ef",
"ex_id": "pair_b81d77ef",
"name": "Student ID",
"created_at": "2025-11-15T14:22:11Z",
"android_template": {
"id": "tpl_android789",
"ex_id": "tpl_android789",
"name": "Android Student ID",
"platform": "android"
},
"ios_template": null
}
],
"pagination": {
"current_page": 1,
"per_page": 50,
"total_pages": 1,
"total_count": 2
}
}
Create Card Template Pair
Only available for enterprise customers - allows you to create a Card Template Pair by linking an Apple (iOS) and Google (Android) card template together. Both templates must be published, use the same protocol, and have the correct platform.
name
string
A name for the card template pair
apple_card_template_id
string
The ex_id of the Apple (iOS) card template
google_card_template_id
string
The ex_id of the Google (Android) card template
Request
curl -v \
-X POST \
-H 'X-ACCT-ID: 123' \
-H "X-PAYLOAD-SIG: $HASH" \
-d '{
"name": "Employee Badge Pair",
"apple_card_template_id": "0xapplet3mp14t3",
"google_card_template_id": "0xgoogl3t3mp14t3"
}' \
"https://api.accessgrid.com/v1/console/card-template-pairs"
require 'accessgrid'
acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']
client = AccessGrid.new(acct_id, secret_key)
# Both card templates must be published (status: ready) and use the same protocol.
pair = client.console.create_pass_template_pair(
name: "Employee Badge Pair",
apple_card_template_id: "0xapplet3mp14t3",
google_card_template_id: "0xgoogl3t3mp14t3"
)
puts "Created pair: #{pair.name} (ID: #{pair.id})"
import AccessGrid from 'accessgrid';
const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;
const client = new AccessGrid(accountId, secretKey);
const createPair = async () => {
try {
// Both card templates must be published (status: ready) and use the same protocol.
const pair = await client.console.createPassTemplatePair({
name: "Employee Badge Pair",
appleCardTemplateId: "0xapplet3mp14t3",
googleCardTemplateId: "0xgoogl3t3mp14t3"
});
console.log(`Created pair: ${pair.name} (ID: ${pair.id})`);
} catch (error) {
console.error('Error creating pair:', error);
}
};
createPair();
import os
from accessgrid import AccessGrid
acct_id = os.environ.get('ACCOUNT_ID')
secret_key = os.environ.get('SECRET_KEY')
client = AccessGrid(acct_id, secret_key)
# Both card templates must be published (status: ready) and use the same protocol.
pair = client.console.create_pass_template_pair(
name="Employee Badge Pair",
apple_card_template_id="0xapplet3mp14t3",
google_card_template_id="0xgoogl3t3mp14t3"
)
print(f"Created pair: {pair.name} (ID: {pair.id})")
<?php
require 'vendor/autoload.php';
use AccessGrid\AccessGridClient;
$acctId = getenv('ACCOUNT_ID');
$secretKey = getenv('SECRET_KEY');
$client = new AccessGridClient($acctId, $secretKey);
// Both card templates must be published (status: ready) and use the same protocol.
$pair = $client->console->createPassTemplatePair([
'name' => 'Employee Badge Pair',
'apple_card_template_id' => '0xapplet3mp14t3',
'google_card_template_id' => '0xgoogl3t3mp14t3',
]);
echo "Created pair: {$pair->name} (ID: {$pair->id})\n";
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
}
// Both card templates must be published (status: ready) and use the same protocol.
params := accessgrid.CreatePassTemplatePairParams{
Name: "Employee Badge Pair",
AppleCardTemplateID: "0xapplet3mp14t3",
GoogleCardTemplateID: "0xgoogl3t3mp14t3",
}
ctx := context.Background()
pair, err := client.Console.CreatePassTemplatePair(ctx, params)
if err != nil {
fmt.Printf("Error creating pair: %v\n", err)
return
}
fmt.Printf("Created pair: %s (ID: %s)\n", pair.Name, pair.ID)
}
using AccessGrid;
public async Task CreatePassTemplatePairAsync()
{
var accountId = Environment.GetEnvironmentVariable("ACCOUNT_ID");
var secretKey = Environment.GetEnvironmentVariable("SECRET_KEY");
using var client = new AccessGridClient(accountId, secretKey);
// Both card templates must be published (status: ready) and use the same protocol.
var pair = await client.Console.CreatePassTemplatePairAsync(new CreatePassTemplatePairRequest
{
Name = "Employee Badge Pair",
AppleCardTemplateId = "0xapplet3mp14t3",
GoogleCardTemplateId = "0xgoogl3t3mp14t3"
});
Console.WriteLine($"Created pair: {pair.Name} (ID: {pair.Id})");
}
import com.organization.accessgrid.AccessGridClient;
import com.organization.accessgrid.Models;
public class CardTemplatePairService {
private final AccessGridClient client;
public CardTemplatePairService() {
String accountId = System.getenv("ACCOUNT_ID");
String secretKey = System.getenv("SECRET_KEY");
this.client = new AccessGridClient(accountId, secretKey);
}
public Models.PassTemplatePair createPair() {
// Both card templates must be published (status: ready) and use the same protocol.
Models.CreatePassTemplatePairRequest request = Models.CreatePassTemplatePairRequest.builder()
.name("Employee Badge Pair")
.appleCardTemplateId("0xapplet3mp14t3")
.googleCardTemplateId("0xgoogl3t3mp14t3")
.build();
Models.PassTemplatePair pair = client.console().createPassTemplatePair(request);
System.out.printf("Created pair: %s (ID: %s)%n", pair.getName(), pair.getId());
return pair;
}
}
Response
{
"id": "pair_9f3a12bc",
"ex_id": "pair_9f3a12bc",
"name": "Corporate Access Badge",
"created_at": "2025-12-01T09:15:30Z",
"android_template": {
"id": "tpl_android123",
"ex_id": "tpl_android123",
"name": "Android Corporate Badge",
"platform": "android"
},
"ios_template": {
"id": "tpl_ios456",
"ex_id": "tpl_ios456",
"name": "iOS Corporate Badge",
"platform": "apple"
}
}