---
title: "POST /SamplingTargets"
method: POST
path: "/SamplingTargets"
---

# POST /SamplingTargets

`POST /SamplingTargets`

Requests a sampling quota for rules that the service is using to sample requests.

## Request body

- object
  - `SamplingStatisticsDocuments` SamplingStatisticsDocument[], required — Information about rules that the service is using to sample requests.
    - `RuleName` string, required — The name of the sampling rule.
    - `ClientID` string, required — A unique identifier for the service in hexadecimal.
    - `Timestamp` string, date-time, required — The current time.
    - `RequestCount` integer, required — The number of requests that matched the rule.
    - `SampledCount` integer, required — The number of requests recorded.
    - `BorrowCount` integer — The number of requests recorded with borrowed reservoir quota.

## Response `200`

Success

- GetSamplingTargetsResult
  - `SamplingTargetDocuments` SamplingTargetDocument[] — Updated rules that the service should use to sample requests.
    - `RuleName` string — The name of the sampling rule.
    - `FixedRate` number, double — The percentage of matching requests to instrument, after the reservoir is exhausted.
    - `ReservoirQuota` integer — The number of requests per second that X-Ray allocated for this service.
    - `ReservoirQuotaTTL` string, date-time — When the reservoir quota expires.
    - `Interval` integer — The number of seconds for the service to wait before getting sampling targets again.
  - `LastRuleModification` string, date-time — The last time a user changed the sampling rule configuration. If the sampling rule configuration changed since the service last retrieved it, the service should call <a href="https://docs.aws.amazon.com/xray/latest/api/API_GetSamplingRules.html">GetSamplingRules</a> to get the latest version.
  - `UnprocessedStatistics` UnprocessedStatistics[] — Information about <a href="https://docs.aws.amazon.com/xray/latest/api/API_SamplingStatisticsDocument.html">SamplingStatisticsDocument</a> that X-Ray could not process.
    - `RuleName` string — The name of the sampling rule.
    - `ErrorCode` string — The error code.
    - `Message` string — The error message.

## Other responses

- `480` — InvalidRequestException
- `481` — ThrottledException

---

[API](https://skmtc.net/aws/apis/xray.md) · [All operations](https://skmtc.net/aws/apis/xray/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/xray/versions/4970909a360e/schema)
