Skip to content

Auth (publiek met scope)

GraphQL mutations: Auth (publiek met scope).

Endpoint: POST https://graphql.persmonitor.nl/graphql

Deze mutations zijn publiek bereikbaar maar vereisen een API-token met de juiste scope (auth:login, auth:register, …).


login

Log in with email and password. Requires API token with scope auth:login in Authorization header. Returns session tokens; the frontend stores them and sends the access token with every request.

Return type: LoginPayload

Authenticatie: API-token met scope (auth:login, auth:register, …)

Argumenten:

ArgumentTypeVerplichtBeschrijving
inputLoginInput!JaEmail and password.

Voorbeeld:

graphql
query Login {
  login(input: $input) {
    # selecteer velden uit het return type
  }
}

refreshToken

Vraag nieuwe access + refresh tokens aan met je refresh token. Oude refresh token wordt ongeldig (rotation). Stuur de refresh token in Authorization: Bearer <refresh_token>.

Return type: RefreshTokenPayload!

Authenticatie: API-token met scope (auth:login, auth:register, …)

Geen argumenten.

Voorbeeld:

graphql
query RefreshToken {
  refreshToken {
    # selecteer velden uit het return type
  }
}

register

Register: creates an organization, environment, and user (with email and optional password) in one go. Requires API token with scope auth:register in Authorization header.

Return type: RegisterPayload

Authenticatie: API-token met scope (auth:login, auth:register, …)

Argumenten:

ArgumentTypeVerplichtBeschrijving
inputRegisterInput!Ja

Voorbeeld:

graphql
query Register {
  register(input: $input) {
    # selecteer velden uit het return type
  }
}

requestMagicLinkLogin

Stuur een inloglink naar het e-mailadres. Vereist API-token met scope auth:login. returnTo: monitor OAuth-callback URL (zelfde regels als OAuth). Response: message code (locale=api) of vertaalde tekst (locale=nl/en).

Return type: String!

Authenticatie: API-token met scope (auth:login, auth:register, …)

Argumenten:

ArgumentTypeVerplichtBeschrijving
emailString!JaE-mailadres van het account.
returnToString!JaAbsolute URL van de client die tokens ontvangt (bijv. monitor /auth/oauth/callback).

Voorbeeld:

graphql
query RequestMagicLinkLogin {
  requestMagicLinkLogin(email: $email, returnTo: $returnTo) {
    # selecteer velden uit het return type
  }
}

requestPasswordReset

Vraag een wachtwoord-reset aan. Stuurt een e-mail met link. Vereist API-token met scope auth:password_reset.

Return type: String!

Authenticatie: API-token met scope (auth:login, auth:register, …)

Argumenten:

ArgumentTypeVerplichtBeschrijving
emailString!JaE-mailadres van het account.

Voorbeeld:

graphql
query RequestPasswordReset {
  requestPasswordReset(email: $email) {
    # selecteer velden uit het return type
  }
}

resetPassword

Wijzig wachtwoord met het token uit de reset-e-mail. Geen auth vereist.

Return type: String!

Authenticatie: API-token met scope (auth:login, auth:register, …)

Argumenten:

ArgumentTypeVerplichtBeschrijving
tokenString!JaToken uit de reset-e-mail.
newPasswordString!JaNieuw wachtwoord.

Voorbeeld:

graphql
query ResetPassword {
  resetPassword(token: $token, newPassword: $newPassword) {
    # selecteer velden uit het return type
  }
}

respondOnTheWay

Register or update an on-the-way (Ik ga) response using a signed token. No login required.

Return type: AlertResponder

Authenticatie: Geen login vereist

Argumenten:

ArgumentTypeVerplichtBeschrijving
tokenString!JaHMAC-signed token from the notification link.
statusString!Jagoing or cancelled.

Voorbeeld:

graphql
query RespondOnTheWay {
  respondOnTheWay(token: $token, status: $status) {
    # selecteer velden uit het return type
  }
}