---
title: "Create an Agent"
method: POST
path: "/api/v2/agents"
tags: ["Agents"]
---

# Create an Agent

`POST /api/v2/agents`

## Request

- Base URL: `https://secure.agco-ats.com`
- URL: `https://secure.agco-ats.com/api/v2/agents`
- Auth: none declared

Creates an Agent.  The body of the POST is the Agent to create.  The AgentID will be assigned
            on creation of the Agent.  When successful, the response is the AgentID.  If unsuccessful, an
            appropriate ApiError is returned.

## Request body

- BuildSystemSharedDTOAgent: A DTO for an IAgent
  - `AgentID` integer: The id of the Agent
  - `UserID` integer, required: The UserID of the Agent
  - `MachineName` string, required: The machine name of the computer the agent is running on
  - `StepConfigurations` BuildSystemSharedDTOStepConfiguration[]: The agent's step configurations
    - `StepImplementationID` string, required: The Implementation ID of the step this configuration is for
    - `Configurations` string[]: The configuration names supported. The configurations collection is empty for steps which do not require configuration.
  - `Status` BuildSystemSharedDTOAgentStatus, required: A DTO for an IAgentStatus
    - `Online` boolean, required: Indicates if the agent is online
    - `LastStatusUpdate` string, date-time: ReadOnly. The UTC date and time of the last status update
  - `KeepAliveInterval` integer, required: The 'Heartbeat Interval' used by the Build Agent.

## Response `200`

OK

- integer

## Other responses

- `default`: API Error Response

---

[API](https://skmtc.dev/agco-ats/apis/agco-ats-api.md) - [All operations](https://skmtc.dev/agco-ats/apis/agco-ats-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agco-ats/apis/agco-ats-api/revisions/8b416443df5c?raw)
