# automation-api


01/25/2024, 12:00 AM
Q: How can I do a
pulumi login
(to Pulumi Cloud) via the automation API? I have a use case where I sometimes am using Pulumi Cloud and sometimes S3, code in thread
I’m using the Go SDK, ProjectBackend
Copy code
import (
    ws "<|>"

proj, err := ws.LoadProject("./Pulumi.yaml"))
proj.Backend = &ws.ProjectBackend{
	URL: "???",
When I set the the backend URL to
, that works. When I set the backend URL to empty string or don’t set it, Pulumi uses the backend currently logged in at the user level. In the specific case that I manually ran a
pulumi login
to Pulumi Cloud most recently on this machine, it works. I don’t consider this viable, since I will be executing in a variety of environments and have no control of the system Pulumi login state. When I set the backend URL to
, I get the error
Copy code
error: getting user info from <>: unmarshalling response object: invalid character '\u003c' looking for beginning of value\n\n
Note that I am setting
, I have already tested that auth is not the issue. Judging from the code in the Pulumi CLI, there isn’t simply a URL I can pass in to indicate that I want to use Pulumi Cloud.


01/25/2024, 3:36 AM
You'll want


01/25/2024, 5:17 PM
Thank you very much, that was exactly what I was looking for! Will have a doc improvement PR up shortly