OAuth clients (GraphQL)

Related queries and mutations in Users, accounts and access. Each has its own section.

Queries

getOauthClients (query)

getOauthClients is a query in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

List OAuth 2.0 clients for the current account.

Arguments

ArgumentTypeDescription
identityTypeOAuthClientIdentityTypeFilter by identity type.
identityIdIDFilter by identity ID.

Returns

[OAuthClientOutput!]!

Example

query GetOauthClients {
  getOauthClients {
    clientId
    description
    scopes
    identityType
    identityId
    resourceIds
    createdTime
    createdBy
    createdByEmail
    expirationTime
  }
}

Related types

OAuthClientIdentityType, OAuthClientOutput

getOauthClientSecrets (query)

getOauthClientSecrets is a query in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

List an OAuth client's secrets (metadata only; up to two).

Arguments

ArgumentTypeDescription
clientIdID!The OAuth client id.

Returns

[OAuthClientSecret!]!

Example

query GetOauthClientSecrets($clientId: ID!) {
  getOauthClientSecrets(clientId: $clientId) {
    secretId
    createdTime
  }
}

Types used only by getOauthClientSecrets

OAuthClientSecret

Object type. Metadata for one of an OAuth client's secrets (up to two). The value is never listed.

FieldTypeDescription
secretIdID!The secret's unique identifier.
createdTimeDateTimeWhen this secret was created.

Related types

DateTime

getServiceOauthClients (query)

getServiceOauthClients is a query in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

List service (account) OAuth 2.0 clients for the current account.

Returns

[ServiceOAuthClientOutput!]!

Example

query GetServiceOauthClients {
  getServiceOauthClients {
    serviceId
    clientId
    description
    displayName
    authorizationGroups
    createdTime
    createdBy
    createdByEmail
    expirationTime
  }
}

Types used only by getServiceOauthClients

ServiceOAuthClientOutput

Object type. A service (account) OAuth 2.0 client, enriched with its service account's name + groups.

FieldTypeDescription
serviceIdID!Stable id of the service account (survives secret rotation).
clientIdID!OAuth client id. Stable across secret rotation — secrets are added/removed via the manage-secrets APIs while the client id stays the same.
descriptionStringA human-readable description of this OAuth client.
displayNameStringDisplay name of the service account.
authorizationGroups[String!]!Authorization groups granting this service account its permissions.
createdTimeDateTimeWhen this service OAuth account was created.
createdByIDId of the user who created this service OAuth account.
createdByEmailStringEmail of the user who created this service OAuth account.
expirationTimeDateTimeWhen this OAuth client expires (null = never expires).

Related types

DateTime

getUserOauthClients (query)

getUserOauthClients is a query in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

List a specific user's personal OAuth 2.0 clients (account admin).

Arguments

ArgumentTypeDescription
userIdID!cognito_user_id of the target user, who must be in your account.

Returns

[OAuthClientOutput!]!

Example

query GetUserOauthClients($userId: ID!) {
  getUserOauthClients(userId: $userId) {
    clientId
    description
    scopes
    identityType
    identityId
    resourceIds
    createdTime
    createdBy
    createdByEmail
    expirationTime
  }
}

Related types

OAuthClientOutput

Mutations

addOauthClientSecret (mutation)

addOauthClientSecret is a mutation in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Add a second secret to an OAuth client for zero-downtime rotation.

Arguments

ArgumentTypeDescription
clientIdID!The OAuth client id to add a secret to.

Returns

AddOAuthClientSecret

Example

mutation AddOauthClientSecret($clientId: ID!) {
  addOauthClientSecret(clientId: $clientId) {
    response {
      secretId
      clientSecret
    }
  }
}

Types used only by addOauthClientSecret

AddOAuthClientSecret

Object type. Add a second secret to an OAuth client for zero-downtime rotation (max two per client). Returns the new secret value, which is shown only once.

FieldTypeDescription
responseAddOAuthClientSecretResponse!
AddOAuthClientSecretResponse

Object type. Response from adding an OAuth client secret. The secret value is shown only once.

FieldTypeDescription
secretIdID!The new secret's unique identifier.
clientSecretString!The new secret value. Store it now — it cannot be retrieved.

createAgentOauthClient (mutation)

createAgentOauthClient is a mutation in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Create an OAuth 2.0 client for agent machine-to-machine authentication.

Arguments

ArgumentTypeDescription
agentIdID!The UUID of the agent to create the OAuth client for.
descriptionString!A human-readable description for this OAuth client.
expirationInDaysIntOptional client lifetime in days (omit for no expiration).

Returns

CreateAgentOAuthClient

Example

mutation CreateAgentOauthClient($agentId: ID!, $description: String!) {
  createAgentOauthClient(agentId: $agentId, description: $description) {
    response {
      clientId
      clientSecret
      scopes
    }
  }
}

Types used only by createAgentOauthClient

CreateAgentOAuthClient

Object type. Create an OAuth 2.0 client for agent machine-to-machine authentication.

FieldTypeDescription
responseCreateOAuthClientResponse!

Related types

CreateOAuthClientResponse

createOrUpdateServiceOauthClient (mutation)

createOrUpdateServiceOauthClient is a mutation in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Create or update a service (account) OAuth 2.0 client.

Arguments

ArgumentTypeDescription
descriptionString!A human-readable description for this service account.
expirationInDaysIntOptional client lifetime in days, set on create (omit for no expiration).
groups[String!]Authorization groups granting the service account its permissions.
serviceIdIDStable service account id. Omit to create; provide to update existing.

Returns

CreateOrUpdateServiceOAuthClient

Example

