Amazon Macie Usage API

The Usage API from Amazon Macie — 2 operation(s) for usage.

GitHub OpenAPI

Operations 2

POST /usage/statistics Get Usage Statistics #
GET /usage Get Usage Totals #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/amazon-macie:amazon-macie-usage-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

amazon-macie-usage-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amazon Macie 2 Usage API
  version: '2020-01-01'
  description: Generated from AWS's published Smithy model for Amazon Macie 2. 2 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://macie2.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /usage/statistics:
    post:
      operationId: GetUsageStatistics
      summary: Get Usage Statistics
      description: Retrieves (queries) quotas and aggregated usage data for one or more accounts.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUsageStatisticsResponse'
        '403':
          description: AccessDeniedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '409':
          description: ConflictException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictException'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '402':
          description: ServiceQuotaExceededException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
        '400':
          description: ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filterBy:
                  type: array
                  items:
                    $ref: '#/components/schemas/UsageStatisticsFilter'
                  description: An array of objects, one for each condition to use to filter the query results. If you specify
                    more than one condition, Amazon Macie uses an AND operator to join the conditions.
                maxResults:
                  type: integer
                  description: The maximum number of items to include in each page of the response.
                nextToken:
                  type: string
                  description: The nextToken string that specifies which page of results to return in a paginated response.
                sortBy:
                  $ref: '#/components/schemas/UsageStatisticsSortBy'
                timeRange:
                  type: string
                  enum:
                  - MONTH_TO_DATE
                  - PAST_30_DAYS
                  description: 'The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the
                    current calendar month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don''t specify a
                    value, Amazon Macie provides usage data for the preceding 30 days.'
      tags:
      - Usage
  /usage:
    get:
      operationId: GetUsageTotals
      summary: Get Usage Totals
      description: Retrieves (queries) aggregated usage data for an account.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetUsageTotalsResponse'
        '403':
          description: AccessDeniedException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessDeniedException'
        '409':
          description: ConflictException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictException'
        '500':
          description: InternalServerException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerException'
        '404':
          description: ResourceNotFoundException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
        '402':
          description: ServiceQuotaExceededException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
        '429':
          description: ThrottlingException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThrottlingException'
        '400':
          description: ValidationException
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationException'
      parameters:
      - name: timeRange
        in: query
        schema:
          type: string
        description: 'The inclusive time period to retrieve the data for. Valid values are: MONTH_TO_DATE, for the current
          calendar month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don''t specify a value for this parameter,
          Amazon Macie provides aggregated usage data for the preceding 30 days.'
      tags:
      - Usage
