Class: GrowsurfRuby::Resources::Account
- Inherits:
-
Object
- Object
- GrowsurfRuby::Resources::Account
- Defined in:
- lib/growsurf_ruby/resources/account.rb,
sig/growsurf_ruby/resources/account.rbs
Instance Method Summary collapse
-
#create(email:, company: nil, first_name: nil, last_name: nil, request_options: {}) ⇒ GrowsurfRuby::Models::AccountCreateResponse
Creates a new GrowSurf account.
-
#initialize(client:) ⇒ Account
constructor
private
A new instance of Account.
Constructor Details
#initialize(client:) ⇒ Account
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Account.
51 52 53 |
# File 'lib/growsurf_ruby/resources/account.rb', line 51 def initialize(client:) @client = client end |
Instance Method Details
#create(email:, company: nil, first_name: nil, last_name: nil, request_options: {}) ⇒ GrowsurfRuby::Models::AccountCreateResponse
Creates a new GrowSurf account. This is the only endpoint that does not require
an API key. The response includes an API key for the new account, shown once in
the response. The key is locked until the team owner's email address is
verified: authenticated program and resource endpoints return a 403 with error
code EMAIL_NOT_VERIFIED_ERROR until then (resend the email via POST /team/owner/verification-email, then retry). A welcome email is sent to the
address with the verification link and a set-password link for dashboard access.
Accounts whose email is never verified are deleted automatically after 7 days.
For security, the API key is rotated the first time the account owner signs in
to the GrowSurf dashboard. Some actions (such as emailing participants)
additionally require GrowSurf to verify the team first. By creating an account
you agree, on behalf of the account holder, to GrowSurf's Terms of
Service and Privacy
Policy.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/growsurf_ruby/resources/account.rb', line 36 def create(params) parsed, = GrowsurfRuby::AccountCreateParams.dump_request(params) [:extra_headers] = [:extra_headers].to_h.merge("authorization" => nil) @client.request( method: :post, path: "accounts", body: parsed, model: GrowsurfRuby::Models::AccountCreateResponse, options: ) end |