User management

Sign in

For sign in, you need a login token. After successful login, you receive a token for subsequent requests.

mutation {
signIn(email: "admin@cms.cz", password: "123456", expiration: 9999999) {
ok
result {
token
}
errors {
code
}
}
}

Sign out

By calling signOut mutation, you can invalidate a token associated with current request

mutation {
signOut {
ok
}
}

By setting a parameter all to true, you invalidate all tokens associated with a current identity.

mutation {
signOut(all: true) {
ok
}
}

Only persons are allowed to sign out. It cannot be called with a permanent API key.

Invite

Superadmin or a project admin can invite other person to a project:

mutation {
invite(
email: "john@doe.com",
projectSlug: "my-blog",
memberships: [
{
role: "editor",
variables: [{name: "language", values: ["cs"]}]
}
]
) {
ok
errors {
code
}
result {
...on InviteNewResult {
generatedPassword
}
}
}
}

When a user with given email already exists in a system, he is just added to a project, otherwise a new user is created.