Authentication
All endpoints require authentication via:
- Bearer token in
Authorization header, or
- Active session cookie
List Apps
curl https://ave.day/api/apps \
-H "Authorization: Bearer YOUR_TOKEN"
{
"apps": [
{
"id": "app_123",
"clientId": "app_abc123...",
"name": "My Application",
"description": "Application description",
"websiteUrl": "https://example.com",
"iconUrl": "https://example.com/icon.png",
"redirectUris": ["https://example.com/callback"],
"supportsE2ee": false,
"allowedScopes": ["openid", "profile", "email", "offline_access"],
"accessTokenTtlSeconds": 3600,
"refreshTokenTtlSeconds": 2592000,
"allowUserIdScope": false,
"createdAt": "2024-01-01T00:00:00.000Z",
"resources": [
{
"id": "res_123",
"resourceKey": "api:read",
"displayName": "API Access",
"description": "Read access to API",
"scopes": ["read", "write"],
"audience": "https://api.example.com",
"status": "active"
}
]
}
]
}
Returns all OAuth applications owned by the authenticated user, including associated resources.
Array of OAuth applications
OAuth 2.0 client ID (format: app_*)
Application name (2-64 characters)
Application description (max 200 characters)
Allowed OAuth redirect URIs
Whether app supports end-to-end encryption
Allowed OAuth scopes. Valid values: openid, profile, email, offline_access, user_id
Access token lifetime in seconds (300-86400)
Refresh token lifetime in seconds (3600-31536000)
Whether user_id scope is allowed
ISO 8601 timestamp of creation
Array of API resources associated with this app
Unique resource identifier
Resource key (3-100 chars, lowercase alphanumeric with :_-)
Display name (2-80 characters)
Resource description (max 240 characters)
Available scopes for this resource
JWT audience value for this resource
Resource status: active or disabled
Create App
curl -X POST https://ave.day/api/apps \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My Application",
"description": "My app description",
"redirectUris": ["https://example.com/callback"],
"allowedScopes": ["openid", "profile", "email"],
"accessTokenTtlSeconds": 3600
}'
{
"app": {
"id": "app_123",
"clientId": "app_abc123...",
"name": "My Application",
"description": "My app description",
"websiteUrl": null,
"iconUrl": null,
"redirectUris": ["https://example.com/callback"],
"supportsE2ee": false,
"allowedScopes": ["openid", "profile", "email"],
"accessTokenTtlSeconds": 3600,
"refreshTokenTtlSeconds": 2592000,
"allowUserIdScope": false,
"createdAt": "2024-01-01T00:00:00.000Z"
},
"clientSecret": "secret_xyz789..."
}
Creates a new OAuth application. Returns the app details and clientSecret (shown only once).
Application name (2-64 characters)
Application description (max 200 characters)
Application website URL (must be valid URL)
Application icon URL (must be valid URL)
OAuth redirect URIs (at least one required, must be valid URLs)
Whether app supports end-to-end encryption
Allowed OAuth scopes. Valid values: openid, profile, email, offline_access, user_id
Access token lifetime in seconds (300-86400)
Refresh token lifetime in seconds (3600-31536000, default 30 days)
Whether user_id scope is allowed
The created OAuth application (see List Apps for structure)
Client secret for OAuth authentication. Save this immediately - it cannot be retrieved later.
Update App
curl -X PATCH https://ave.day/api/apps/{appId} \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Name",
"redirectUris": ["https://example.com/new-callback"]
}'
{
"app": {
"id": "app_123",
"clientId": "app_abc123...",
"name": "Updated Name",
"description": "My app description",
"websiteUrl": null,
"iconUrl": null,
"redirectUris": ["https://example.com/new-callback"],
"supportsE2ee": false,
"allowedScopes": ["openid", "profile", "email"],
"accessTokenTtlSeconds": 3600,
"refreshTokenTtlSeconds": 2592000,
"allowUserIdScope": false,
"createdAt": "2024-01-01T00:00:00.000Z"
}
}
Updates an existing OAuth application. All fields are optional - only provided fields are updated.
Application name (2-64 characters)
Application description (max 200 characters)
OAuth redirect URIs (at least one required if provided)
Whether app supports end-to-end encryption
Access token lifetime in seconds (300-86400)
Refresh token lifetime in seconds (3600-31536000)
Whether user_id scope is allowed
The updated OAuth application
Delete App
curl -X DELETE https://ave.day/api/apps/{appId} \
-H "Authorization: Bearer YOUR_TOKEN"
Deletes an OAuth application. This also deletes all associated resources and active sessions.
Returns true on successful deletion
Rotate Client Secret
curl -X POST https://ave.day/api/apps/{appId}/rotate-secret \
-H "Authorization: Bearer YOUR_TOKEN"
{
"clientSecret": "secret_new789..."
}
Generates a new client secret for the app. The old secret is immediately invalidated.
App ID to rotate secret for
New client secret. Save this immediately - it cannot be retrieved later.
List Resources
curl https://ave.day/api/apps/{appId}/resources \
-H "Authorization: Bearer YOUR_TOKEN"
{
"resources": [
{
"id": "res_123",
"resourceKey": "api:read",
"displayName": "API Access",
"description": "Read access to API",
"scopes": ["read", "write"],
"audience": "https://api.example.com",
"status": "active",
"ownerAppId": "app_123",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
]
}
Returns all API resources for an OAuth application.
App ID to list resources for
Array of API resource objects
Create Resource
curl -X POST https://ave.day/api/apps/{appId}/resources \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"resourceKey": "api:read",
"displayName": "API Access",
"description": "Read access to API",
"scopes": ["read", "write"],
"audience": "https://api.example.com"
}'
{
"resource": {
"id": "res_123",
"resourceKey": "api:read",
"displayName": "API Access",
"description": "Read access to API",
"scopes": ["read", "write"],
"audience": "https://api.example.com",
"status": "active",
"ownerAppId": "app_123",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
}
Creates an API resource for an OAuth application. Resources define scopes and audiences for access tokens.
App ID to create resource for
Unique resource identifier (3-100 chars, lowercase alphanumeric with :_-)
Human-readable name (2-80 characters)
Resource description (max 240 characters)
Array of scope names (at least one required, 2-80 chars each)
JWT audience value for this resource (3-200 characters)
Resource status: active or disabled
Update Resource
curl -X PATCH https://ave.day/api/apps/{appId}/resources/{resourceId} \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"displayName": "Updated API Access",
"status": "disabled"
}'
{
"resource": {
"id": "res_123",
"resourceKey": "api:read",
"displayName": "Updated API Access",
"description": "Read access to API",
"scopes": ["read", "write"],
"audience": "https://api.example.com",
"status": "disabled",
"ownerAppId": "app_123",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-02T00:00:00.000Z"
}
}
Updates an API resource. All fields are optional.
Resource key (must be unique)
Display name (2-80 characters)
Resource description (max 240 characters)
Resource status: active or disabled
Delete Resource
curl -X DELETE https://ave.day/api/apps/{appId}/resources/{resourceId} \
-H "Authorization: Bearer YOUR_TOKEN"
Deletes an API resource.
Returns true on successful deletion