Skip to main content

Standard Response Format

All Zyrix API functions return a consistent tuple pattern:

Response Components

Success (Boolean)

Indicates whether the operation completed successfully:

Status (String)

Provides specific information about the operation result:

Success Status Codes

  • 'success' - Operation completed successfully
  • 'completed' - Alternative success indicator for some functions

Error Status Codes

  • 'no_permission' - Staff member lacks required permissions
  • 'invalid_staff' - Invalid staff ID or staff member not found
  • 'invalid_target' - Invalid target player ID
  • 'player_not_found' - Target player is not online
  • 'player_not_connected' - Player has disconnected
  • 'insufficient_rank' - Staff rank too low for action
  • 'already_banned' - Player is already banned (ban functions)
  • 'not_banned' - Player is not banned (unban functions)
  • 'invalid_duration' - Invalid time duration specified
  • 'rate_limited' - Action blocked due to rate limiting
  • 'system_error' - Internal system error occurred

Data (Optional)

Some functions return additional data as the third parameter:

Response Examples

Simple Success Response

Error Response

Response with Data

Best Practices

1. Always Check Success Status

Never assume an operation succeeded without checking:

2. Handle Specific Error Cases

Provide appropriate responses for different error scenarios:

3. Use Data When Available

Extract and use returned data appropriately:

Function-Specific Patterns

Moderation Functions

Data Retrieval Functions

Toggle Functions

Consistent response patterns make it easier to build robust integrations. Always handle both success and error cases in your code.