components:
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
        request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: macie2
  schemas:
    AccessDeniedException:
      type: object
      properties:
        message:
          type: string
          description: The explanation of the error that occurred.
    ConflictException:
      type: object
      properties:
        message:
          type: string
          description: The explanation of the error that occurred.
    GetUsageStatisticsResponse:
      type: object
      properties:
        nextToken:
          type: string
          description: The string to use in a subsequent request to get the next page of results in a paginated response.
            This value is null if there are no additional pages.
        records:
          type: array
          items:
            $ref: '#/components/schemas/UsageRecord'
          description: An array of objects that contains the results of the query. Each object contains the data for an account
            that matches the filter criteria specified in the request.
        timeRange:
          type: string
          enum:
          - MONTH_TO_DATE
          - PAST_30_DAYS
          description: 'The inclusive time period that the usage data applies to. Possible values are: MONTH_TO_DATE, for
            the current calendar month to date; and, PAST_30_DAYS, for the preceding 30 days.'
    GetUsageTotalsResponse:
      type: object
      properties:
        timeRange:
          type: string
          enum:
          - MONTH_TO_DATE
          - PAST_30_DAYS
          description: 'The inclusive time period that the usage data applies to. Possible values are: MONTH_TO_DATE, for
            the current calendar month to date; and, PAST_30_DAYS, for the preceding 30 days.'
        usageTotals:
          type: array
          items:
            $ref: '#/components/schemas/UsageTotal'
          description: An array of objects that contains the results of the query. Each object contains the data for a specific
            usage metric.
    InternalServerException:
      type: object
      properties:
        message:
          type: string
          description: The explanation of the error that occurred.
    ResourceNotFoundException:
      type: object
      properties:
        message:
          type: string
          description: The explanation of the error that occurred.
    ServiceLimit:
      type: object
      properties:
        isServiceLimited:
          type: boolean
          description: Specifies whether the account has met the quota that corresponds to the metric specified by the UsageByAccount.type
            field in the response.
        unit:
          type: string
          enum:
          - TERABYTES
          description: The unit of measurement for the value specified by the value field.
        value:
          type: integer
          description: The value for the metric specified by the UsageByAccount.type field in the response.
    ServiceQuotaExceededException:
      type: object
      properties:
        message:
          type: string
          description: The explanation of the error that occurred.
    ThrottlingException:
      type: object
      properties:
        message:
          type: string
          description: The explanation of the error that occurred.
    UsageByAccount:
      type: object
      properties:
        currency:
          type: string
          enum:
          - USD
          description: The type of currency that the value for the metric (estimatedCost) is reported in.
        estimatedCost:
          type: string
          description: The estimated value for the metric.
        serviceLimit:
          $ref: '#/components/schemas/ServiceLimit'
        type:
          type: string
          enum:
          - DATA_INVENTORY_EVALUATION
          - SENSITIVE_DATA_DISCOVERY
          - AUTOMATED_SENSITIVE_DATA_DISCOVERY
          - AUTOMATED_OBJECT_MONITORING
          description: 'The name of the metric. Possible values are: AUTOMATED_OBJECT_MONITORING, to monitor S3 objects for
            automated sensitive data discovery; AUTOMATED_SENSITIVE_DATA_DISCOVERY, to analyze S3 objects for automated sensitive
            data discovery; DATA_INVENTORY_EVALUATION, to monitor S3 buckets; and, SENSITIVE_DATA_DISCOVERY, to run classification
            jobs.'
    UsageRecord:
      type: object
      properties:
        accountId:
          type: string
          description: The unique identifier for the Amazon Web Services account that the data applies to.
        automatedDiscoveryFreeTrialStartDate:
          type: string
          format: date-time
          description: The date and time, in UTC and extended ISO 8601 format, when the free trial of automated sensitive
            data discovery started for the account. This value is null if automated sensitive data discovery hasn't been enabled
            for the account.
        freeTrialStartDate:
          type: string
          format: date-time
          description: The date and time, in UTC and extended ISO 8601 format, when the Amazon Macie free trial started for
            the account.
        usage:
          type: array
          items:
            $ref: '#/components/schemas/UsageByAccount'
          description: An array of objects that contains usage data and quotas for the account. Each object contains the data
            for a specific usage metric and the corresponding quota.
    UsageStatisticsFilter:
      type: object
      properties:
        comparator:
          type: string
          enum:
          - GT
          - GTE
          - LT
          - LTE
          - EQ
          - NE
          - CONTAINS
          description: The operator to use in the condition. If the value for the key property is accountId, this value must
            be CONTAINS. If the value for the key property is any other supported field, this value can be EQ, GT, GTE, LT,
            LTE, or NE.
        key:
          type: string
          enum:
          - accountId
          - serviceLimit
          - freeTrialStartDate
          - total
          description: The field to use in the condition.
        values:
          type: array
          items:
            type: string
          description: 'An array that lists values to use in the condition, based on the value for the field specified by
            the key property. If the value for the key property is accountId, this array can specify multiple values. Otherwise,
            this array can specify only one value. Valid values for each supported field are: accountId - The unique identifier
            for an Amazon Web Services account. freeTrialStartDate - The date and time, in UTC and extended ISO 8601 format,
            when the Amazon Macie free trial started for an account. serviceLimit - A Boolean (true or false) value that indicates
            whether an account has reached its mo'
    UsageStatisticsSortBy:
      type: object
      properties:
        key:
          type: string
          enum:
          - accountId
          - total
          - serviceLimitValue
          - freeTrialStartDate
          description: The field to sort the results by.
        orderBy:
          type: string
          enum:
          - ASC
          - DESC
          description: 'The sort order to apply to the results, based on the value for the field specified by the key property.
            Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.'
    UsageTotal:
      type: object
      properties:
        currency:
          type: string
          enum:
          - USD
          description: The type of currency that the value for the metric (estimatedCost) is reported in.
        estimatedCost:
          type: string
          description: The estimated value for the metric.
        type:
          type: string
          enum:
          - DATA_INVENTORY_EVALUATION
          - SENSITIVE_DATA_DISCOVERY
          - AUTOMATED_SENSITIVE_DATA_DISCOVERY
          - AUTOMATED_OBJECT_MONITORING
          description: 'The name of the metric. Possible values are: AUTOMATED_OBJECT_MONITORING, to monitor S3 objects for
            automated sensitive data discovery; AUTOMATED_SENSITIVE_DATA_DISCOVERY, to analyze S3 objects for automated sensitive
            data discovery; DATA_INVENTORY_EVALUATION, to monitor S3 buckets; and, SENSITIVE_DATA_DISCOVERY, to run classification
            jobs.'
    ValidationException:
      type: object
      properties:
        message:
          type: string
          description: The explanation of the error that occurred.
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/macie2/service/2020-01-01/macie2-2020-01-01.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)