# Build agents

Generate, regenerate, commit, or cancel candidate plans for an existing agent, and view the resources available during authoring. This page does not cover normal agent creation or version management.

## Prerequisites

Prepare credentials that can access the target workspace and the ID of the agent to build. For service endpoints, authentication, and general request formats, see [Prepare to call an API](../../api-call-basics.md).

Candidate-plan input and follow-up operations are defined by their action pages. Submitting a candidate plan does not make it the current configuration; commit the candidate to apply it.

## Call sequence

1. First [get the current agent configuration](../../../../reference/api/ai-studio/agents/agent-builder/get-current-agent.md) to confirm the current configuration and target agent.
2. Query resources available for authoring, then generate a candidate plan.
3. Regenerate the candidate when you need to adjust it. Commit it when you decide to use it, or cancel it when you do not.
4. Query the current agent configuration again to confirm the resulting configuration.

## API operations

### View configuration and available resources

| What you need to do | API operation | Use it when |
| --- | --- | --- |
| Get the current agent configuration | [Get the current agent configuration](../../../../reference/api/ai-studio/agents/agent-builder/get-current-agent.md) | Before authoring or to confirm a committed result. |
| List available authoring resources | [List available authoring resources](../../../../reference/api/ai-studio/agents/agent-builder/list-authoring-resources.md) | Learn available resources before generating a candidate plan. |

### Generate and handle candidate plans

| What you need to do | API operation | Use it when |
| --- | --- | --- |
| Generate an agent candidate plan | [Generate an agent candidate plan](../../../../reference/api/ai-studio/agents/agent-builder/propose-candidate.md) | Generate a candidate plan for the current target. |
| Regenerate an agent candidate plan | [Regenerate an agent candidate plan](../../../../reference/api/ai-studio/agents/agent-builder/repropose-candidate.md) | Adjust a candidate plan. |
| Commit an agent candidate plan | [Commit an agent candidate plan](../../../../reference/api/ai-studio/agents/agent-builder/commit-candidate.md) | You decided to use the candidate plan. |
| Cancel an agent candidate plan | [Cancel an agent candidate plan](../../../../reference/api/ai-studio/agents/agent-builder/cancel-candidate.md) | You no longer want to use the candidate plan. |

## Confirm the result

After committing a candidate plan, use [Get the current agent configuration](../../../../reference/api/ai-studio/agents/agent-builder/get-current-agent.md) to view the current configuration. Candidate status and commit conditions are defined by the corresponding action page.

## Next steps

- [Create and maintain agents](agents.md)
- [Connect tools, skills, and channels](tools-skills-channels.md)
