curl --request GET \
--url https://api.scrunchai.com/v1/account \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.scrunchai.com/v1/account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.scrunchai.com/v1/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrunchai.com/v1/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.scrunchai.com/v1/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.scrunchai.com/v1/account")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrunchai.com/v1/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"organization_id": "<string>",
"organization_name": "<string>",
"plan": "<string>",
"plan_display_name": "<string>",
"status": "active",
"current_period_start": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z"
}Get Account Status
Get the subscription state of the account this API key belongs to. Use status to tell a trial from a paid or churned account: trialing means the account is in its trial, and current_period_end is the date that trial ends. subscription_not_found means the account has no Stripe subscription on file, which is normal for manually invoiced accounts and is not a sign that the account lapsed. unknown means Scrunch cannot vouch for the account’s current state, either because its billing record is no longer being kept up to date or because it is in a state this endpoint does not publish yet; keep your current behavior rather than treating it as a lapse.
curl --request GET \
--url https://api.scrunchai.com/v1/account \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.scrunchai.com/v1/account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.scrunchai.com/v1/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrunchai.com/v1/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.scrunchai.com/v1/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.scrunchai.com/v1/account")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrunchai.com/v1/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"organization_id": "<string>",
"organization_name": "<string>",
"plan": "<string>",
"plan_display_name": "<string>",
"status": "active",
"current_period_start": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
Successful Response
Subscription state of the account an API key belongs to.
ULID identifier for the account (organization) the API key belongs to.
Display name of the account.
Machine-readable name of the account's subscription plan, for example enterprise. Empty when the account has no plan on file.
Human-readable name of the account's subscription plan, for example Enterprise. Empty when the account has no plan on file.
Subscription state of the account. Values active, trialing, past_due, unpaid, paused, incomplete, canceled, and incomplete_expired mirror Stripe's subscription statuses. subscription_not_found means Scrunch holds no Stripe subscription record for the account (normal for manually invoiced accounts) and is not a sign the account lapsed. unknown means Scrunch cannot vouch for the current state; keep your current behavior rather than treating it as a lapse.
active, trialing, past_due, unpaid, paused, incomplete, canceled, incomplete_expired, subscription_not_found, unknown Start of the current billing period, in UTC. null when no subscription is on file.
End of the current billing period, in UTC. While status is trialing, this is also the date the trial ends. null when no subscription is on file.