TypeScript
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.stats.getDaily({
from: "from",
to: "to",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.stats.getDaily({
from: "from",
to: "to",
});
}
main();
package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.GetDailyStatsRequestParameters{
From: management.String(
"from",
),
To: management.String(
"to",
),
}
mgmt.Stats.GetDaily(
context.TODO(),
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api get "stats/daily" --query "from=from" --query "to=to"using Auth0.ManagementApi;
using System.Threading.Tasks;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Stats.GetDailyAsync(
new GetDailyStatsRequestParameters {
From = "from",
To = "to"
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.GetDailyStatsRequestParameters;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.stats().getDaily(
GetDailyStatsRequestParameters
.builder()
.from("from")
.to("to")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Stats\Requests\GetDailyStatsRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->stats->getDaily(
new GetDailyStatsRequestParameters([
'from' => 'from',
'to' => 'to',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.stats.get_daily(
from_="from",
to="to",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.stats.get_daily(
from: "from",
to: "to"
)
curl --request GET \
--url https://{tenantDomain}/api/v2/stats/daily \
--header 'Authorization: Bearer <token>'[
{
"date": "2014-01-01T00:00:00.000Z",
"logins": 100,
"signups": 100,
"leaked_passwords": 100,
"updated_at": "2014-01-01T02:00:00.000Z",
"created_at": "2014-01-01T20:00:00.000Z"
}
]{
"message": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"message": "<string>",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "<string>",
"statusCode": 403,
"error": "Forbidden"
}{
"message": "<string>",
"statusCode": 429,
"error": "Too Many Requests"
}Get daily stats
Retrieve the number of logins, signups and breached-password detections (subscription required) that occurred each day within a specified date range.
GET
https://{tenantDomain}/api/v2
/
stats
/
daily
TypeScript
import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.stats.getDaily({
from: "from",
to: "to",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
domain: "{YOUR_DOMAIN}",
token: "<token>",
});
await client.stats.getDaily({
from: "from",
to: "to",
});
}
main();
package example
import (
context "context"
management "github.com/auth0/go-auth0/v3/management"
client "github.com/auth0/go-auth0/v3/management/client"
option "github.com/auth0/go-auth0/v3/management/option"
)
func do() {
mgmt, err := client.New(
"{YOUR_DOMAIN}",
option.WithToken(
"<token>",
),
)
if err != nil {
return
}
request := &management.GetDailyStatsRequestParameters{
From: management.String(
"from",
),
To: management.String(
"to",
),
}
mgmt.Stats.GetDaily(
context.TODO(),
request,
)
}
# Ensure you're logged in: auth0 login
auth0 api get "stats/daily" --query "from=from" --query "to=to"using Auth0.ManagementApi;
using System.Threading.Tasks;
public partial class Examples
{
public async Task Example() {
var client = new ManagementApiClient(
token: "<token>",
clientOptions: new ClientOptions { BaseUrl = "https://{YOUR_DOMAIN}/api/v2" }
);
await client.Stats.GetDailyAsync(
new GetDailyStatsRequestParameters {
From = "from",
To = "to"
}
);
}
}
package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.GetDailyStatsRequestParameters;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.domain("{YOUR_DOMAIN}")
.token("<token>")
.build();
client.stats().getDaily(
GetDailyStatsRequestParameters
.builder()
.from("from")
.to("to")
.build()
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Stats\Requests\GetDailyStatsRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: '{YOUR_DOMAIN}',
token: '<token>',
));
$client->stats->getDaily(
new GetDailyStatsRequestParameters([
'from' => 'from',
'to' => 'to',
]),
);
from auth0.management import ManagementClient
client = ManagementClient(
domain="{YOUR_DOMAIN}",
token="<token>",
)
client.stats.get_daily(
from_="from",
to="to",
)
require "auth0"
client = Auth0::Management.new(token: "<token>", base_url: "https://{YOUR_DOMAIN}/api/v2")
client.stats.get_daily(
from: "from",
to: "to"
)
curl --request GET \
--url https://{tenantDomain}/api/v2/stats/daily \
--header 'Authorization: Bearer <token>'[
{
"date": "2014-01-01T00:00:00.000Z",
"logins": 100,
"signups": 100,
"leaked_passwords": 100,
"updated_at": "2014-01-01T02:00:00.000Z",
"created_at": "2014-01-01T20:00:00.000Z"
}
]{
"message": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"message": "<string>",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "<string>",
"statusCode": 403,
"error": "Forbidden"
}{
"message": "<string>",
"statusCode": 429,
"error": "Too Many Requests"
}Authorizations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Scopes
read:stats
Read Stats
Query Parameters
Optional first day of the date range (inclusive) in YYYYMMDD format.
Optional last day of the date range (inclusive) in YYYYMMDD format.
Response
Daily stats successfully retrieved.
Date these events occurred in ISO 8601 format.
Number of logins on this date.
Number of signups on this date.
Number of breached-password detections on this date (subscription required).
Date and time this stats entry was last updated in ISO 8601 format.
Approximate date and time the first event occurred in ISO 8601 format.