Prerequisites
You can find your API key and project name in the Celesto Dashboard.
CELESTO_API_KEY: Your Celesto API keyCELESTO_PROJECT_NAME: Your project name
Quickstart script
Use this complete script to start a connection, list active connections, and list Drive files once OAuth completes.Expected responses
connect (redirect)
connect (connected)
list_connections
list_drive_files
error
How the flow works
Create a connection
You call
connect with a subject and project name. If the subject has not authorized yet, you receive an OAuth URL.You get
status: redirect and an oauth_url.Complete OAuth
You send your user to the OAuth URL and complete consent. The provider calls Celesto back to finalize the connection.
The connection becomes
ACTIVE for that subject.SDK methods
Python uses snake_case parameters (e.g.,
project_name, page_size). JavaScript uses camelCase (e.g., projectName, pageSize).connect
Signature:
Stable identifier for your end user (for example,
user:acme:alice)Your Celesto project name
Provider key. Use
google_drive for Google DriveOptional custom redirect URI after OAuth completion
list_connections
Signature:
Your Celesto project name
Filter by status:
ACTIVE, PENDING, or REVOKEDget_connection
Signature:
Delegated connection ID
list_drive_files
Signature:
Your Celesto project name
Subject identifier tied to the delegated connection
Number of files to return (1-1000)
Token from a previous response for pagination
Google Drive folder ID. Defaults to root unless
query is providedGoogle Drive search query (
q parameter)Include folders in the results
Google Drive
orderBy parameterIf access rules are active, a page may contain fewer than
page_size results after filtering. Use next_page_token to continue.update_access_rules
Signature:
Subject identifier (e.g.,
user:acme:alice)Your Celesto project name
List of Google Drive folder IDs with recursive access
List of individual Google Drive file IDs
Optional provider filter (e.g.,
google_drive)Setting both lists to empty blocks all access. Use
clear_access_rules to remove restrictions.clear_access_rules
Signature:
Delegated connection ID
revoke_connection
Signature:
Subject identifier (e.g.,
user:acme:alice)Your Celesto project name
Optional provider filter (e.g.,
google_drive)Troubleshooting
OAuth is not configured for the provider
OAuth is not configured for the provider
- Ensure Google OAuth is configured for delegated access in your Celesto settings.
- Verify you are using
provider="google_drive"and the correct project name.
Connection stays in PENDING
Connection stays in PENDING
- Make sure the user completed the OAuth flow in the browser.
- Check that the callback URL is reachable from the OAuth provider.
Next steps
- Review the Google OAuth setup guide in
superauth/google-oauth-setup. - Use
get_connectionto inspect scopes and last usage when you debug access.