config.babamul.enabled, it allows users to sign up, authenticate, and query alert streams from surveys like ZTF and LSST.
Babamul must be enabled in your configuration file to use these endpoints. Set
babamul.enabled: true in config.yaml.Account Management
Sign up for account
Create a new Babamul account using an email address. An activation code will be sent to your email.Request
Valid email address for the account. Must be unique.
Response
Success message with next steps
Whether activation is required (always
true)Activate account
Activate your Babamul account using the activation code sent to your email. Upon successful activation, you’ll receive your password.Request
Email address used during signup
Activation code received via email
Response
Success message
Whether the account is activated
Generated username (derived from email)
Account email address
Generated password (only returned once on initial activation)
Authenticate
Authenticate with email and password to receive a JWT access token.Request
Account email address (can also use
username field)Account password
Response
JWT access token for authenticating subsequent requests
Token type (always
Bearer)Token expiration time in seconds
Get user profile
Retrieve the authenticated user’s profile information.Response
User ID (UUID)
Username
Email address
Account creation timestamp (Unix timestamp)
Password Reset
Request password reset
Request a password reset link. A reset token will be sent to the email if an activated account exists.Request
Email address of the account
The response is always the same to prevent account enumeration. If the email exists and the account is activated, a reset link will be sent.
Reset password
Reset your password using the reset token received via email.Request
Account email address
Password reset token received via email
New password meeting complexity requirements:
- At least 12 characters
- At least one uppercase letter
- At least one lowercase letter
- At least one digit
- At least one special character
Password resets are rate-limited to once every 15 minutes (configurable via
babamul.password_reset_cooldown_minutes).Kafka Credentials
Kafka credentials allow you to consume alert streams directly from Kafka topics.Create Kafka credential
Create a new Kafka credential for consuming alert streams.Request
User-defined name for the credential
Response
Credential ID (UUID)
User-defined name
Kafka username (format:
babamul-{credential_id})Kafka password (only returned on creation - save it securely!)
Creation timestamp (Unix timestamp)
List Kafka credentials
Retrieve all Kafka credentials for the authenticated user.Response
Returns an array of Kafka credential objects including decrypted passwords.Delete Kafka credential
Delete a Kafka credential and revoke its access to Kafka topics.Path parameters
ID of the Kafka credential to delete
API Tokens
API tokens provide long-lived authentication for programmatic access.Create API token
Create a new API token for the authenticated user.Request
User-defined name for the token
Token expiration in days (1-1095, i.e., up to 3 years)
Response
Token ID (UUID)
Token name
API token (format:
bbml_...) - save this securely!Creation timestamp
Expiration timestamp
You can create up to 10 API tokens per user. Delete unused tokens to free up space.
List API tokens
Retrieve all API tokens for the authenticated user.Response
Returns an array of token objects (without the actual token values).Token ID
Token name
Creation timestamp
Expiration timestamp
Last usage timestamp (if token has been used)
Delete API token
Revoke an API token by deleting it.Path parameters
ID of the token to delete
Survey Data Access
Query alerts
Query alerts from a survey’s alert stream with flexible filtering options.Path parameters
Survey name:
ztf or lsstQuery parameters
You must provide at least one of:object_id, or (ra, dec, radius_arcsec), or a time range less than 1 Julian Date.
Object ID to filter alerts
Right Ascension in degrees for cone search
Declination in degrees for cone search
Search radius in arcseconds (max 600)
Start Julian Date for time range filter
End Julian Date for time range filter
Minimum PSF magnitude
Maximum PSF magnitude
Minimum DRB/reliability score
Filter for likely rock candidates
Filter for likely star candidates
Maximum number of alerts to return (1-100000)
Number of alerts to skip for pagination
For ZTF, only public alerts (programid=1) are returned through Babamul.
Get object by ID
Retrieve detailed information about a specific object including its photometric history and cross-matches.Path parameters
Survey name:
ztf or lsstObject identifier
Response
Returns detailed object information including:- Most recent candidate/alert data
- Full photometric history (previous candidates and forced photometry)
- Cross-matches with other catalogs
- Survey-to-survey matches (e.g., ZTF object matched to LSST)
- Properties and classifications
Search objects
Search for objects by partial object ID.Query parameters
Partial object ID to search (supports ZTF and LSST naming)
Maximum results (1-100)
Get cutouts
Retrieve image cutouts (science, template, difference) for an alert.Path parameters
Survey name:
ztf or lsstQuery parameters
Must provide eithercandid OR objectId:
Alert candidate ID
Object ID (uses
which parameter to select alert)Which alert to use when querying by objectId:
first, last, brightest, or faintestFilter band to retrieve (e.g.,
g, r, i)Response
Alert candidate ID
Base64-encoded FITS cutout of science image
Base64-encoded FITS cutout of template image
Base64-encoded FITS cutout of difference image
Get Avro schema
Retrieve the Avro schema used for encoding alerts in Kafka streams.Path parameters
Survey name:
ztf or lsstThis endpoint does not require authentication as schemas are public.
Configuration
Babamul is configured inconfig.yaml:
Best practices
- Secure credentials - Store passwords and API tokens securely using environment variables or secret managers
- Use API tokens - For programmatic access, use long-lived API tokens instead of passwords
- Limit Kafka credentials - Only create Kafka credentials when needed for streaming access
- Monitor usage - Track
last_used_attimestamps on tokens to identify unused credentials - Filter efficiently - Use indexed fields (objectId, coordinates) for faster queries
- Batch requests - Use cone-search endpoints for querying multiple positions efficiently
- Respect rate limits - Be mindful of query limits and pagination for large result sets