mutation CreateOrUpdateServiceOauthClient($description: String!) {
  createOrUpdateServiceOauthClient(description: $description) {
    response {
      serviceId
      clientId
      clientSecret
      scopes
    }
  }
}

Types used only by createOrUpdateServiceOauthClient

CreateOrUpdateServiceOAuthClient

Object type. Create or update a service (account) OAuth 2.0 client. Omit service_id to create a new account; provide it to update the account's groups/description (never the secret).

FieldTypeDescription
responseServiceOAuthClientMutationResponse!
ServiceOAuthClientMutationResponse

Object type. Response for service OAuth create/update.

client_secret is returned only when a new credential is created (on create); it is
null on a metadata-only update, and can never be retrieved again after this response.
Rotate secrets in place via the manage-secrets APIs (the client id is unchanged).

FieldTypeDescription
serviceIdID!Stable id of the service account (use for update/delete).
clientIdIDThe service account's OAuth client id.
clientSecretStringOnly present when a new credential was created (on create). Store it now.
scopes[String!]!The OAuth scopes granted to this client.

createUserOauthClient (mutation)

createUserOauthClient is a mutation in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Create a personal OAuth 2.0 client for API access (acts as the caller).

Arguments

ArgumentTypeDescription
descriptionString!A human-readable description for this OAuth client.
expirationInDaysInt!Client lifetime in days (required for personal clients).

Returns

CreateUserOAuthClient

Example

mutation CreateUserOauthClient($description: String!, $expirationInDays: Int!) {
  createUserOauthClient(description: $description, expirationInDays: $expirationInDays) {
    response {
      clientId
      clientSecret
      scopes
    }
  }
}

Types used only by createUserOauthClient

CreateUserOAuthClient

Object type. Create a personal OAuth 2.0 client for API access. The client acts as the calling user; it cannot be created on behalf of another user.

FieldTypeDescription
responseCreateOAuthClientResponse!

Related types

CreateOAuthClientResponse

deleteAllUserOauthClients (mutation)

deleteAllUserOauthClients is a mutation in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Delete all of a user's personal OAuth 2.0 clients (account admin).

Arguments

ArgumentTypeDescription
userIdID!cognito_user_id of the target user, who must be in your account.

Returns

DeleteAllUserOAuthClients

Example

mutation DeleteAllUserOauthClients($userId: ID!) {
  deleteAllUserOauthClients(userId: $userId) {
    deletedCount
  }
}

Types used only by deleteAllUserOauthClients

DeleteAllUserOAuthClients

Object type. Delete all personal OAuth clients belonging to a user in your account (account admin). Revokes their credentials immediately.

FieldTypeDescription
deletedCountInt!The number of OAuth clients that were deleted.

deleteOauthClient (mutation)

deleteOauthClient is a mutation in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Delete an OAuth 2.0 client and revoke its credentials.

Arguments

ArgumentTypeDescription
clientIdID!The ID of the OAuth client to delete.

Returns

DeleteOAuthClient

Example

mutation DeleteOauthClient($clientId: ID!) {
  deleteOauthClient(clientId: $clientId) {
    deleted
  }
}

Types used only by deleteOauthClient

DeleteOAuthClient

Object type. Delete an OAuth 2.0 client. Revokes the client's credentials immediately.

FieldTypeDescription
deletedBoolean!Whether the client was found and deleted.

deleteOauthClientSecret (mutation)

deleteOauthClientSecret is a mutation in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Delete a specific OAuth client secret (not the last remaining one).

Arguments

ArgumentTypeDescription
clientIdID!The OAuth client id.
secretIdID!The id of the secret to delete.

Returns

DeleteOAuthClientSecret

Example

mutation DeleteOauthClientSecret($clientId: ID!, $secretId: ID!) {
  deleteOauthClientSecret(clientId: $clientId, secretId: $secretId) {
    deleted
  }
}

Types used only by deleteOauthClientSecret

DeleteOAuthClientSecret

Object type. Delete a specific secret from an OAuth client. The last remaining secret cannot be deleted.

FieldTypeDescription
deletedBoolean!Whether the secret was deleted.

deleteServiceOauthClient (mutation)

deleteServiceOauthClient is a mutation in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Terminate a service OAuth account (revoke client + delete the account).

Arguments

ArgumentTypeDescription
serviceIdID!Stable id of the service account to delete.

Returns

DeleteServiceOAuthClient

Example

mutation DeleteServiceOauthClient($serviceId: ID!) {
  deleteServiceOauthClient(serviceId: $serviceId) {
    deleted
  }
}

Types used only by deleteServiceOauthClient

DeleteServiceOAuthClient

Object type. Terminate a service OAuth account: revoke its client and delete the service account.

FieldTypeDescription
deletedBoolean!Whether the service account was found and deleted.

deleteUserOauthClient (mutation)

deleteUserOauthClient is a mutation in the Monte Carlo GraphQL API, in Users, accounts and access. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: General availability

Delete a specific user's personal OAuth 2.0 client (account admin).

Arguments

ArgumentTypeDescription
clientIdID!The ID of the user's OAuth client to delete.
userIdID!cognito_user_id of the target user, who must be in your account.

Returns

DeleteUserOAuthClient

Example

mutation DeleteUserOauthClient($clientId: ID!, $userId: ID!) {
  deleteUserOauthClient(clientId: $clientId, userId: $userId) {
    deleted
  }
}

Types used only by deleteUserOauthClient

DeleteUserOAuthClient

Object type. Delete a specific personal OAuth client belonging to a user in your account (account admin). Revokes the client's credentials immediately.

FieldTypeDescription
deletedBoolean!Whether the client was found and deleted.

Source: The GraphQL API reference

This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.