API Reference
Sessions
Create API tokens and inspect, rename or revoke client sessions.
Type Definitions
graphql
type Mutation {
createApiToken(name: String!): CreatedApiToken!
renameSession(clientId: ID!, name: String!): Boolean!
revokeSession(clientId: ID!): Boolean!
}
type Query {
sessions: [Session!]!
}
type CreatedApiToken {
clientId: ID!
token: String!
}
scalar Instant
type Session {
clientId: ID!
clientName: String!
type: SessionType!
clientIp: String!
osName: String!
osVersion: String!
appName: String!
appVersion: String!
lastSeenAt: Instant
lastActive: Instant!
createdAt: Instant!
updatedAt: Instant!
}
enum SessionType {
LOGIN
API_TOKEN
}Operations
mutation
createApiToken
Create a named API token and return its clientId and Base64-encoded 32-byte token.
graphql
mutation createApiToken($name: String!) {
createApiToken(name: $name) { clientId token }
}mutation
renameSession
Rename the specified authorized-client session.
graphql
mutation renameSession($clientId: ID!, $name: String!) {
renameSession(clientId: $clientId, name: $name)
}mutation
revokeSession
Revoke the specified client session and its access.
graphql
mutation revokeSession($clientId: ID!) {
revokeSession(clientId: $clientId)
}query
sessions
List login and API-token sessions. LOGIN token and urlToken are empty; API_TOKEN credentials require local-owner requests.
graphql
query sessions {
sessions { clientId clientName type clientIp osName osVersion appName appVersion }
}