AlexxIT/go2rtc · error

wyze: api_key and api_id required for account

Error message

wyze: api_key and api_id required for account: %s

What it means

getCloud found a matching account entry, but its APIKey or APIID fields are empty. The Wyze cloud API cannot be authenticated without both credentials, so the function refuses to build a Cloud client; the fix is supplying api_key and api_id in the account config.

Solutions

  1. Fill in both api_key and api_id in the wyze config for this account
  2. Obtain the key/id from the Wyze app keyring service and re-authenticate
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/wyze/wyze.go:49 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07). Data as JSON: /api/errors/7564e16f7c9adef9. Report an issue: GitHub.

Appendix: source

Thrown at internal/wyze/wyze.go:49

	log := app.GetLogger("wyze")

	streams.HandleFunc("wyze", func(rawURL string) (core.Producer, error) {
		log.Debug().Msgf("wyze: dial %s", rawURL)
		return wyze.NewProducer(rawURL)
	})

	api.HandleFunc("api/wyze", apiWyze)
}

func getCloud(email string) (*wyze.Cloud, error) {
	cfg, ok := accounts[email]
	if !ok {
		return nil, fmt.Errorf("wyze: account not found: %s", email)
	}

	if cfg.APIKey == "" || cfg.APIID == "" {
		return nil, fmt.Errorf("wyze: api_key and api_id required for account: %s", email)
	}

	cloud := wyze.NewCloud(cfg.APIKey, cfg.APIID)

	if err := cloud.Login(email, cfg.Password); err != nil {
		return nil, err
	}

	return cloud, nil
}

func apiWyze(w http.ResponseWriter, r *http.Request) {
	switch r.Method {
	case "GET":
		apiDeviceList(w, r)
	case "POST":
		apiAuth(w, r)
	}

View on GitHub (pinned to c245815e75)