Seamlessly integrate 5N ID into your system using our REST API or TypeScript/JavaScript SDK and build trust from the first step.
Before You Begin
Request 5N ID access
Your client account to access the API and SDK.
Get Authorized
Use your Client ID and Client Secret to obtain OAuth2 access tokens via client_credentials flow. For API requests, include the Bearer token in the Authorization header. The SDK handles this automatically.
Overview
5N ID allows youto integrate secure identity verification directly into your website, application, or mobile app. Our technology ensures seamless customer onboarding and Credentials compliance while serving as the unified identity layer for the Canton ecosystem
Key Features:
5N ID acts as the single source of truth for user identity across the Canton network, enabling consistent and verifiable user data across applications.
User identity information is securely stored and managed via smart contracts, ensuring tamper-proof records and auditability.
Simple integration using either the REST API with standardized HTTP requests and responses, or the TypeScript/JavaScript SDK for type-safe, developer-friendly integration.
Designed to work seamlessly with Canton's privacy-focused blockchain infrastructure, enabling compliant data sharing between permissioned nodes.
If you have any questions or need further assistance, please don't hesitate to contact our support team.
Guide
This guide helps you integrate your system with the 5N ID Credentials application. Choose between using the REST API directly or the TypeScript/JavaScript SDK for a more developer-friendly experience. Both use OAuth2 client_credentials authentication for secure access.
01
Contact Us
Fill in the application form to initiate the process. After your account is created, you'll receive an email with your login credentials and temporary password.
You will receive a unique Client ID and Client Secret. Use them to obtain OAuth2 access tokens for authenticating your API requests, or pass them directly to the SDK which handles token management automatically.
04
Choose Integration Method
Choose how you want to integrate:
REST API: Use HTTP requests directly for maximum control;
SDK: Install @fivenorth/id-sdk for type-safe, simplified integration with automatic token management;
Both methods use the same OAuth2 authentication and provide the same functionality.
05
Front-End Adjustments
You must update your front-end to support:
Triggering Credentials flow after user actions;
Displaying verification status to users;
Handling errors and responses visually.
06
Test the Integration
Use the sandbox environment to:
Test API/SDK authentication;
Simulate Credentials flows;
Validate all error scenarios;
Ensure that all functionality works end-to-end before going live.
07
Complete Integration
Once integration is tested and verified, your system will be ready to manage users and initiate Credentials processes in production.
API Overview
Use this section to understand the core technical specifications of the 5N ID API before diving into specific endpoints.
Current API Version
v1.0.0
Update Frequency
Real-time sync after every Credentials action
Base URL
https://id.devnet.cantonloop.com/api/v1
Data Formats
All requests and responses use JSON
Authentication
All requests must be authenticated using OAuth2 client_credentials flow with Bearer tokens
SDK Reference
SDK Benefits
The 5N ID SDK provides a type-safe, developer-friendly wrapper around the 5N ID API:
Automatic OAuth2 token management (acquisition, caching, and refresh)
Type-safe methods with full TypeScript support
Network configuration (devnet/mainnet) with automatic URL resolution
Comprehensive error handling with specific error types
Simplified API calls without manual token management
Package Information
Key information about the SDK package:
Package name: @fivenorth/id-sdk
Available on npm: https://www.npmjs.com/package/@fivenorth/id-sdk
The SDK uses the same OAuth2 client_credentials flow as the API.
All SDK methods correspond to API endpoints and provide the same functionality.
The SDK automatically handles token expiration and retries failed requests.
To integrate using the SDK, follow the steps below.
1. Installation
Package@fivenorth/id-sdk
Description
Install the 5N ID SDK package from npm to get started with type-safe, easy-to-use methods for interacting with the 5N ID API.
Installation
Install using npm:
npminstall @fivenorth/id-sdk
Or using yarn:
yarnadd @fivenorth/id-sdk
Or using bun:
bun add @fivenorth/id-sdk
2. Initialization
MethodidSdk.connect()
Description
Create and authenticate a connection to the 5N ID service. The SDK automatically handles OAuth2 token management, including token acquisition, caching, and refresh.
Parameters
clientId – your Client ID (required)
clientSecret – your Client Secret (required)
network – network environment: "devnet" or "mainnet" (optional, defaults to "mainnet")
Network Configuration
The SDK supports two networks: mainnet (production, default) and devnet (development). URLs are automatically resolved based on the network.
Returns a UsersListResponse: { items: InstitutionUser[], pagination, totalCount? }.
4. Get Human Scores
Methodconnection.getHumanScores()
Description
Retrieve human scores with pagination or filtered by party IDs. Maps to GET /institutions/me/human-scores. Use getHumanScoreByPartyId(partyId) for a single party.
Parameters (optional)
offset, limit – pagination (when not using partyIds)
partyIds – array of party IDs to get human scores for
Example
Example (by party IDs):
// By party IDsconst result =await connection.getHumanScores({ partyIds:['party::user1','party::user2'],});for(const item of result.items){console.log(item.partyId,'Score:', item.humanScore.totalScore);}
Returns the human score calculation for the authenticated user. Example:
{"totalScore":91,"confidenceLevel":"high","breakdown":{"accountAgeScore":35,"socialMetricsScore":16,"emailConsistencyScore":20,"providerCountScore":20},"badges":[{"id":"account-age-veteran","name":"Veteran","description":"Verified account older than 10 years","level":"platinum","category":"Account Age"},{"id":"email-perfect","name":"Perfect","description":"Same email across all providers","level":"platinum","category":"Email Consistency"},{"id":"provider-all-star","name":"All-Star","description":"Connected 5+ verification providers","level":"platinum","category":"Provider Count"},{"id":"verified-status-verified","name":"Verified","description":"Has at least one verified account","level":"gold","category":"Verified Status"},{"id":"developer-beginner","name":"Beginner","description":"1+ public repositories","level":"bronze","category":"Developer Activity"}],"details":{"accountAges":[{"provider":"GITHUB","ageInDays":4129},{"provider":"DISCORD","ageInDays":99},{"provider":"TWITTER","ageInDays":82}],"socialMetrics":[{"provider":"GITHUB","ageInDays":4129,"email":"user@example.com","accountCreatedAt":"2014-09-27T08:47:46.000Z","githubRepos":1,"githubFollowers":6,"followingCount":5},{"provider":"DISCORD","ageInDays":99,"email":"user@example.com","accountCreatedAt":"2025-10-09T08:13:32.713Z","verified":true},{"provider":"TWITTER","ageInDays":82,"email":"@username","accountCreatedAt":"2025-10-25T18:11:26.000Z","followersCount":8,"followingCount":1,"postsCount":0,"verified":false}],"emailConsistency":{"uniqueEmails":["user@example.com"],"consistencyScore":20},"providerCount":5,"allUserInfo":[],"allTokenClaims":[]}}
6. Get All Institution Credentials
Methodconnection.getCredentials()
Description
Retrieve all approved credentials that your institution has access to, with pagination and/or filter by party IDs. Returns credentials with freshness status and metadata. Maps to GET /institutions/me/credentials.
Parameters (optional)
offset – number of records to skip (default: 0)
limit – maximum number of records to return (default: 10)
partyIds – array of party IDs to filter by (optional)
Example
Get all credentials with default pagination:
// Get first page (default: offset=0, limit=10)const allCredentials =await connection.getCredentials();console.log(allCredentials.items);// Array of credentialsconsole.log(allCredentials.pagination);// { offset, limit, total }
Get credentials with custom pagination:
// With paginationconst page2 =await connection.getCredentials({ offset:10, limit:20,});
Response
Returns a CredentialsListResponse object containing an array of credentials and pagination information.
kycStatus – status of the credential (APPROVED, REJECTED, etc.)
expirationDate – when the credential expires
issuedAt – when the credential was issued
freshness – freshness status (FRESH, MODERATE, STALE, REVOKED)
metadata – provider-specific credential data
pagination – pagination information:
offset – current offset
limit – number of items per page
total – total number of credentials available
Note
For additional details including request headers, query parameters, and cURL examples, see the corresponding endpoint in the API Reference section.
7. Get Credential by Party ID
Methodconnection.getCredentialByPartyId()
Description
Get credentials disclosed by a specific user to your institution. Returns an array of all credentials for the specified party ID. Maps to GET /institutions/me/credentials/:partyId.
For additional details including request headers, path parameters, and cURL examples, see the corresponding endpoint in the API Reference section.
8. Resolve Credentials
Methodconnection.resolveCredentials()
Description
Institution-only. Resolve credentials using a single method. The behavior depends on the options provided: use `q` (email/username/domain) for forward lookup, `partyId` for reverse lookup, or `a` for alias lookup (purchased alias/FQDN). This is a unified method that automatically determines the lookup based on provided options.
- q – email address, username, or domain for forward lookup (case-insensitive)
- partyId – party ID for reverse lookup (e.g., "party::12200d35764b9b490251e499af00626b54516c4f3f1c021c2eb72bf7c72f38662cb0")
- a – purchased alias/FQDN for alias lookup (e.g., "alice.5n.xyz")
Note: Provide exactly one of q, partyId, or a.
Example
Example:
importidSdkfrom'@fivenorth/id-sdk';const connection =await idSdk.connect({ clientId:'YOUR_CLIENT_ID', clientSecret:'YOUR_CLIENT_SECRET', network:'mainnet'// or 'devnet'});// Forward lookup: Find credentials by email or usernameconst result1 =await connection.resolveCredentials({ q:'user@example.com'});console.log('Found credentials:', result1.credentials);console.log('Party ID:', result1.credentials[0]?.partyId);// Reverse lookup: Find all credentials by party IDconst result2 =await connection.resolveCredentials({ partyId:'party::12200d35764b9b490251e499af00626b54516c4f3f1c021c2eb72bf7c72f38662cb0'});console.log('All credentials for this party:', result2.credentials);// Alias lookup: Resolve by purchased alias/FQDNconst result3 =await connection.resolveCredentials({ a:'alice.5n.xyz'});console.log('Credentials resolved by alias:', result3.credentials);
Response
Returns a ResolveCredentialsResponse object containing an array of credentials. Each credential includes partyId, userId, email, username, kycProvider, contractId, and metadata.
Forward lookup (q option): Search is case-insensitive and matches against both email and username fields
Reverse lookup (partyId option): Returns all credentials associated with the party ID across all providers
Alias lookup (a option): Resolves alias/FQDN to party ID first, then returns credentials for that party
Only returns credentials that the institution has approved access to
Returns empty array if no matches found
Can return multiple credentials if user has multiple providers
Throws an error if more than one lookup parameter is provided, or if none is provided
Note
Calls GET /institutions/me/credentials/resolve. The SDK also provides convenience methods resolve(query), reverseResolve(partyId), and resolveByAlias(alias). For additional details see the API Reference section.
9. Create Credentials Request
Methodconnection.createCredentialsRequest()
Description
Request credentials from a user by creating a credentials access request (proposal). This sends a request to the user to share their credentials. Maps to POST /institutions/me/credentials/request.
Parameters
partyId – the party ID of the user whose credentials you are requesting (required)
Returns void on success. Indicates that a proposal was successfully created for the user.
10. Generate Verification Link
Methodconnection.generateVerificationLink()
Description
Generate a short-lived verification link for a specific credential. The link can be shared with third parties to verify the credential status.
Parameters
contractId – the contract ID of the specific credential (required)
Example
Generate a verification link:
const verification =await connection.generateVerificationLink({ contractId:'008cb3c4e71260967ef...',});console.log(verification.verificationUrl);// URL to shareconsole.log(verification.token);// Token for status checking
Response
Returns a GenerateVerificationLinkResponse object containing verificationUrl and token.
11. Generate Verification Links (Batch)
Methodconnection.generateVerificationLinksBatch()
Description
Generate verification links for multiple credentials in a single request. Useful for bulk verification operations. Maximum 100 requests per batch. Each item is processed independently - partial failures are returned in the response.
Parameters
requests – array of verification link requests (required, max 100 items)
Returns a BatchGenerateVerificationLinkResponse object containing an array of results. Each result contains either a verification link response or an error for failed requests.
12. Check Verification Status
Methodconnection.checkVerificationStatus()
Description
Check the verification status for a verification token. This is a public endpoint (no authentication required) and is typically used by third parties who received a verification link.
Parameters
token – the verification token from the verification URL (required)
Example
Check verification status (public endpoint, no authentication required):
const status =await connection.checkVerificationStatus('verification-token');console.log(status.status);// 'strong', 'moderate', 'weak', etc.console.log(status.color);// 'green', 'amber', 'red'console.log(status.isActive);// booleanconsole.log(status.credentialData);// Original credential metadata
Response
Returns a VerificationStatusResponse object containing status, color, isActive flags, credential data, and other verification information.