**Source URL:** https://limited.veevavault.dev/sitevault/vault-api/api-reference/26.2/logs/vql-query-profiler/create-new-session.md

# Create New Session

Start a new VQL Query Profiler session. Only a single Profiler session can be active at a time.

<Endpoint path="/api/{version}/logs/query/profiler" method="POST"></Endpoint>

## Headers {#headers}

| Name | Description |
| --- | --- |
| `Accept` | `application/json` (default) |
| `Content-Type` | `application/x-www-form-urlencoded` |

## Body Parameters {#body-parameters}

The following are filters you can use to define a Query Profiler session.

<FieldTable>
| Name | Description |
| --- | --- |
| `label` `required` | Required label for the new session. |
| `user_id` `optional` | Captures queries for a specific initiating user. If omitted, includes all user queries. |
| `query_origin` `optional` | Captures queries coming from Vault API, Vault Java SDK, or both. Allowed values are `api`, `sdk`, `all`. If omitted, defaults to `all`. |
| `query_targets` `optional` | Captures queries for up to 20 query targets provided in a comma-separated list. If omitted, all query targets are included. |
| `result_count_min` `optional` | Captures queries with a minimum number of records returned. The minimum and default values are 0. |
| `result_count_max` `optional` | Captures queries with a maximum number of records returned. The maximum and default values are the configured limit for the Vault. |
| `query_time_min` `optional` | Captures queries with a minimum initial query execution time. If omitted, defaults to 0. |
| `query_time_max` `optional` | Captures queries with a maximum initial query execution time in seconds. If omitted, defaults to 1200. |
| `response_status` `optional` | Captures queries that have returned a specific response status. Allowed values are `all`, `warn`, `error`, `success`. If omitted, defaults to `all`. |
| `description` `optional` | Sets a string description of the session. Maximum 255 characters. |
</FieldTable>

## Request {#request}

<CodeExample title="">
```
curl -X POST -H "Authorization: {AUTH_VALUE}" \
-H "Content-Type: application/json" \
-d '{
  "query_origin": "api",
  "response_status": "error",
  "description": "Troubleshooting session"
}' \
https://{vault_dns}/api/v26.2/logs/query/profiler

```
</CodeExample>

## Response {#response}

<CodeExample title="">
```
{
    "responseStatus": "SUCCESS",
    "data": {
        "id": "0LS000000002003",
        "name": "query_profiler__c"
    }
}

```
</CodeExample>

## Response Details {#response-details}

The response includes the following metadata, including any filters:

<FieldTable>
| Field Name | Description |
| --- | --- |
| `id` | The ID of the new session. |
| `name` | The name of the new session. |
</FieldTable>

---

**Previous:** [List Single Session](/sitevault/vault-api/api-reference/26.2/logs/vql-query-profiler/list-single-session)  
**Next:** [End Active Session](/sitevault/vault-api/api-reference/26.2/logs/vql-query-profiler/end-active-session)