Publish the next sourcing policy version (PublishSourcingPolicy)
PUT/sourcing-policy
Replaces the whole policy document: validates every range, stores version n+1 (n is the highest stored version, 0 when none) and raises the analytics-only SourcingPolicyPublished event in the same transaction. An omitted field takes its default, 0 (the lever is off); an empty body is 400. Every call publishes a NEW version, so it takes an Idempotency-Key like a POST: the same key with the same body replays the first answer for 24 hours instead of publishing twice; a retryable refusal (validation-failed, concurrent-update) is not stored, so the retry under the same key publishes; policy-version-not-next (the policy version is at its ceiling) is stored and replayed instead. The same key with another request that was stored is 409 idempotency-key-reused. Searches that started before the publish keep the version they read.
Request
Responses
- 200
- 400
- 405
- 409
- 422
- 500
The published version. A replay of the first answer carries Idempotency-Replayed: true.
Response Headers
Present, with the value true, only when the response is a replay of the first answer.
idempotency-key-required (no Idempotency-Key header) or idempotency-key-invalid (not 1 to 128 printable ASCII characters), or malformed-request (no body, not valid JSON, a field that is not an integer, an unknown field, trailing data, or a NUL character).
method-not-allowed, the method is not served on this path.
concurrent-update (another publish took the same version number; not stored: retry with the same Idempotency-Key), policy-version-not-next (the stored policy version is at its ceiling and cannot be incremented; stored and replayed: the same request under the same key replays this answer, because no use case can lower the ceiling and the retry cannot pass) or idempotency-key-reused (the key was already used with a different request).
Response Headers
Present, with the value true, only when the response is a replay of the first answer.
validation-failed (ErrValidation), crossRegionSurchargeCents outside 0..100000, maxCostDeviationPercent outside 0..200 or consolidationMaxAssignments outside 0..10. Not stored: the key is released and a retry runs again.
Response Headers
Present, with the value true, only when the response is a replay of the first answer.
internal-error, an unexpected failure (the detail never carries the internal message).