Billing (GraphQL)

Related queries and mutations in Performance and cost. Each has its own section.

Queries

getAccountEntitlements (query)

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

Arguments

ArgumentTypeDescription
refreshBooleanDefault: false.

Returns

AccountEntitlementsInfo

Example

query GetAccountEntitlements {
  getAccountEntitlements {
    entitlements
  }
}

Types used only by getAccountEntitlements

AccountEntitlementsInfo

Object type.

FieldTypeDescription
entitlements[EntitlementTypes]

Related types

EntitlementTypes

getBillingContractInvoices (query)

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

Status: General availability

Get a list of invoices for the account.

Arguments

ArgumentTypeDescription
limitIntLimit the number of results returned. Values 1-100 accepted. Default: 12.
sortBillingInvoicesSortSort invoices by issued date. Default: "date_desc".
startTimeDateTimeFilter invoices by billing periods that start at or after this time.
endTimeDateTimeFilter invoices by billing periods that end before this time.
statusBillingInvoiceStatus

Returns

BillingContractInvoiceResults

Example

query GetBillingContractInvoices {
  getBillingContractInvoices {
    invoices {
      id
      startTime
      endTime
      tierName
      total
      status
      commitConsumed
    }
  }
}

Types used only by getBillingContractInvoices

BillingContractInvoice

Object type.

FieldTypeDescription
idStringThe id of the invoice
startTimeDateTimeThe start of the invoice period
endTimeDateTimeThe end of the invoice period
tierNameStringThe name of the current tier
totalIntThe total cost minus credits
statusBillingInvoiceStatusThe status of the invoice
commitConsumedIntMoney subtracted from commits
items[BillingContractInvoiceItem]Products charged in the invoice
BillingContractInvoiceItem

Object type.

FieldTypeDescription
creditsIntThe number of credits used.
rateFloatThe rate at which credits were used.
addOnStringLabel for an add-on product; empty string if not an add-on.
BillingContractInvoiceResults

Object type.

FieldTypeDescription
invoices[BillingContractInvoice]List of contract invoices for the account

Related types

BillingInvoiceStatus, BillingInvoicesSort, DateTime

getBillingCreditGrants (query)

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

Status: Deprecated: Plan-based grants are deprecated

Get a list of credit grants for the account. Expect the currency for monetary values to be in USD (cents).

Arguments

ArgumentTypeDescription
endCursorStringCursor used to get results from the next page

Returns

BillingCreditGrantResults

Example

query GetBillingCreditGrants {
  getBillingCreditGrants {
    creditGrants {
      id
      name
      startTime
      endTime
      amountPaid
      amountRemaining
      quantityRemaining
      currency
    }
  }
}

Types used only by getBillingCreditGrants

BillingCreditGrant

Object type.

FieldTypeDescription
idStringThe id of the credit grant
nameStringDescription of the credit
startTimeDateTimeThe starting time when the credit is valid for use
endTimeDateTimeThe time that the credit expires
amountPaidIntThe amount paid
amountRemainingIntThe amount of credit remaining
quantityRemainingIntQuantity remaining calculated from amount_remaining.
currencyStringThe unit of the credit. Currently only USD (cents) is supported.
BillingCreditGrantResults

Object type.

FieldTypeDescription
creditGrants[BillingCreditGrant]List of credit grants for the account
pageInfoNextPageInfoData necessary to paginate the list of credit grants

Related types

DateTime, NextPageInfo

getBillingInvoices (query)

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

Status: Deprecated: Plan-based invoices are deprecated

Get a list of invoices for the account. Expect the currency for monetary values to be in USD (cents).

Arguments

ArgumentTypeDescription
endCursorStringCursor used to get results from the next page
limitIntLimit the number of results returned. Values 1-100 accepted. Default: 12.
sortBillingInvoicesSortSort invoices by issued date. Default: "date_desc".
startTimeDateTimeFilter invoices by billing periods that start at or after this time.
endTimeDateTimeFilter invoices by billing periods that end before this time.
statusBillingInvoiceStatus

Returns

BillingInvoiceResults

Example

query GetBillingInvoices {
  getBillingInvoices {
    invoices {
      id
      startTime
      endTime
      planName
      total
      currency
      status
    }
  }
}

Types used only by getBillingInvoices

BillingInvoice

Object type.

FieldTypeDescription
idStringThe id of the invoice
startTimeDateTimeThe start of the invoice period
endTimeDateTimeThe end of the invoice period
planNameStringThe name of the plan
totalIntThe total cost minus credits
currencyStringThe currency of the total. Currently only USD (cents) is supported.
statusBillingInvoiceStatusThe status of the invoice
products[BillingInvoiceProduct]Products charged in the invoice
BillingInvoiceProduct

Object type.

FieldTypeDescription
nameStringThe name of the product
charges[BillingInvoiceProductCharge]Charges for the product
BillingInvoiceProductCharge

Object type.

FieldTypeDescription
quantityIntThe quantity of product charged
commitRateIntValue only exists for commit plans.
onDemandRateIntValue exists for both commit and on-demand plans.
BillingInvoiceResults

Object type.

FieldTypeDescription
invoices[BillingInvoice]List of invoices for the account
pageInfoNextPageInfoData necessary to paginate the list of invoices

Related types

BillingInvoiceStatus, BillingInvoicesSort, DateTime, NextPageInfo

getBillingMonitorUsage (query)

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

Status: General availability

Get monitor usage data.

Arguments

