---
title: createTemporary
slug: campaign-dev-docs/createtemporary
createdAt: 2026-07-02T19:01:45.941Z
---

The target group becomes invalid after the end of the session.

:::hint{type="info"}
**Note**
Temporary target groups cannot be used for mailings. Use them to filter the results of a query.
:::

**Type**: long

**Parameters**

| Name                | Type       | Value                                                                                                            |
| ------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------- |
| sessionId           | String     | ID of the session                                                                                                |
| negateCondition     | boolean    | See [Type conversion and formatting rules](https://docs.optimizely.com/campaign-dev-docs/soap-1-1-compatibility) |
| attributeName       | String     | See [Type conversion and formatting rules](https://docs.optimizely.com/campaign-dev-docs/soap-1-1-compatibility) |
| operation           | String     | See [Available operators](https://docs.optimizely.com/campaign-dev-docs/soap-1-1-compatibility)                  |
| operationParameters | String\[ ] | See [Attribute values](https://docs.optimizely.com/campaign-dev-docs/soap-1-1-compatibility)                     |

**Return values**

ID of the target group

**Code structure**

```javascript
long createTemporary(String sessionId, boolean negateCondition, String attributeName, String operation, String[] operationParameters)
```
