# Create Plan Environment( Appium2)

### Endpoint Information

* **URL**: \<your-gateway-url>/devicepark/environment/plan/{planId}
* **Method**: `POST`
* **Authentication**: Required (`Bearer Token`)

### Request Body

```
[
  {
    "platform": "iOS",
    "manufacturer": "Apple",
    "model": "iPhone13,2",
    "platformVersion": "18.6.2",
    "marketName": "iPhone 12",
    "privateDevice": false
  }
]
```

| Parameter       | Type     | Description                                                                                           |
| --------------- | -------- | ----------------------------------------------------------------------------------------------------- |
| platform        | `String` | Operating system of the device                                                                        |
| manufacturer    | `String` | Name of the device manufacturer (e.g., “Apple”, “Samsung”).                                           |
| model           | `String` | Device model identifier assigned by the manufacturer (e.g., “iPhone13,2”, “SM-A305F”).                |
| platformVersion | `String` | Version of the operating system running on the device.                                                |
| marketName      | `String` | Commercial or user-friendly name of the device (e.g., “iPhone 12”, “Galaxy A30”).                     |
| privateDevice   | boolean  | Indicates whether the device is private to a specific company/user or part of the shared device pool. |

### Response Body

```
{
    "data": [
        {
            "id": 753,
            "platform": "iOS",
            "platformName": null,
            "platformVersion": "18.6.2",
            "model": "iPhone13,2",
            "modelName": null,
            "manufacturer": "Apple",
            "marketName": "iPhone 12",
            "testFrameworkType": null,
            "udid": null,
            "licenceId": null,
            "enabled": null,
            "privateDevice": false
        }
    ],
    "result": {
        "code": 0,
        "message": "success"
    }
}
```

| Parameter      | Type    | Description                                                                       |
| -------------- | ------- | --------------------------------------------------------------------------------- |
| data           | Object  | The payload of the response. In this case `null` since no extra data is returned. |
| result         | Object  | Contains details about the outcome of the operation.                              |
| result.code    | Integer | The result code (e.g., `0` indicates success).                                    |
| result.message | String  | A message describing the outcome (e.g., `"success"`).                             |

| HTTP Code | Error Message           | Description                                                                  |
| --------- | ----------------------- | ---------------------------------------------------------------------------- |
| 401       | `UNAUTHORIZED`          | The request lacks valid authentication credentials. Check your Bearer token. |
| `400`     | `INVALID_REQUEST`       | The request was malformed or contained errors.                               |
| `500`     | `INTERNAL_SERVER_ERROR` | An unexpected error occurred on the server side.                             |

### Example Request

```
curl --location '<your-gateway-url>/devicepark/environment/plan/{planId}' \
--header 'accept: application/json, text/plain, */*' \
--header 'authorization: Bearer <your_access_token>' \
--header 'content-type: application/json' \
--data '[
  {
    "platform": "iOS",
    "manufacturer": "Apple",
    "model": "iPhone13,2",
    "platformVersion": "18.6.2",
    "marketName": "iPhone 12",
    "privateDevice": false
  }
]'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://testinium.gitbook.io/testinium-enterprise/apis/enterprise-2.0/plan/create-plan-environment-appium2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
