---
title: Create Plan Java Parameter
slug: suite-documentation/TtyB-create-plan-java-parameter
docTags: 
createdAt: 2026-08-26T09:32:57.118Z
---

## Endpoint Information

- **URL**: `{gateway-url}/plan-java-parameters/plan/{planId}`
- **Method**: `POST`
- **Authentication**: Required (`Bearer Token`)
- **Company Header**: Required (`X-Company-Id`)

## Headers

| Header          | Type   | Required | Description                                                                  |
| --------------- | ------ | -------- | ---------------------------------------------------------------------------- |
| `Authorization` | String | Yes      | Bearer token used for authentication. Example: `Bearer <your_access_token>`. |
| `X-Company-Id`  | Long   | Yes      | The company ID used to scope the request.                                    |
| `Content-Type`  | String | Yes      | Must be `application/json`.                                                  |
| `Accept`        | String | No       | Recommended value: `application/json`.                                       |

## Path Parameters

| Parameter | Type | Required | Description                                                |
| --------- | ---- | -------- | ---------------------------------------------------------- |
| `planId`  | Long | Yes      | The unique ID of the test plan. Must be a positive number. |

## Request Body

```json
[
  {
    "name": "env",
    "value": "prod",
    "description": "Environment selection parameter",
    "type": "ENVIRONMENT_PARAMETER"
  }
]
```

## Request Body Parameters

| Parameter     | Type   | Required | Description                                                                            |
| ------------- | ------ | -------- | -------------------------------------------------------------------------------------- |
| `name`        | String | Yes      | Name of the Java parameter.                                                            |
| `value`       | String | Yes      | Value of the Java parameter.                                                           |
| `description` | String | No       | Description of the Java parameter.                                                     |
| `type`        | String | Yes      | Type of Java parameter. Possible values: `ENVIRONMENT_PARAMETER`, `COMMAND_PARAMETER`. |

## Response Body

```json
{
  "data": [
    {
      "name": "env",
      "value": "prod",
      "description": "Environment selection parameter",
      "type": "ENVIRONMENT_PARAMETER"
    }
  ]
}
```

## Response Fields

| Parameter            | Type             | Description                                                                            |
| -------------------- | ---------------- | -------------------------------------------------------------------------------------- |
| `data`               | Array of objects | List of Java parameters created for the test plan.                                     |
| `data[].name`        | String           | Name of the Java parameter.                                                            |
| `data[].value`       | String           | Value of the Java parameter.                                                           |
| `data[].description` | String           | Description of the Java parameter.                                                     |
| `data[].type`        | String           | Type of Java parameter. Possible values: `ENVIRONMENT_PARAMETER`, `COMMAND_PARAMETER`. |

## Behavior Notes

- This endpoint replaces the Java parameters of the given test plan.
- Existing Java parameters for the plan are deleted first.
- Then the parameters sent in the request body are created again.
- If an empty array is sent, all existing Java parameters for the plan are deleted and the response returns an empty list.
- The test plan lookup is scoped by `X-Company-Id`.
- The response does not include `result.code` or `result.message`.

## Error Response Format

Error responses use the common problem detail format.

```json
{
  "instance": "/plan-java-parameters/plan/999999",
  "status": 404,
  "title": "Not Found",
  "type": "https://errors.testinium.com/exception",
  "timestamp": "2026-08-18T12:08:41.165927056Z",
  "errorType": "EXCEPTION",
  "errors": {
    "code": 10003,
    "message": "Plan with id 999999 not found!"
  }
}
```

## Validation Error Response Example

```json
{
  "instance": "/plan-java-parameters/plan/704",
  "status": 400,
  "title": "Bad Request",
  "type": "https://errors.testinium.com/validation",
  "timestamp": "2026-08-18T12:08:41.165927056Z",
  "errorType": "VALIDATION",
  "errors": [
    {
      "code": 20005,
      "message": "must not be null",
      "field": "name"
    }
  ]
}
```

## Error Codes

| HTTP Code | Error Message           | Description                                                                                                           |
| --------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------- |
| 400       | `BAD_REQUEST`           | The request is malformed, contains invalid path parameters, has invalid body fields, or a required header is missing. |
| 401       | `UNAUTHORIZED`          | Authentication failed, authentication is required, or the token is invalid.                                           |
| 403       | `FORBIDDEN`             | The user does not have permission to access the requested company or resource.                                        |
| 404       | `NOT_FOUND`             | The requested test plan could not be found.                                                                           |
| 405       | `METHOD_NOT_ALLOWED`    | The HTTP method is not supported. This endpoint only supports `POST`.                                                 |
| 503       | `SERVICE_UNAVAILABLE`   | The routed project service is unavailable.                                                                            |
| 500       | `INTERNAL_SERVER_ERROR` | An unexpected error occurred on the server side.                                                                      |

## Application Error Codes

| Code    | Error Type   | HTTP Code | Description                                                                                             |
| ------- | ------------ | --------- | ------------------------------------------------------------------------------------------------------- |
| `10000` | `EXCEPTION`  | 401       | Authentication failed.                                                                                  |
| `10001` | `EXCEPTION`  | 401       | Authentication is required to access this resource.                                                     |
| `10002` | `EXCEPTION`  | 401       | The provided token is invalid.                                                                          |
| `10003` | `EXCEPTION`  | 403 / 404 | The user is not authorized for the requested resource, or the requested test plan could not be found.   |
| `10004` | `EXCEPTION`  | 400       | A required header is missing. For example, `X-Company-Id` is not provided.                              |
| `10005` | `EXCEPTION`  | 401       | A required token claim is missing.                                                                      |
| `10007` | `EXCEPTION`  | 403       | The user does not have access to the requested resource.                                                |
| `10008` | `EXCEPTION`  | 503       | The routed project service is unavailable.                                                              |
| `20005` | `VALIDATION` | 400       | A required request field is missing, the request body is invalid, or `planId` is not a positive number. |
| `20008` | `EXCEPTION`  | 400       | The `planId` path parameter has an invalid type.                                                        |
| `20009` | `EXCEPTION`  | 405       | The HTTP method is not supported.                                                                       |

## Example Request

```bash
curl --location '{gateway-url}/plan-java-parameters/plan/{planId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--header 'X-Company-Id: <company_id>' \
--data '[
  {
    "name": "env",
    "value": "prod",
    "description": "Environment selection parameter",
    "type": "ENVIRONMENT_PARAMETER"
  }
]'
```

## Example Request With Multiple Parameters

```bash
curl --location '{gateway-url}/plan-java-parameters/plan/{planId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_access_token>' \
--header 'X-Company-Id: <company_id>' \
--data '[
  {
    "name": "env",
    "value": "prod",
    "description": "Environment selection parameter",
    "type": "ENVIRONMENT_PARAMETER"
  },
  {
    "name": "browser",
    "value": "chrome",
    "description": "Browser command parameter",
    "type": "COMMAND_PARAMETER"
  }
]'
```

