Python SDK health check to Temporal Cloud fails with "Request unauthorized."

Hi team,

I am using the Python SDK with Temporal Cloud and trying to call await client.service_client.check_health() for a container health check, but it is failing with “Request unauthorized.”. However, besides the health check, the worker seems successfully connected and authenticated as it can run workflows and activities without a problem.

This is my client config:

    client = await Client.connect(
        target_host="us-west-2.aws.api.temporal.io:7233",
        namespace=os.environ["TEMPORAL_NAMESPACE"],
        api_key=os.environ["TEMPORAL_API_KEY"],
        tls=True,
        data_converter=pydantic_data_converter,
    )

I have tried granting “Write” and “Namespace Admin” permissions to the user associated with the API key to no avail.

At this point, I’m not sure if I have a misconfigured client or misconfigured Cloud permissions, or something else. I would appreciate any insight.

Thanks!

Did you ever make any progress troubleshooting this?

I’m facing the same “Request unauthorized” error with the connecting with an API key using the Go SDK. Having trouble knowing what to try next.

No, unfortunately I never resolved this. I would like to include this server check in my container health check, but I’m skipping it for now.

It would be great if someone from Temporal can chime in with whether or not the health check endpoint is supported by Temporal Cloud.

I can also confirm that this is happening (Python SDK v1.18.2)

{
    "timestamp": "2025-11-07T15:00:57.027Z",
    "service": "",
    "level": "ERROR",
    "loggerName": "root",
    "message": "Exception checking state of Temporal connection.",
    "error":
    {
        "type": "RPCError",
        "code": "UNKNOWN_ERROR",
        "stack_trace": "Traceback (most recent call last):
          File \"~/cool_project/.venv/Lib/site-packages/temporalio/service.py\", line 1351, in _rpc_call
            resp = await client.call(
                   ^^^^^^^^^^^^^^^^^^
            ...<7 lines>...
            )
            ^
          File \"~/cool_project/.venv/Lib/site-packages/temporalio/bridge/client.py\", line 151, in call
            resp.ParseFromString(await resp_fut)
                                 ^^^^^^^^^^^^^^
        temporal_sdk_bridge.RPCError: (7, 'Request unauthorized.', b'')
        During handling of the above exception, another exception occurred:
        Traceback (most recent call last):
          File \"~/cool_project/src/temporal/worker.py\", line 178, in check_connectivity
            return await self.client.service_client.check_health()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File \"~/cool_project/.venv/Lib/site-packages/temporalio/service.py\", line 249, in check_health
            resp = await self._check_health_call(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            ...<4 lines>...
            )
            ^
          File \"~/cool_project/.venv/Lib/site-packages/temporalio/service.py\", line 1278, in __call__
            return await self.service_client._rpc_call(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            ...<7 lines>...
            )
            ^
          File \"~/cool_project/.venv/Lib/site-packages/temporalio/service.py\", line 1366, in _rpc_call
            raise RPCError(message, RPCStatusCode(status), details)
        temporalio.service.RPCError: Request unauthorized.",
        "details":
        {}
    }
}

The API is documented so it should be usable. Are there any updates regarding this?
Thanks.