Embed Tokens API
Manage tokens for securely embedding widgets on external websites
Overview
Embed tokens provide secure access to the EventNerds public embed API for displaying event widgets (schedules, speakers, sessions) on external websites. Unlike API keys which are for server-to-server communication, embed tokens are designed for client-side use in embedded widgets.
Security model
- One-time visibility: The full token is only returned once at creation
- Domain restrictions: Tokens can be restricted to specific origins
- Soft delete: Revoked tokens cannot be restored
- Usage tracking: Each token tracks usage count and last used time
Endpoints
List embed tokens
/embed-tokensGet a paginated list of embed tokens for your account. The full token value is never returned - only the prefix is shown for identification.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
event_id | UUID | No | Filter by event ID |
page | Integer | No | Page number (default: 1) |
limit | Integer | No | Items per page (default: 50) |
Example request
curl -X GET "https://eventnerds.com/api/developer/v1/embed-tokens?event_id=EVENT_ID" \
-H "Authorization: Bearer YOUR_API_KEY"Create embed token
/embed-tokensCreate a new embed token. The full token is only returned in this response - store it securely as it cannot be retrieved again.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
eventId | UUID | Yes | Event this token provides access to |
name | String | Yes | Friendly name (1-100 characters) |
allowedOrigins | String[] | No | URLs where token can be used |
expiresAt | ISO 8601 | No | Token expiration date |
Example request
curl -X POST "https://eventnerds.com/api/developer/v1/embed-tokens" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"eventId": "EVENT_ID",
"name": "Production Website",
"allowedOrigins": ["https://example.com", "https://www.example.com"]
}'Example response
{
"success": true,
"data": {
"id": "token-uuid",
"event_id": "event-uuid",
"name": "Production Website",
"prefix": "emb_abc123...",
"token": "emb_abc123def456ghi789...",
"is_active": true,
"allowed_origins": ["https://example.com"],
"created_at": "2025-01-15T10:00:00Z",
"expires_at": null
}
}Important
The token field is only returned at creation. Store it securely - it cannot be retrieved again.
Update embed token
/embed-tokens/{id}Update an embed token's settings. Cannot change the token value itself.
Request body
| Field | Type | Description |
|---|---|---|
name | String | New friendly name |
allowedOrigins | String[] | New allowed origins list |
isActive | Boolean | Enable or disable the token |
Example request
curl -X PATCH "https://eventnerds.com/api/developer/v1/embed-tokens/TOKEN_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Name",
"allowedOrigins": ["https://newdomain.com"],
"isActive": false
}'Revoke embed token
/embed-tokens/{id}Revoke an embed token. This is a soft delete that disables the token immediately. Any websites using this token will no longer be able to display the embedded widgets.
Example request
curl -X DELETE "https://eventnerds.com/api/developer/v1/embed-tokens/TOKEN_ID" \
-H "Authorization: Bearer YOUR_API_KEY"Using embed tokens
Once you have created an embed token, use it to authenticate requests to the public embed API. The token is passed in the Authorization header or directly in the embed component attributes.
Web component example
<!-- HTML Embed Example -->
<script src="https://eventnerds.com/embed/v1/loader.js" async></script>
<eventnerds-schedule
event-id="YOUR_EVENT_ID"
token="emb_your_token_here"
></eventnerds-schedule>Available widgets
eventnerds-schedule- Full event schedule with day tabs and track filteringeventnerds-session-list- Simplified session list vieweventnerds-session-detail- Single session detail vieweventnerds-speakers- Speaker gallery (grid, list, or carousel)eventnerds-speaker-card- Individual speaker profile cardeventnerds-registration- Event registration form
Best practices
Use descriptive names
Name tokens by environment or website (e.g., "Production Website", "Staging Environment") to easily identify their purpose.
Restrict origins
Always specify allowed origins for production tokens to prevent unauthorized use on other websites.
Monitor usage
Check usage counts regularly to identify unused tokens that can be revoked.
Rotate tokens
Create new tokens and revoke old ones periodically as a security best practice.