--- title: "Agent.Add - Web Scraping API - Mozenda" slug: "agentadd" description: "Agent.Add, as you might have guessed, adds a new agent via the Mozenda API. Note - this operation cannot be used to overwrite an existing agent. " updated: 2026-05-28T22:14:52Z published: 2026-05-28T22:14:52Z canonical: "help.mozenda.com/agentadd" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.mozenda.com/llms.txt > Use this file to discover all available pages before exploring further. # Agent.Add ### Description Adds a new **agent**. The existing **agent** must be deleted first using the `Agent.Delete` request. :::(Warning) (Warning!) Cannot be used to overwrite an existing **agent**. ::: ### URL parameters :::(Info) (URL parameter ordering) The **URL parameters** below are listed in the order they should be entered in the API **URL**. ::: | Name | Required | Type | Description | |:-----------|:---------|:-------|:----------------------------------------| | `Name` | True | string | Name for the new **agent**. | | `Definition` | True | file |The XML definition of the **agent** to be added. | | `Description` | False | string | Description for the new **agent**. | | `BrowserIsolation` | False | boolean | True to run the **agent** with isolated browsers. Default is *False*. | ### Request body In order to use the `Agent.Add`, you will need to attach the Mozenda-made XML file that correlates with an **agent**. ### Responses | Name | Type | Description | |:---------------|:-------------------|:---------------------------------| | `Result` | string | `Success` if the operation was successful. | | `AgentID` | numeric |Unique identifier for the **agent** created. | | `CollectionID` | numeric | Unique identifier of the **collection**. | ### Sample request ```bash curl -X POST "https://api.mozenda.com/rest?WebServiceKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=Agent.Add&Name=API-Test&ResponseFormat=JSON" -F 'file=@/c/Politico.xml' ``` ### Sample responses #### XML ```xml Success 1009 1009 ``` #### JSON (add `&ResponseFormat=JSON`) ```json { "AgentID": 1043, "CollectionID": 1063, "JsonResult": { "Command": "Agent.Add", "AutoLoggedIn": false, "WebConsoleKey": "", "Result": "Success", "ErrorCode": "", "ErrorDescription": "", "ErrorList": [], "ExecutionTime": { "Ticks": 0, "Days": 0, "Hours": 0, "Milliseconds": 0, "Minutes": 0, "Seconds": 0, "TotalDays": 0, "TotalHours": 0, "TotalMilliseconds": 0, "TotalMinutes": 0, "TotalSeconds": 0 } } } ```