Cursor pagination failing on /api/v2/analytics/conversations/details/query

I’m curious as to why the cursor returned by the /api/v2/analytics/conversations/details/query endpoint stops working after the third page?

  1. Send initial POST with interval: '2023-10-01/2023-10-02' and size: 100.
  2. Extract nextPageToken from the response headers.
  3. Include nextPageToken in the Authorization: Bearer <token> header of the subsequent request.

The server returns a 400 Bad Request with "message": "Invalid token format". My Python SDK code looks like this:

response = client.analytics_api.post_analytics_conversations_details_query(
 body=query_body,
 next_page_token=next_token
)

Is the token supposed to be URL-encoded or handled differently in the REST client?