Skip to main content

Get User Account

Retrieves the current user's Stability AI account information.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - The connection ID from the Connect node (optional if API Key is provided directly).

Options

  • API Key - Stability AI API key (optional if using Connection ID). You can provide the API key directly instead of using a Connect node.

Output

  • User Account - Object containing user account details including:
    • Email address
    • User ID
    • Organization information
    • Profile information
    • Account status
    • Other account-related metadata

How It Works

The Get User Account node retrieves account information from Stability AI. When executed, the node:

  1. Validates the connection or creates a temporary client using provided credentials
  2. Sends a request to the Stability AI user account endpoint
  3. Retrieves the account information
  4. Returns the account details as a structured object

Requirements

  • Either a valid Connection Id from Connect node OR direct API Key credentials
  • Active Stability AI account with API access
  • Valid API key with appropriate permissions

Error Handling

The node will return specific errors in the following cases:

  • Invalid or missing credentials (both Connection Id and API Key are empty)
  • Connection not found (when using Connection Id)
  • API authentication errors (401) - Invalid API key
  • API authorization errors (403) - Insufficient permissions
  • API rate limit errors (429)
  • API service errors (500, 503)

Usage Notes

  • You can use this node in two ways:
    1. With Connect node: More efficient for multiple operations
    2. With direct API key: Simpler for single operations
  • The account information helps verify API key ownership
  • Useful for account validation before processing
  • Can be used to display user information in reports or dashboards
  • Account information includes the email associated with the API key

Examples

Example 1: Basic Account Retrieval

Inputs:

  • Connection Id: (from Connect node)

Flow:

Connect → Get User Account → Display account info

Output Example:

{
"email": "user@example.com",
"id": "user-abc123",
"organizations": [...],
"profile_picture": "https://...",
...
}

Use Case: Verify account information at the start of a flow


Example 2: Account Validation

Inputs:

  • Connection Id: (from Connect node)

Flow:

Connect
→ Get User Account
→ Check if email matches expected
→ If valid: proceed with operations
→ If invalid: raise error

Use Case: Validate that the correct API key is being used


Example 3: Using Direct API Key

Options:

  • API Key: (your credential)

Flow:

Get User Account → Process account data

Use Case: Quick account check without setting up Connect node


Example 4: RPA Use Case - Account Info in Report

Flow:

Connect
→ Get User Account
→ Get User Credit
→ Generate batch images
→ Create summary report (include account email and credits used)
→ Send report via email

Use Case: Include account information in automated reports


Example 5: RPA Use Case - Multi-Account Management

Flow:

Read list of API keys from vault
→ For each API key:
→ Get User Account
→ Get User Credit
→ Store account info and credits
→ Generate account status report
→ Send to admin

Use Case: Monitor multiple Stability AI accounts


Example 6: RPA Use Case - Account Health Check

Flow:

Scheduled trigger (daily)
→ Connect
→ Try: Get User Account
→ If successful: Account active
→ If error 401: API key invalid - send alert
→ If error 403: Permission issue - send alert
→ Log status to monitoring system

Use Case: Monitor API key health and account status


Example 7: Debugging and Troubleshooting

Flow:

Connect
→ Get User Account
→ Log account details
→ Check organization access
→ Proceed with operations

Use Case: Debug authentication or permission issues

Best Practices

  1. Account Verification:

    • Use at the start of critical flows to verify credentials
    • Check account email matches expected user
    • Validate before expensive operations
  2. Error Handling:

    • Always handle authentication errors gracefully
    • Implement retry logic for transient errors
    • Log account validation failures
  3. Security:

    • Don't log sensitive account information
    • Use credentials securely stored in vault
    • Avoid displaying full account details in UI
  4. Monitoring:

    • Periodically check account status
    • Monitor for unexpected account changes
    • Alert on authentication failures
  5. Efficiency:

    • Cache account info if used multiple times
    • Don't call unnecessarily on every operation
    • Combine with other account operations (e.g., GetUserCredit)

Tips for RPA Developers

  • Pre-flight Checks: Use as validation before batch operations
  • Account Switching: Validate when switching between multiple API keys
  • Error Diagnosis: Call when troubleshooting authentication issues
  • Audit Logging: Include account email in operation logs for audit trail
  • Multi-tenant Systems: Use to identify which account performed operations
  • Access Control: Verify account has expected permissions before proceeding

Common Account Fields

Based on typical Stability AI API responses, the account object may include:

  • email - Account email address
  • id - Unique user identifier
  • profile_picture - URL to profile image
  • organizations - Array of organization memberships
  • payment_info - Payment method information
  • created_at - Account creation timestamp

Note: Exact fields may vary based on Stability AI API version and account type.

Integration Examples

Example: Account + Credit Check Flow

Flow:

Connect
→ Get User Account (verify account)
→ Get User Credit (check balance)
→ If credits > threshold:
→ Proceed with generation
→ Else:
→ Send low credit alert
→ Skip generation

Benefits:

  • Validates account before checking credits
  • Ensures API key is valid and active
  • Provides complete account context

Example: Account Info in Error Messages

Flow:

Try:
Connect
→ Get User Account
→ Store account email in variable
→ Perform operations
Catch:
→ Send error email with account info
→ "Error in automation for account: {account.email}"

Benefits:

  • Better error reporting
  • Easier troubleshooting
  • Clear audit trail

Common Errors and Solutions

Error: "Failed to get user account information" (401)

  • Solution: API key is invalid or expired - verify API key in vault
  • Solution: Generate new API key from platform.stability.ai

Error: "Failed to get user account information" (403)

  • Solution: API key lacks necessary permissions
  • Solution: Check account status on Stability AI platform

Error: "Connection not found"

  • Solution: Ensure Connect node ran successfully before this node
  • Solution: Verify Connection Id is being passed correctly

API returns empty or null

  • Solution: Check API key has proper permissions
  • Solution: Verify network connectivity to Stability AI
  • Connect - Establishes connection needed for this node
  • Get User Credit - Gets credit balance (often used together)
  • Get Engines List - Gets available engines for the account
  • Disconnect - Cleans up connection after use