Creates a query process within the Cost Explorer for the given parameters. A token is returned that can be used to poll the status of the query and eventually retrieve the results.
Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the /orgs endpoint to retrieve all organizations to which the authenticated user has access.
Format should match the following pattern: ^([a-f0-9]{24})$.
Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.
Default value is false.
Filter parameters for the Cost Explorer query.
The list of clusters to be included in the Cost Explorer Query.
Format of each should match the following pattern: ^([a-f0-9]{24})$.
The exclusive ending date for the Cost Explorer query. The date must be the start of a month.
The dimension to group the returned usage results by. At least one filter value needs to be provided for a dimension to be used.
Values are organizations, projects, clusters, or services.
Flag to control whether usage that matches the filter criteria, but does not have values for all filter criteria is included in response. Default is false, which excludes the partially matching data.
The list of organizations to be included in the Cost Explorer Query.
Format of each should match the following pattern: ^([a-f0-9]{24})$.
The list of projects to be included in the Cost Explorer Query.
Format of each should match the following pattern: ^([a-f0-9]{24})$.
The list of SKU services to be included in the Cost Explorer Query.
Values are Atlas, Clusters, Storage, Serverless Instances, Backup, Data Transfer, BI Connector, Premium Features, Atlas Data Federation, Atlas Stream Processing, App Services, Charts, Cloud Manager, Cloud Manager Standard/Premium, Legacy Backup, AI Models, Automated Embedding, Flex Consulting, Support, Credits, DSC Compute, or DSC Storage.
The inclusive starting date for the Cost Explorer query. The date must be the start of a month.
atlas api invoices createCostExplorerProcess --help
import (
"os"
"context"
"log"
sdk "go.mongodb.org/atlas-sdk/v20231001001/admin"
)
func main() {
ctx := context.Background()
clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")
// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth
client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))
if err != nil {
log.Fatalf("Error: %v", err)
}
params = &sdk.CreateOrgBillingCostExplorerUsageProcessApiParams{}
sdkResp, httpResp, err := client.InvoicesApi.
CreateOrgBillingCostExplorerUsageProcessWithParams(ctx, params).
Execute()
}
curl --include --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/vnd.atlas.2023-10-01+json" \
--header "Content-Type: application/json" \
-X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage" \
-d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest --include \
--header "Accept: application/vnd.atlas.2023-10-01+json" \
--header "Content-Type: application/json" \
-X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage" \
-d '{ <Payload> }'
{
"clusters": [
"32b6e34b3d91647abb20e7b8"
],
"endDate": "2026-05-04",
"groupBy": "organizations",
"includePartialMatches": true,
"organizations": [
"32b6e34b3d91647abb20e7b8"
],
"projects": [
"32b6e34b3d91647abb20e7b8"
],
"services": [
"Atlas"
],
"startDate": "2026-05-04"
}
{
"token": "d9ab638a801efe182f98ae3e18ea4bb47b9fda808a28a8c7de205bb0e94f7d71"
}
{
"error": 400,
"detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
"reason": "Bad Request",
"errorCode": "VALIDATION_ERROR"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}