API documentation for Apple + Google NFC wallet credentials - AccessGrid

API Documentation

Everything you need to interact with AccessGrid.

Programming Languages

Webhooks

AccessGrid can send webhook notifications to your server when events occur. Webhooks use the CloudEvents specification for event delivery.

Configure webhooks in your AccessGrid console.

Webhook Configuration

Example webhook payload (CloudEvents format)

{
  "specversion": "1.0",
  "id": "unique-event-id-12345",
  "source": "accessgrid",
  "type": "ag.access_pass.issued",
  "datacontenttype": "application/json",
  "time": "2025-01-15T10:30:00Z",
  "data": {
    "access_pass_id": "0xp455-3x1d",
    "protocol": "desfire",
    "card_number": "12345",
    "site_code": "100",
    "file_data": "0A1B2C3D4E5F",
    "metadata": {
      "custom_field": "value"
    }
  }
}

Verify webhook with your endpoint

curl -X POST https://your-server.com/webhooks \
  -H "Content-Type: application/cloudevents+json" \
  -H "User-Agent: AccessGrid-Webhooks/1.0" \
  -d '{
    "specversion": "1.0",
    "id": "test-event-123",
    "source": "accessgrid",
    "type": "ag.access_pass.activated",
    "datacontenttype": "application/json",
    "time": "2025-01-15T12:00:00Z",
    "data": {
      "access_pass_id": "0xp455-3x1d",
      "protocol": "desfire",
      "card_number": "12345",
      "site_code": "100",
      "file_data": "0A1B2C3D4E5F",
      "device": {
        "type": "iphone",
        "id": "device-hash-id"
      }
    }
  }'

Response

Empty

List Webhooks

Retrieve a paginated list of webhooks configured for your account.

Pagination

Request

# Build the JSON payload
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}')

curl -G \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
--data-urlencode "sig_payload=$PAYLOAD" \
"https://api.accessgrid.com/v1/console/webhooks"

Response

Empty

Create Webhook

Create a new webhook to receive event notifications. URL must be reachable and at least one event must be subscribed.

Fields

Request

# Build the JSON payload
PAYLOAD='{"name":"Production","url":"https://example.com/webhooks","subscribed_events":["ag.access_pass.issued"]}'

curl -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/console/webhooks"

Response

Empty

Delete Webhook

Delete a webhook by ID.

Fields

Request

# Build the JSON payload
PAYLOAD="{}"

curl -G \
-X DELETE \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
--data-urlencode "sig_payload=$PAYLOAD" \
"https://api.accessgrid.com/v1/console/webhooks/{webhook_id}"

Response

Empty

Verify Webhook

Trigger verification of a webhook. Webhooks must be verified before they receive event deliveries; verification normally happens automatically when a webhook is created or its URL changes, but this endpoint lets you re-run the handshake on demand.

Fields

Request

# Build the JSON payload
PAYLOAD="{}"

curl -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/console/webhooks/{webhook_id}/verify"

Response

// 202 Accepted - verification challenge (re)initiated { "id": "abc123", "verified": false }

// 200 OK - webhook already verified, no action taken { "id": "abc123", "verified": true }