## Update an App `client.MagicTransit.Apps.Update(ctx, accountAppID, params) (*AppUpdateResponse, error)` **put** `/accounts/{account_id}/magic/apps/{account_app_id}` Updates an Account App ### Parameters - `accountAppID string` Identifier - `params AppUpdateParams` - `AccountID param.Field[string]` Path param: Identifier - `Hostnames param.Field[[]string]` Body param: FQDNs to associate with traffic decisions. - `IPSubnets param.Field[[]string]` Body param: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `Name param.Field[string]` Body param: Display name for the app. - `SourceSubnets param.Field[[]string]` Body param: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `Type param.Field[string]` Body param: Category of the app. ### Returns - `type AppUpdateResponse struct{…}` Custom app defined for an account. - `AccountAppID string` Magic account app ID. - `Hostnames []string` FQDNs to associate with traffic decisions. - `IPSubnets []string` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `Name string` Display name for the app. - `SourceSubnets []string` IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) - `Type string` Category of the app. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/magic_transit" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) app, err := client.MagicTransit.Apps.Update( context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353", magic_transit.AppUpdateParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", app.AccountAppID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "account_app_id": "ac60d3d0435248289d446cedd870bcf4", "hostnames": [ "auth.cloudflare.com" ], "ip_subnets": [ "192.0.2.0/24" ], "name": "Cloudflare Dashboard", "source_subnets": [ "192.0.2.0/24" ], "type": "Development" }, "success": true } ```