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
| Argument | Type | Description |
|---|---|---|
identityType | OAuthClientIdentityType | Filter by identity type. |
identityId | ID | Filter by identity ID. |
Returns
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
| Argument | Type | Description |
|---|---|---|
clientId | ID! | The OAuth client id. |
Returns
[OAuthClientSecret!]!
Example
query GetOauthClientSecrets($clientId: ID!) {
getOauthClientSecrets(clientId: $clientId) {
secretId
createdTime
}
}Types used only by getOauthClientSecrets
getOauthClientSecretsOAuthClientSecret
OAuthClientSecretObject type. Metadata for one of an OAuth client's secrets (up to two). The value is never listed.
| Field | Type | Description |
|---|---|---|
secretId | ID! | The secret's unique identifier. |
createdTime | DateTime | When this secret was created. |
Related types
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
getServiceOauthClientsServiceOAuthClientOutput
ServiceOAuthClientOutputObject type. A service (account) OAuth 2.0 client, enriched with its service account's name + groups.
| Field | Type | Description |
|---|---|---|
serviceId | ID! | Stable id of the service account (survives secret rotation). |
clientId | ID! | OAuth client id. Stable across secret rotation — secrets are added/removed via the manage-secrets APIs while the client id stays the same. |
description | String | A human-readable description of this OAuth client. |
displayName | String | Display name of the service account. |
authorizationGroups | [String!]! | Authorization groups granting this service account its permissions. |
createdTime | DateTime | When this service OAuth account was created. |
createdBy | ID | Id of the user who created this service OAuth account. |
createdByEmail | String | Email of the user who created this service OAuth account. |
expirationTime | DateTime | When this OAuth client expires (null = never expires). |
Related types
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
| Argument | Type | Description |
|---|---|---|
userId | ID! | cognito_user_id of the target user, who must be in your account. |
Returns
Example
query GetUserOauthClients($userId: ID!) {
getUserOauthClients(userId: $userId) {
clientId
description
scopes
identityType
identityId
resourceIds
createdTime
createdBy
createdByEmail
expirationTime
}
}Related types
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
| Argument | Type | Description |
|---|---|---|
clientId | ID! | 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
addOauthClientSecretAddOAuthClientSecret
AddOAuthClientSecretObject 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.
| Field | Type | Description |
|---|---|---|
response | AddOAuthClientSecretResponse! |
AddOAuthClientSecretResponse
AddOAuthClientSecretResponseObject type. Response from adding an OAuth client secret. The secret value is shown only once.
| Field | Type | Description |
|---|---|---|
secretId | ID! | The new secret's unique identifier. |
clientSecret | String! | 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
| Argument | Type | Description |
|---|---|---|
agentId | ID! | The UUID of the agent to create the OAuth client for. |
description | String! | A human-readable description for this OAuth client. |
expirationInDays | Int | Optional 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
createAgentOauthClientCreateAgentOAuthClient
CreateAgentOAuthClientObject type. Create an OAuth 2.0 client for agent machine-to-machine authentication.
| Field | Type | Description |
|---|---|---|
response | CreateOAuthClientResponse! |
Related types
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
| Argument | Type | Description |
|---|---|---|
description | String! | A human-readable description for this service account. |
expirationInDays | Int | Optional client lifetime in days, set on create (omit for no expiration). |
groups | [String!] | Authorization groups granting the service account its permissions. |
serviceId | ID | Stable 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
createOrUpdateServiceOauthClientCreateOrUpdateServiceOAuthClient
CreateOrUpdateServiceOAuthClientObject 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).
| Field | Type | Description |
|---|---|---|
response | ServiceOAuthClientMutationResponse! |
ServiceOAuthClientMutationResponse
ServiceOAuthClientMutationResponseObject 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).
| Field | Type | Description |
|---|---|---|
serviceId | ID! | Stable id of the service account (use for update/delete). |
clientId | ID | The service account's OAuth client id. |
clientSecret | String | Only 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
| Argument | Type | Description |
|---|---|---|
description | String! | A human-readable description for this OAuth client. |
expirationInDays | Int! | 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
createUserOauthClientCreateUserOAuthClient
CreateUserOAuthClientObject 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.
| Field | Type | Description |
|---|---|---|
response | CreateOAuthClientResponse! |
Related types
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
| Argument | Type | Description |
|---|---|---|
userId | ID! | 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
deleteAllUserOauthClientsDeleteAllUserOAuthClients
DeleteAllUserOAuthClientsObject type. Delete all personal OAuth clients belonging to a user in your account (account admin). Revokes their credentials immediately.
| Field | Type | Description |
|---|---|---|
deletedCount | Int! | 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
| Argument | Type | Description |
|---|---|---|
clientId | ID! | The ID of the OAuth client to delete. |
Returns
DeleteOAuthClient
Example
mutation DeleteOauthClient($clientId: ID!) {
deleteOauthClient(clientId: $clientId) {
deleted
}
}Types used only by deleteOauthClient
deleteOauthClientDeleteOAuthClient
DeleteOAuthClientObject type. Delete an OAuth 2.0 client. Revokes the client's credentials immediately.
| Field | Type | Description |
|---|---|---|
deleted | Boolean! | 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
| Argument | Type | Description |
|---|---|---|
clientId | ID! | The OAuth client id. |
secretId | ID! | 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
deleteOauthClientSecretDeleteOAuthClientSecret
DeleteOAuthClientSecretObject type. Delete a specific secret from an OAuth client. The last remaining secret cannot be deleted.
| Field | Type | Description |
|---|---|---|
deleted | Boolean! | 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
| Argument | Type | Description |
|---|---|---|
serviceId | ID! | Stable id of the service account to delete. |
Returns
DeleteServiceOAuthClient
Example
mutation DeleteServiceOauthClient($serviceId: ID!) {
deleteServiceOauthClient(serviceId: $serviceId) {
deleted
}
}Types used only by deleteServiceOauthClient
deleteServiceOauthClientDeleteServiceOAuthClient
DeleteServiceOAuthClientObject type. Terminate a service OAuth account: revoke its client and delete the service account.
| Field | Type | Description |
|---|---|---|
deleted | Boolean! | 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
| Argument | Type | Description |
|---|---|---|
clientId | ID! | The ID of the user's OAuth client to delete. |
userId | ID! | 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
deleteUserOauthClientDeleteUserOAuthClient
DeleteUserOAuthClientObject type. Delete a specific personal OAuth client belonging to a user in your account (account admin). Revokes the client's credentials immediately.
| Field | Type | Description |
|---|---|---|
deleted | Boolean! | 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.
