## StopAgentExecution `client.Agents.StopExecution(ctx, body) (*AgentStopExecutionResponse, error)` **post** `/gitpod.v1.AgentService/StopAgentExecution` Stops an active agent execution. Use this method to: - Stop an agent that is currently running - Prevent further processing or resource usage ### Examples - Stop an agent execution by ID: ```yaml agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35" ``` ### Parameters - `body AgentStopExecutionParams` - `AgentExecutionID param.Field[string]` ### Returns - `type AgentStopExecutionResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Agents.StopExecution(context.TODO(), gitpod.AgentStopExecutionParams{ AgentExecutionID: gitpod.F("6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response) } ``` #### Response ```json {} ```