Account
Access your monday.com account information via the client.account resource.
What is an Account?
Your monday.com account represents your organization's account with billing, subscription, and account-level settings.
Methods
query
Retrieves your monday.com account information.
ruby
client.account.query(select: DEFAULT_SELECT)Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
select | Array | ["id", "name"] | Fields to retrieve |
Returns: Monday::Response
Response Structure:
The account is nested under users:
ruby
users = response.body.dig("data", "users")
account = users.first&.dig("account")Available Fields:
id- Account IDname- Account nameslug- Account URL slugplan- Subscription plan informationtier- Account tiercountry_code- Account country codefirst_day_of_the_week- Week start day preference
Example:
ruby
require "monday_ruby"
Monday.configure do |config|
config.token = ENV["MONDAY_TOKEN"]
end
client = Monday::Client.new
response = client.account.query(
select: ["id", "name", "slug", "country_code"]
)
if response.success?
users = response.body.dig("data", "users")
account = users.first&.dig("account")
puts "Account: #{account['name']}"
puts " ID: #{account['id']}"
puts " Slug: #{account['slug']}"
puts " Country: #{account['country_code']}"
endOutput:
Account: test-account
ID: 17545454
Slug: test-account-slug
Country: USGraphQL: query { users { account { ... } } }
Response Structure
All methods return a Monday::Response object. Access data using:
ruby
response.success? # => true/false
response.status # => 200
response.body # => Hash with GraphQL responseTypical Response Pattern
ruby
response = client.account.query(
select: ["id", "name", "plan"]
)
if response.success?
users = response.body.dig("data", "users")
account = users.first&.dig("account")
puts "Account: #{account['name']}"
puts "Plan: #{account['plan']['tier']}"
else
# Handle error
endConstants
DEFAULT_SELECT
Default fields returned by the account query:
ruby
["id", "name"]Error Handling
Common errors when working with accounts:
Monday::AuthorizationError- Invalid or missing API tokenMonday::Error- Invalid field requested
Example:
ruby
begin
response = client.account.query(
select: ["id", "name", "invalid_field"]
)
rescue Monday::Error => e
puts "Error: #{e.message}"
endSee the Error Handling guide for more details.
Use Cases
Check Account Information
ruby
response = client.account.query(
select: ["id", "name", "slug"]
)
if response.success?
users = response.body.dig("data", "users")
account = users.first&.dig("account")
puts "Connected to: #{account['name']}"
endVerify Account Tier
ruby
response = client.account.query(
select: ["id", "name", "tier"]
)
if response.success?
users = response.body.dig("data", "users")
account = users.first&.dig("account")
if account["tier"] == "enterprise"
puts "Enterprise account detected"
end
endGet Account Settings
ruby
response = client.account.query(
select: [
"id",
"name",
"country_code",
"first_day_of_the_week"
]
)
if response.success?
users = response.body.dig("data", "users")
account = users.first&.dig("account")
puts "Settings:"
puts " Country: #{account['country_code']}"
puts " Week starts: #{account['first_day_of_the_week']}"
endRelated Resources
- Workspace - Workspaces within your account
- Board - Boards in your account
- Client - Client authentication