API Stability Long-Term

The activateAccount() GraphQL mutation is used to activate a user account, supplying additional personal information. By activating the account, the client accepts LogScale's Terms and Conditions.

For more information on user authorization, see the Manage users & permissions documentation page.

Syntax

Below is the syntax for the activateAccount() mutation field:

graphql
activateAccount(
      firstName: string!,
      lastName: string!,
      email: string!,
      company: string!,
      countryCode: string!,
      stateCode: string,
      zip: string,
      phoneNumber: string,
      utmParams: UtmParams
    ): Account!

Below is an example of how this mutation field might be used:

Raw
graphql
mutation {
  activateAccount(firstName: "Tom", lastName: "Thumb", 
                  company: "Company, Inc.",
                  email: "tom@company.com"
                  countryCode: "us") 
  { id, currentOrganization { id, name } }
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  activateAccount(firstName: \"Tom\", lastName: \"Thumb\", 
                  company: \"Company, Inc.\",
                  email: \"tom@company.com\"
                  countryCode: \"us\") 
  { id, currentOrganization { id, name } }
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  activateAccount(firstName: \"Tom\", lastName: \"Thumb\", 
                  company: \"Company, Inc.\",
                  email: \"tom@company.com\"
                  countryCode: \"us\") 
  { id, currentOrganization { id, name } }
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "mutation { ^
  activateAccount(firstName: \"Tom\", lastName: \"Thumb\",  ^
                  company: \"Company, Inc.\", ^
                  email: \"tom@company.com\" ^
                  countryCode: \"us\")  ^
  { id, currentOrganization { id, name } } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  activateAccount(firstName: \"Tom\", lastName: \"Thumb\", 
                  company: \"Company, Inc.\",
                  email: \"tom@company.com\"
                  countryCode: \"us\") 
  { id, currentOrganization { id, name } }
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $INGEST_TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $json = '{"query" : "mutation {
  activateAccount(firstName: \"Tom\", lastName: \"Thumb\", 
                  company: \"Company, Inc.\",
                  email: \"tom@company.com\"
                  countryCode: \"us\") 
  { id, currentOrganization { id, name } }
}"
}';
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "mutation {
  activateAccount(firstName: \"Tom\", lastName: \"Thumb\", 
                  company: \"Company, Inc.\",
                  email: \"tom@company.com\"
                  countryCode: \"us\") 
  { id, currentOrganization { id, name } }
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "mutation {
  activateAccount(firstName: \"Tom\", lastName: \"Thumb\", 
                  company: \"Company, Inc.\",
                  email: \"tom@company.com\"
                  countryCode: \"us\") 
  { id, currentOrganization { id, name } }
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL/graphql',
  path: '/graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "activateAccount": {
      "id": "jSl8Iz25KhDiPQzXYE6YDetG",
      "currentOrganization": {
        "id": "SINGLE_ORGANIZATION_ID",
        "name": "SingleOrganization"
      }
    }
  }
}

Given Datatypes

All of the input datatypes are strings except for UtmParams. This datatype has a few parameters. Below is a list of them:

Table: UtmParams

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 23, 2024
campaignstringyes Long-TermThe name of the specific product promotion or strategic marketing campaign related to the UTM (Urchin Tracking Module).
contentstringyes Long-TermWhat was clicked by the user leading to the server (e.g., a banner ad or text link).
mediumstringyes Long-TermThe medium used for the UTM: the type of link used (e.g., cost per click).
sourcestringyes Long-TermWhich site sent the traffic to the server.
termstringyes Long-TermThe search term related to the UTM.

Returned Datatypes

As indicated by the syntax above, this mutation will return data using the input type, Account. This datatype includes several additional parameters for values that may be returned. Below is a list of them:

Table: Account

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Nov 12, 2024
announcementNotification  Long-TermAny announcements for the account. See Notification.
canCreateCloudTrialRepobooleanyes Long-TermWhether the account may create a cloud trial repository.
canCreateRepobooleanyes Long-TermWhether the account can create a repository.
companystring  Long-TermThe name of the company for the account.
countryCodestring  Long-TermThe two-letter ISO 3166-1 Alpha-2 code for the country of residence (e.g., us).
createdAtdatetimeyes Long-TermThe data and time the account was created.
currentOrganizationOrganizationyes Long-TermInformation on the Organization. See Organization.
emailstring  Long-TermThe account's email address for communications from LogScale.
enabledFeaturesForAccount[FeatureFlag]yes Long-TermFeatures that are enabled for the account. See FeatureFlag.
externalGroupSynchronizationbooleanyes Long-TermWhether there is group synchronization.
externalPermissionsbooleanyes Long-TermWhether permissions are managed externally.
fieldConfigurationsmultipleyes Long-TermThe name of the view, as well as fields and how to configure them. The multiple datatype consists of (viewName: string): [FieldConfiguration]. See FieldConfiguration.
firstNamestring  Long-TermThe user's actual first name (e.g., Bob). Don't use with fullName.
fullNamestring  Long-TermThe user's full name (e.g., Bob Smith). Don't use if using other name parameters.
idstringyes Long-TermThe unique identifier for the account.
isCloudProAccountbooleanyes Long-TermWhether the account is a cloud professional account.
isOrganizationRootbooleanyes Long-TermWhether the organization is granted root access.
isRootbooleanyes Long-TermWhether the account is granted root access.
lastNamestring  Long-TermThe user's actual last name or family name (e.g., Smith). Don't use with fullName.
notificationsV2multipleyes PreviewNotifications for account. The multiple datatype consists of (typeFilter: [NotificationTypes], orderBy: OrderBy, skip: integer, limit: integer): NotificationsResultSet. See NotificationTypes and NotificationsResultSet. This is a preview and subject to change. New sorting and filtering options might be added.
phoneNumberstring  Long-TermThe telephone number for LogScale to use for telephone text messages.
picturestring  Long-TermFile name of an image file for the account.
settingsUserSettingsyes Long-TermVarious default settings for user accounts. See UserSettings.
stateCodestring  Long-TermThe two-letter, ISO 3166-2 country sub-division code for the state of residence (e.g., ny).
tokenPersonalUserToken  Long-TermThe personal user token table for the account. See PersonalUserToken.
usernamestringyes Long-TermThe user name for the account.