Documentation Index
Fetch the complete documentation index at: https://docs.gateways.app/llms.txt
Use this file to discover all available pages before exploring further.
Activity Logs API
Overview
The Activity Logs API provides endpoints to retrieve and view user activity logs. All user actions (resource creation, updates, deletions, invocations, etc.) are automatically logged with timestamps, IP addresses, and metadata.Base Endpoint
Get User Activity Logs
Retrieve activity logs for the authenticated user. Endpoint:GET /api/activities
Authentication: Required
Query Parameters:
limit(optional): Number of activities to return (default: 100, max: 1000)offset(optional): Number of activities to skip for pagination (default: 0)projectSlug(optional): Filter activities by project slug. If provided,environmentSlugcan also be specified to filter by both project and environment.environmentSlug(optional): Filter activities by environment slug. RequiresprojectSlugto be specified.resourceType(optional): Filter activities by resource type (e.g.,function,instance,database,terminal)action(optional): Filter activities by action type (e.g.,create,update,delete,invoke)
401 Unauthorized: Missing or invalid authentication token500 Internal Server Error: Failed to retrieve activities
Get Project/Environment Activity Logs
Retrieve activity logs for a specific project and environment. Endpoint:GET /api/activities/:projectSlug/:environmentSlug
Authentication: Required
Query Parameters:
limit(optional): Number of logs to return (default: 100, max: 1000)offset(optional): Number of logs to skip for pagination (default: 0)resourceType(optional): Filter logs by resource typeaction(optional): Filter logs by action type
401 Unauthorized: Missing or invalid authentication token404 Not Found: Project or environment not found500 Internal Server Error: Failed to retrieve activities
Get Specific Activity Entry
Retrieve details of a specific activity entry. Endpoint:GET /api/activities/:id
Authentication: Required
Example Request:
400 Bad Request: Invalid activity ID401 Unauthorized: Missing or invalid authentication token403 Forbidden: Activity entry does not belong to the authenticated user404 Not Found: Activity entry not found500 Internal Server Error: Failed to retrieve activity
Activity Entry Structure
Each activity entry contains the following fields:| Field | Type | Description |
|---|---|---|
id | number | Unique log entry ID |
userId | number | ID of the user who performed the action (kept for backward compatibility) |
projectId | number | null | ID of the project (if action is project-related, kept for backward compatibility) |
environmentId | number | null | ID of the environment (if action is environment-related, kept for backward compatibility) |
user | object | null | User details object containing id, name, and profileImage |
project | object | null | Project details object containing slug and name |
environment | object | null | Environment details object containing slug and name |
resourceType | string | null | Type of resource (e.g., function, instance, database) |
resourceId | number | null | Database ID of the resource |
action | string | Action type (e.g., create, update, delete, invoke, sync) |
description | string | null | Human-readable description of the action |
metadata | object | null | Additional metadata (JSON object with action-specific data) |
createdAt | string | Timestamp when the action was performed (ISO 8601) |
user, project, and environment fields may be null if the related entity doesn’t exist or was deleted.
Action Types
Common action types that are logged:create: Resource creation (functions, instances, databases, etc.)update: Resource updates (code changes, configuration changes, etc.)delete: Resource deletioninvoke: Function invocationsync: Resource synchronization with cloud providerconnect: Resource connection creationdisconnect: Resource connection deletion
Resource Types
Common resource types that are logged:function: Serverless functions (Lambda)instance: EC2 instancesdatabase: RDS databasesstorage_bucket: S3 bucketsstatic_website: Static websitesfirewall: Security groupscache_server: ElastiCache servers
Filtering Examples
Get all function-related activities
Get all create actions
Get activities for a specific project
Get activities for a specific project and environment
Combine multiple filters
Pagination
The activities API supports pagination usinglimit and offset parameters:
limit: Maximum number of logs to return (default: 100, max: 1000)offset: Number of logs to skip (default: 0)
total: Total number of logs matching the filterslimit: Number of logs returned in this responseoffset: Offset used for this requesthasMore: Boolean indicating if there are more logs available
Automatic Logging
The following actions are automatically logged:Functions
- ✅ Function creation
- ✅ Function updates (code, handler, description)
- ✅ Function deletion
- ✅ Function invocation
- ✅ Function synchronization
Other Resources
Logging for other resource types (instances, databases, etc.) can be added by importing and using the activity logger utility in their respective route files.Notes
- Activities are stored permanently and are not automatically deleted
- Users can only view their own activities
- Activities include IP addresses and user agents for security auditing
- Metadata field contains JSON data with action-specific information
- Activities are ordered by creation time (newest first) by default