godo.HostedAgents.StartProviderAuth()

Generated on 5 Nov 2026 from godo version v1.236.0

Usage

client.HostedAgents.StartProviderAuth(ctx context.Context, provider string) (*godo.HostedAgentProviderAuthStart, *godo.Response, error)

Description

StartProviderAuth begins (or resumes) the team-scoped connect flow for an external provider. The server derives the team from the authenticated principal, so the POST carries an empty JSON object body.

Parameters

provider string required

Returns

*godo.HostedAgentProviderAuthStart
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.HostedAgentProviderAuthStart

HostedAgentProviderAuthStart is returned by POST /v2/harness-runtime/auth/{provider}. Status is “pending” when the user must still authorize in a browser (ConnectURL/PollURL/VerificationCode are set), or “success” when the team is already connected (those fields are empty). It is a free-form connect-flow status, distinct from the HostedAgentProviderAuthState session field. The authorization handle is never exposed: tokens are exchanged server-side at session time.

Provider string

JSON key: provider

Status string

JSON key: status

ConnectURL string

Omitted from JSON when empty. JSON key: connect_url

PollURL string

Omitted from JSON when empty. JSON key: poll_url

VerificationCode string

Omitted from JSON when empty. JSON key: verification_code

ExpiresAt *godo.Timestamp

Omitted from JSON when empty. JSON key: expires_at

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.HostedAgents.StartProviderAuth(ctx, "<your-provider>")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

More Information

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.