ArgumentTypeDescription
startOnDateTime!Start date, inclusive.
endBeforeDateTime!End date, not inclusive.

Returns

BillingMonitorUsageResults

Example

query GetBillingMonitorUsage($startOn: DateTime!, $endBefore: DateTime!) {
  getBillingMonitorUsage(startOn: $startOn, endBefore: $endBefore) {
    usages {
      date
      tableMonitorCredits
      metricMonitorCredits
      validationMonitorCredits
      comparisonMonitorCredits
      customSqlMonitorCredits
      performanceMonitorCredits
      jsonSchemaMonitorCredits
      metricLegacyMonitorCredits
      freshnessRuleMonitorCredits
      volumeRuleMonitorCredits
      metricComparisonMonitorCredits
      troubleshootingAgentMonitorCredits
      agentObservabilityMonitorCredits
      prAgentMonitorCredits
      triageMonitorCredits
      costAgentMonitorCredits
      piiAgentMonitorCredits
    }
  }
}

Types used only by getBillingMonitorUsage

BillingMonitorUsage

Object type.

FieldTypeDescription
dateDateThe date for this data point
tableMonitorCreditsFloatCredits used by table monitors
metricMonitorCreditsFloatCredits used by metric monitors
validationMonitorCreditsFloatCredits used by validation monitors
comparisonMonitorCreditsFloatCredits used by comparison monitors
customSqlMonitorCreditsFloatCredits used by custom SQL monitors
performanceMonitorCreditsFloatCredits used by performance monitors
jsonSchemaMonitorCreditsFloatCredits used by JSON schema monitors
metricLegacyMonitorCreditsFloatCredits used by metric_legacy monitors
freshnessRuleMonitorCreditsFloatCredits used by freshness rule monitors
volumeRuleMonitorCreditsFloatCredits used by volume rule monitors
metricComparisonMonitorCreditsFloatCredits used by metric comparison monitors
troubleshootingAgentMonitorCreditsFloatCredits used by troubleshooting agent monitors
agentObservabilityMonitorCreditsFloatCredits used by agent observability
prAgentMonitorCreditsFloatCredits used by the PR Agent
triageMonitorCreditsFloatCredits used by automated alert triage
costAgentMonitorCreditsFloatCredits used by the Cost & Performance Agent
piiAgentMonitorCreditsFloatCredits used by the PII Agent
BillingMonitorUsageResults

Object type.

FieldTypeDescription
usages[BillingMonitorUsage]List of daily monitor usage data points.

Related types

Date, DateTime

getContractCommits (query)

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

Status: General availability

Get a list of commits for all contracts.

Returns

ContractCommitResults

Example

query GetContractCommits {
  getContractCommits {
    contractCommits {
      id
      name
      start
      expiration
      amountPaid
      amountRemaining
    }
  }
}

Types used only by getContractCommits

ContractCommit

Object type.

FieldTypeDescription
idStringThe id of the commit
nameStringDescription of the commit
startDateTimeThe starting time of the commit
expirationDateTimeThe expiration time of the commit
amountPaidIntThe committed funds paid upfront
amountRemainingIntThe amount of committed funds remaining
ContractCommitResults

Object type.

FieldTypeDescription
contractCommits[ContractCommit]List of commits for all contracts

Related types

DateTime

getTsaInvestigations (query)

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

Status: Experimental

Get Troubleshooting Agent investigations and the credits each one charged (0 for free runs).

Arguments

ArgumentTypeDescription
startOnDateTime!Start time, inclusive.
endBeforeDateTime!End time, not inclusive.

Returns

TsaInvestigationResults

Example

query GetTsaInvestigations($startOn: DateTime!, $endBefore: DateTime!) {
  getTsaInvestigations(startOn: $startOn, endBefore: $endBefore) {
    investigations {
      createdTime
      alertId
      triggeredBy
      billingStatus
      units
      credits
    }
  }
}

Types used only by getTsaInvestigations

TsaInvestigation

Object type.

FieldTypeDescription
createdTimeDateTime!When the investigation completed and was billed
alertIdUUID!The investigated alert
triggeredByString!Display label for the user who started the investigation. Returns the user's email for human users; for agent users, returns a derived display label (e.g. Bayes on <domain>) — never the agent's internal address.
billingStatusTsaInvestigationBillingStatus!FREE: within the monthly free investigations, or a free run, such as a teammate run while the account's teammate runs are free. NEW_BATCH: opened a new batch of paid investigations and was charged for it. INCLUDED_IN_BATCH: covered by a batch already charged this month.
unitsInt!Units charged for this investigation. CBP v1 accounts are billed on these.
creditsFloat!Credits charged for this investigation. CBP v2 accounts are billed on these.
TsaInvestigationBillingStatus

Enum type.

ValueDescription
FREE
NEW_BATCH
INCLUDED_IN_BATCH
TsaInvestigationResults

Object type.

FieldTypeDescription
investigations[TsaInvestigation!]Investigations with what each one charged, oldest first. Free runs, such as teammate runs while the account's teammate runs are free, are FREE with 0 credits.

Related types

DateTime, UUID

Mutations

refreshEntitlements (mutation)

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

Status: Deprecated: Refreshing now handled internally.

Returns

RefreshEntitlements

Example

mutation RefreshEntitlements {
  refreshEntitlements {
    success
  }
}

Types used only by refreshEntitlements

RefreshEntitlements

Object type.

FieldTypeDescription
successBooleanTrue if the entitlements refresh was successful

Source: The GraphQL API reference

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