Loading
PHPの脆弱性に関する監視状況について 続きを読む
弊社ヘルプサイトの Agentforce でケース作成フォームが表示されない場合の対応方法続きを読む
メールアドレスがデフォルトのログイン方式となります 続きを読む

Anypoint Usage API for Object Store v2 consumption insights

公開日: Feb 11, 2026
解決策

ANNOUNCEMENT

Starting July 31, 2026, the capabilities offered by Object Store v2 Stats API and Object Store v2 Usage Charts will transition to the new Anypoint Usage Reports. Consequently, we will discontinue the legacy APIs and the usage sections for these products within Access Management, including hourly reporting for Object Store v2.

 

What You Need To Do

To maintain programmatic access to your data, we recommend the following:

  • Migrate to Anypoint Usage APIs: Transition from the deprecated Object Store v2 Stats APIs to the new Anypoint Usage APIs. The Anypoint Usage APIs offer a robust framework 

  • Update Time Granularity: Update your API configurations to pull data at a daily or monthly frequency, rather than hourly.

  • Switch to Anypoint Usage Reports: Transition from the deprecated Object Store v2 Usage Charts to the new  Daily Usage Dashboard for Anypoint Platform for your manual reporting needs.

Please refer to the official documentation for a detailed guide on the new APIs, including endpoints, query syntax, and examples.

Migration Guide and Key Considerations

Migrate from the legacy Object Store v2 statistics APIs to the Anypoint Usage API. The migration covers:

  • Object Store V2 Stats API (full migration)

For API reference documentation, see:

 

1. Key Differences

AspectOld APINew API (Usage API)
Query LanguageREST query parametersAMQL (SQL-like DSL)
Endpoint/api/v1/organizations/{orgId}/metering/usage/api/v1/meters:search
AuthenticationClient credentials via /authorizeBearer token + "Usage Viewer" permission
Date FormatISO 8601 (URL encoded)Epoch milliseconds
Granularityperiod=1monthTIMESERIES P1M or P1D
Data Availability1-day delay3-day delay

2. Authentication Changes


Old API: Client Credentials Flow


Step 1: Get the access token.

curl -X POST 'https://object-store-stats.anypoint.mulesoft.com/api/v1/authorize' \
  -H 'Content-Type: application/json' \
  -d '{
    "client_id": "your-client-id",
    "client_secret": "your-client-secret",
    "grant_type": "client_credentials"
  }'

Step 2: Use the token in the API call.

curl -X GET \
  -H 'Authorization: Bearer <access_token>' \  'https://object-store-stats.anypoint.mulesoft.com/api/v1/organizations/{orgId}?startDate=2024-01-01T00:00:00.000Z&endDate=2024-06-30T23:59:59.000Z&period=1month'

New API: Anypoint Platform Bearer Token

The Usage API requires an Anypoint Platform bearer token with "Usage Viewer" permission.

Step 1: Get the bearer token. (See Connected Apps Documentation)

curl -X POST curl -X POST https://anypoint.mulesoft.com/accounts/api/v2/oauth2/token \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d "client_id=YOUR_CLIENT_ID" \
 -d "client_secret=YOUR_CLIENT_SECRET" \
 -d "grant_type=client_credentials"

Step 2: Use the token in the API call.

curl -X POST 'https://anypoint.mulesoft.com/metering/usage/api/v1/meters:search' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <anypoint_token>' \
  -d '{"query": "SELECT ... FROM ... WHERE ... TIMESERIES P1M"}'

 

3. Example: Object Store Monthly Statistics

Old API Request

curl -X GET \
  -H 'Authorization: Bearer <token>' \  'https://object-store-stats.anypoint.mulesoft.com/api/v1/organizations/{orgId}?startDate=2024-01-01T00:00:00.000Z&endDate=2024-06-30T23:59:59.000Z&period=1month'

Old API Response

[
  {"timeStamp": "2024-01-01T00:00:00Z", "objectStoreRequestCount": 3442},
  {"timeStamp": "2024-02-01T00:00:00Z", "objectStoreRequestCount": 68772},
  {"timeStamp": "2024-03-01T00:00:00Z", "objectStoreRequestCount": 953}
]

New API Request

Step 1: Discover available meters:

curl -X GET 'https://anypoint.mulesoft.com/metering/usage/api/v1/meters:describe' \
  -H 'Authorization: Bearer <token>'

Step 2:  Query the Object Store meter:

curl -X POST 'https://anypoint.mulesoft.com/metering/usage/api/v1/meters:search' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <token>' \
  -d '{
    "query": "SELECT effective_api_requests 
              FROM object_store_effective_api_requests_count 
              WHERE timestamp between '1769990400000' and '1770076799999'
              TIMESERIES P1D"
  }'

Note: Confirm the exact meter and column names by calling the :describe endpoint, as they may vary.

 

4. Migration Reference

  • Date Format Conversion
    The Usage API uses epoch milliseconds instead of ISO 8601 strings.
ISO 8601 FormatEpoch Milliseconds
2024-01-01T00:00:00.000Z1704067200000
2024-06-30T23:59:59.000Z1719791999000
2024-12-31T23:59:59.000Z1735689599000
  • Period/Granularity Mapping
Old APIUsage API
period=month or period=1monthTIMESERIES P1M
period=day or period=1dayTIMESERIES P1D
  • Query Restrictions
RestrictionDetails
Timestamp filterMandatory in all queries
TIMESERIES clauseMandatory in all queries
Daily queries (P1D)Maximum 30-day range interval
Monthly queries (P1M)Maximum 60-day range interval
Data recency3-day delay for consolidation
Use of wildcard in SELECT statements (SELECT *)Not supported
  • AMQL Quick Reference
-- Basic query structure
SELECT <columns>
FROM <meter>
WHERE timestamp between <start_epoch> and <end_epoch>
  [AND org_id = '<org_id>']
  [AND env_id = '<env_id>']
TIMESERIES <P1M|P1D>

-- Supported functions
DIV(x, y)   -- Division
ADD(x, y)   -- Addition
MUL(x, y)   -- Multiplication
SUB(x, y)   -- Subtraction

-- Filter operators
=, !=, >, >=, <, <=, in, between

 

5. Access Management Charts vs Usage Reports

For overview of the reporting changes between Access Management usage charts and Usage reports, see the knowledge base article "Anypoint Usage Reports for Anypoint MQ and Object Store v2 consumption insights".

 

FAQ

Q: What are the meter names for Object Store?
A: Call the :describe endpoint for current meter names. These names are self-describing and can change over time.
Q: Why is there a 3-day delay?
A: The Usage API consolidates data for accuracy and consistency.
Q: Can I get daily granularity?
A: Yes. Use TIMESERIES P1D. Daily queries have a 30-day range limit.

ナレッジ記事番号

005306451

 
読み込み中
Salesforce Help | Article