What is Nanoid?
A nanoid is a unique, URL-friendly identifier that follows a specific format: prefix + hyphen + 12-character random string. All nanoids in Rise are exactly 15 characters long and use a standardized prefix system to identify the entity type.Nanoid Format
te-abc123def456
(15 characters total)
Core Entity Nanoids
The primary entity types in Rise each have their own nanoid format:Team Nanoid
Format:
Example:
te-abc123def456
Example:
te-xyz789abc123
Company Nanoid
Format:
Example:
co-abc123def456
Example:
co-def456ghi789
User Nanoid
Format:
Example:
us-abc123def456
Example:
us-ghi789jkl012
Complete Nanoid Reference
Here are all the nanoid types used in Rise B2B API:Core Entities
Entity Type | Prefix | Format | Example | Description |
---|---|---|---|---|
Team | te | te-abc123def456 | te-xyz789abc123 | Team or department |
Company | co | co-abc123def456 | co-def456ghi789 | Organization |
User | us | us-abc123def456 | us-ghi789jkl012 | Individual user |
Financial & Operational Entities
Entity Type | Prefix | Format | Example | Description |
---|---|---|---|---|
Payment | pa | pa-abc123def456 | pa-pay123def456 | Individual payment |
Payment Group | pg | pg-abc123def456 | pg-grp123def456 | Batch payment group |
Invite | in | in-abc123def456 | in-inv123def456 | User invitation |
Nanoid Usage in API
Entity Balance API
The most common usage is in the entity balance endpoint:Team Management API
Team operations use team nanoids:Payments API
Payment operations use payment nanoids:Invites API
Invite management uses invite nanoids:Nanoid Validation
When working with nanoids, you should validate their format before making API calls:Validation Rules
- Length: Must be exactly 15 characters
- Format: Must follow the pattern
[prefix]-[12 random characters]
- Prefix: Must start with a valid prefix (
te-
,co-
,us-
,pa-
,pg-
,in-
)
Client-Side Validation
Error Handling
Common errors when working with nanoids:Error | Description | Solution |
---|---|---|
Invalid nanoid format | Nanoid doesn’t match expected pattern | Ensure nanoid is 15 characters with valid prefix |
Entity not found | Nanoid doesn’t exist in system | Verify the nanoid exists and is correct |
Permission denied | User lacks access to entity | Check user permissions for the entity |
Invalid entity type | Nanoid type doesn’t match expected type | Verify you’re using the correct nanoid type |
Common Error Scenarios
Invalid Nanoid Format:Best Practices
Validation
Always validate nanoid format before using
Documentation
Document which nanoid types your integration uses
Security
Never expose nanoid generation logic to clients
Caching
Cache nanoid lookups for performance
Security Considerations
- Client-side validation: Always validate nanoid format before making API calls
- No sequential patterns: Nanoids are cryptographically random
- Prefix validation: Always validate the prefix matches expected entity type
- Length validation: Ensure nanoids are exactly 15 characters
Performance Tips
- Batch operations: Use batch endpoints when working with multiple nanoids
- Caching: Cache frequently accessed nanoid lookups
- Validation: Validate nanoid format early to avoid unnecessary API calls
Related Concepts
RiseID
Understanding RiseID for authentication
Entity Balance
Balance management with nanoid
Teams
Team management concepts
Permissions
Understanding access control
Nanoid vs RiseID: Remember that nanoids are used for API operations and database references, while RiseID is used for authentication and smart contract interactions.