Civic Docs
Civic Pass
Civic Pass
  • 🚀Quickstart
  • Introduction
    • 👋Overview of Civic Pass
    • 📖Key Terms & Definitions
    • 🔄Civic Pass Behavior
    • 🔑Get Network Keys
    • 📺Demo Videos
    • 🔗Referral Link Guide
  • Integration Guide
    • ⛓️Arbitrum
    • ⛓️Avalanche
    • ⛓️Base
    • ⛓️Binance Smart Chain (BSC)
    • ⛓️Ethereum
    • ⛓️Fantom
    • ⛓️Internet Computer (ICP)
      • Why Use Civic Pass on ICP
      • How Civic Pass Works
      • Civic Pass Implementation Guide
      • ICP Civic Credential Check Button
    • ⛓️Optimism
    • ⛓️Polygon
    • ⛓️Polygon zkEVM
    • ⛓️Solana
    • ⛓️Sonic
    • ⛓️Unichain
    • ⛓️XDC
    • ⛓️X Layer
    • ⚠️Unsupported EVM?
  • Custom Passes
    • 📝Issue Your Own Custom Pass
    • ⚙️Using the API
  • Gating Options
    • 🤔Choosing How to Implement Gating
  • USE CASES
    • 💡Overview of Use Cases
    • 🤖Agentic AI
    • 🎁Airdrops
    • 🌐Communities and DAOs
      • Event Access
      • Quadratic Voting
      • Rewards Management
      • Sybil-Resistant ID Verification
    • 💸Decentralized Finance (DeFi)
      • Accredited Investor Checks
      • Country Blocking by Residence/Nationality
      • On-Chain ID Verification
    • 🎮Gaming & GameFi
      • 1-Player-1-Wallet
      • Rewards Management
    • 🐵NFTs
    • 🏡Real-World Assets (RWAs)
      • Accredited Investor Checks
      • Country Blocking Based on Residence/Nationality
      • Tokenizing RWAs
    • 🛠️Smart Contract Development
  • Security
    • 🐞Bug Bounty Program
    • 🛡️Security & Compliance
    • 📊Audit Reports
  • Resources
    • ❓FAQs
    • 🌍Supported Countries & Docs
    • 💬Find us on Discord
Powered by GitBook
On this page
  • Overview
  • Authentication
  • Calling the API

Was this helpful?

  1. Custom Passes

Using the API

PreviousIssue Your Own Custom PassNextChoosing How to Implement Gating

Last updated 2 months ago

Was this helpful?

Overview

The Civic Pass API is a RESTful API that allows holders to manage their passes programmatically from their backends.

See for a full working example.

Authentication

The Civic Pass API uses the for authentication.

To authenticate, you will need your client ID and secret provided to you by Civic.

Sandbox environment

You can also try out our shared sandbox environment. Passes you issue can be seen and managed by everyone else using the sandbox.

  • clientId: dtVTGsKUlkPQ8UXKqSskS1HqNI3hERHT

  • clientSecret: 7DT722BjNlXUp8HVaV_ZjHzopq2Tr12doGB8sBYC-vhPo3Eh0HoidLVATFbxmwZ1

  • Wherever the API requires a gatekeeperNetwork, use our demo pass network: tgnuXXNMDLK8dy7Xm1TdeGyc95MDym4bvAQCwcW21Bf

Note this sandbox environment is only available on testnets. These values should be passed where the API requires a chain (e.g. "ethereum") and a chainNetwork (e.g. "polygonAmoy").

  • solana:devnet

  • ethereum:polygonAmoy

  • ethereum:sepolia

  • ethereum:baseSepolia

  • ethereum:arbitrumSepolia

  • ethereum:optimismSepolia

  • ethereum:bscTestnet

  • ethereum:xdcApothem

  • ethereum:xlayerTestnet

  • ethereum:avalancheCChainFuji

  • ethereum:unichainSepolia

  • ethereum:sonicTestnet

Getting a JWT for the Civic API

const authUrl = "https://auth0.civic.com/oauth/token";
const basicAuth = Buffer.from(`${clientId}:${clientSecret}`).toString('base64');
const loginResponse = await fetch(authUrl, {
    headers: {
        authorization: `Basic ${basicAuth}`,
        "content-type": "application/x-www-form-urlencoded",
    },
    body: "grant_type=client_credentials",
    method: "POST"
});
return (await loginResponse.json()).access_token;

Calling the API

Once you have an access token, you can use it to call the Civic Pass API.

Example: Lookup a pass by wallet address

const apiUrl = "https://api.civic.com/partner";
// See the OpenAPI docs for a full list of available chains and networks
const lookupResponse = await fetch(`${apiUrl}/pass/${chain}/${chainNetwork}/${wallet}`, {
    headers: {
        accept: "application/json",
        authorization: `Bearer ${token}`,
    },
});
return lookupResponse.json();

For full API documentation, see the .

⚙️
Custom Pass
here
OAuth Client Credentials Grant
OpenAPI Docs