Sleuth Documentation
Home
Blog
Support
Sign up
Search…
Getting started
DORA metrics
Deployment tracking
Slack & Email Notifications
Auto-verify deploys
Deploy workflows (beta)
Slack mission control
Sleuth API
Deprecation information
GraphQL examples
Integrations
About Integrations...
Code integrations
Feature flag integrations
Impact integrations
Slack integration
CI/CD integrations
Issue tracker integrations
Incident tracker integrations
Settings
Organization settings
Project settings
Account settings
Role Based Access Control
Resources
FAQ
Sleuth TV
Purchasing
About Sleuth...
Powered By
GitBook
GraphQL examples
Example GraphQL queries with authentication.
To get started, login into Sleuth and open
GraphiQL
​
Logged in user (
example link
)
{
user {
display
}
}
Team metrics recap (
example link
)
Query
query GetNumberOfTeamDeploys($orgSlug: ID!, $start: DateTime!, $end: DateTime!, $teamSlugs: [ID]) {
organization(orgSlug: $orgSlug) {
metricsRecap(start: $start, end: $end, filters: {teamSlugs: $teamSlugs}) {
numOfDeploys
}
}
}
Query variables
{
"orgSlug": "sleuth",
"start": "2022-07-01T00:00:00Z",
"end": "2022-07-31T00:00:00Z",
"teamSlugs": [
"frontend-2"
]
}
Project metrics recap (
example link
)
Query
query GetNumberOfProjectDeploys($orgSlug: ID!, $start: DateTime!, $end: DateTime!, $projectSlugs: [ID]) {
organization(orgSlug: $orgSlug) {
metricsRecap(start: $start, end: $end, filters: {projectSlugs: $projectSlugs}) {
numOfDeploys
}
}
}
Query variables
{
"orgSlug": "sleuth",
"start": "2022-07-01T00:00:00Z",
"end": "2022-07-31T00:00:00Z",
"projectSlugs": [
"sleuth"
]
}
cURL and API key
Using cURL you can call Sleuth GraphQL API from any environment.
Get API Key through GraphiQL (
example link
)
{
context {
org {
apiKey
}
}
}
Now use API Key in
authorization
header (required headers are
content-type
and
authorization
)
curl 'https://app.sleuth.io/graphql' \
-H 'content-type: application/json' \
-H 'authorization: apikey <PASTE-YOUR-API-KEY-HERE>' \
-d '{"query":"query{organization(orgSlug:\"sleuth\"){metricsRecap(start:\"2022-07-01T00:00:00Z\",end:\"2022-07-31T00:00:00Z\",filters:{teamSlugs:\"frontend-2\"}){numOfDeploys}}}"}'
Authorization header starts with
apikey
and not
Bearer
Previous
Deprecation information
Next - Integrations
About Integrations...
Last modified
20d ago
Copy link
Outline