Create a scheduled report
POST
/v1/reports
const url = 'https://stats.example.com/v1/reports';const options = { method: 'POST', headers: { cookie: 'shardlens_session=<shardlens_session>', 'Content-Type': 'application/json' }, body: '{"name":"example","schedule":"daily","hour":1,"weekday":1,"webhookUrl":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://stats.example.com/v1/reports \ --header 'Content-Type: application/json' \ --cookie shardlens_session=<shardlens_session> \ --data '{ "name": "example", "schedule": "daily", "hour": 1, "weekday": 1, "webhookUrl": "example" }'A daily or weekly summary posted to a Discord channel. The webhook must be a Discord webhook URL; it is stored encrypted. Reports contain counts only.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
schedule
required
string
hour
required
integer
weekday
integer
webhookUrl
required
string
Responses
Section titled “Responses”Created
Invalid report or webhook URL
Media typeapplication/json
object
error
required
string
message
string
rejected
Array<object>
object
index
required
integer
reason
required
string
Example generated
{ "error": "example", "message": "example", "rejected": [ { "index": 1, "reason": "example" } ]}Not signed in
Media typeapplication/json
object
error
required
string
message
string
rejected
Array<object>
object
index
required
integer
reason
required
string
Example generated
{ "error": "example", "message": "example", "rejected": [ { "index": 1, "reason": "example" } ]}Needs a Discord sign-in (owner or team) and, for changes, the CSRF header
Media typeapplication/json
object
error
required
string
message
string
rejected
Array<object>
object
index
required
integer
reason
required
string
Example generated
{ "error": "example", "message": "example", "rejected": [ { "index": 1, "reason": "example" } ]}