Checklist
Description
Calling client.EventStreams.Redeliveries.CreateAsync() with a DateFrom value always results in a 400 Bad Request from the Auth0 Management API.
The CreateEventStreamRedeliveryRequestContent.DateFrom property is typed as DateTime?. When serialized by the SDK's JsonUtils.Serialize, it produces an ISO 8601 string with sub-second precision (24 characters), e.g. 2026-07-01T00:00:00.000Z.
However, the POST /api/v2/event-streams/{id}/redeliver endpoint enforces a maximum of 20 characters for the date_from field, rejecting sub-second precision:
{
"statusCode": 400,
"error": "Bad Request",
"message": "Payload validation error: 'String is too long (24 chars), maximum 20' on property date_from (An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision).",
"errorCode": "invalid_body"
}
The expected format is yyyy-MM-ddTHH:mm:ssZ (exactly 20 characters). Since DateFrom is a DateTime? and serialization is handled internally by the SDK, callers have no way to control the format — the method is unusable.
Expected: The SDK should serialize DateFrom (and DateTo) in yyyy-MM-ddTHH:mm:ssZ format, truncating sub-second precision before sending the request. This could be done via a custom JsonConverter on the property or by formatting in the client before serialization.
Related: This is the same endpoint family as Deliveries.ListAsync, which has a separate deserialization bug — see #1065.
Reproduction
Reproduces 100% of the time — any DateTime value with sub-second precision triggers it (and System.Text.Json always serializes with milliseconds).
- Create a
ManagementClient with valid credentials and scopes including update:event_deliveries.
- Call
Redeliveries.CreateAsync with any DateFrom:
await client.EventStreams.Redeliveries.CreateAsync(
"est_your_stream_id",
new CreateEventStreamRedeliveryRequestContent
{
DateFrom = new DateTime(2026, 7, 1, 0, 0, 0, DateTimeKind.Utc),
Statuses = [EventStreamDeliveryStatusEnum.Failed]
});
- Observe the 400 response:
Auth0.ManagementApi.ManagementApiException
StatusCode: 400
RawResponse: {"statusCode":400,"error":"Bad Request","message":"Payload validation error: 'String is too long (24 chars), maximum 20' on property date_from (An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision).","errorCode":"invalid_body"}
Note: even DateTime values with zero milliseconds are serialized as 2026-07-01T00:00:00.000Z (24 chars) by System.Text.Json.
Additional context
No response
auth0.net version
9.0.0
.NET version
10.0
Checklist
Description
Calling
client.EventStreams.Redeliveries.CreateAsync()with aDateFromvalue always results in a400 Bad Requestfrom the Auth0 Management API.The
CreateEventStreamRedeliveryRequestContent.DateFromproperty is typed asDateTime?. When serialized by the SDK'sJsonUtils.Serialize, it produces an ISO 8601 string with sub-second precision (24 characters), e.g.2026-07-01T00:00:00.000Z.However, the
POST /api/v2/event-streams/{id}/redeliverendpoint enforces a maximum of 20 characters for thedate_fromfield, rejecting sub-second precision:{ "statusCode": 400, "error": "Bad Request", "message": "Payload validation error: 'String is too long (24 chars), maximum 20' on property date_from (An RFC-3339 date-time for redelivery start, inclusive. Does not allow sub-second precision).", "errorCode": "invalid_body" }The expected format is
yyyy-MM-ddTHH:mm:ssZ(exactly 20 characters). SinceDateFromis aDateTime?and serialization is handled internally by the SDK, callers have no way to control the format — the method is unusable.Expected: The SDK should serialize
DateFrom(andDateTo) inyyyy-MM-ddTHH:mm:ssZformat, truncating sub-second precision before sending the request. This could be done via a customJsonConverteron the property or by formatting in the client before serialization.Related: This is the same endpoint family as
Deliveries.ListAsync, which has a separate deserialization bug — see #1065.Reproduction
Reproduces 100% of the time — any
DateTimevalue with sub-second precision triggers it (andSystem.Text.Jsonalways serializes with milliseconds).ManagementClientwith valid credentials and scopes includingupdate:event_deliveries.Redeliveries.CreateAsyncwith anyDateFrom:Note: even
DateTimevalues with zero milliseconds are serialized as2026-07-01T00:00:00.000Z(24 chars) bySystem.Text.Json.Additional context
No response
auth0.net version
9.0.0
.NET version
10.0