---
title: Update Qualifying Event
description: Update Qualifying Event
product: general
token_estimate: 2810
---
# Update Qualifying Event

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Update Qualifying Event

**POST** `/console/v1/experiments/qualifying_events/{name}`

Full URL: `https://statsigapi.net/console/v1/experiments/qualifying_events/{name}`

Update Qualifying Event

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| name (path) | string | Yes | — | name |

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| name | string | No | — | The name of the source cannot be changed in this update, ensuring the identity remains consistent. |
| description | string | No | — | An optional updated description for the source, providing additional context or changes. |
| tags | string[] | No | — | Optional array of tags for categorizing the source, allowing for updates to its categorization. |
| sql | string | Yes | — | The SQL query or statement used to extract data from the source. |
| timestampColumn | string | Yes | — | The name of the column containing timestamp data for the source. |
| timestampAsDay | boolean | No | — | Indicates whether the timestamp should be treated as a day-level granularity. |
| idTypeMapping | object[] | Yes | — | Array defining the mapping between Statsig unit IDs and their respective source columns. |
| idTypeMapping.statsigUnitID | string | Yes | — | The identifier mapping for Statsig units. |
| idTypeMapping.column | string | Yes | — | The corresponding column name in the source that relates to the Statsig unit ID. |
| sourceType | string | No | — | The type of source, indicating whether it is a database table or a custom query. Allowed values: table, query |
| tableName | string | No | — | The name of the database table if the source type is "table". |
| datePartitionColumn | string | No | — | The name of the date partition column if the source type is "table". Can be undefined. |
| customFieldMapping | object[] | No | — | Optional array defining mappings for custom fields using specific formulas. |
| customFieldMapping.key | string | Yes | — | The identifier for the custom field mapping. |
| customFieldMapping.formula | string | Yes | — | The formula or expression used to compute the custom field value. |
| isReadOnly | boolean | No | — | Specifies if the source can only be edited via the Console API. |
| isVerified | boolean | No | false | Marks the metric source as verified, indicating trustworthiness within the organization. |
| disableCURE | boolean | No | — | Disable CURE for all metrics built from this metric source |
| owner | object | No | {"ownerID":"user123","ownerType":"USER","ownerName":"John Doe","ownerEmail":"owner123@test.com"} | Schema for owner data including ID, type, name. Constraints: nullable |
| owner.ownerID | string | No | abc123 | ID of the owner |
| owner.ownerType | string | No | USER | Type of the owner (e.g., SDK_KEY or USER) |
| owner.ownerName | string | No | John Doe | The name of the owner. This field is optional. |
| owner.ownerEmail | string | No | — | The email of the owner. This field is optional. |
| team | string | No | — | Optional field indicating the team name responsible for the metric source, aiding in accountability and management. Constraints: nullable |
| teamID | string | No | — | Optional field indicating the team ID responsible for the metric source, aiding in accountability and management. Constraints: nullable |
| dryRun | boolean | No | — | Skips persisting updates to the source (used to validate that inputs are correct) |
| skip_validation | boolean | No | — | Skips running SQL validation for the source. Requires all_columns and column_types when true. Availability is gated. |
| all_columns | string[] | No | — | Column names to persist when skip_validation is true. Optional otherwise. |
| column_types | string[] | No | — | Column types aligned with all_columns when skip_validation is true. Optional otherwise. |

## Response (application/json)

**200** — Update Qualifying Event response

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.name | string | Yes | — | The name of the source, serving as its primary identifier. |
| data.description | string | Yes | — | A detailed description of the source, providing context and usage information. |
| data.tags | string[] | No | — | Optional tags for categorizing the source and improving searchability. |
| data.sql | string | Yes | — | The SQL query or statement used to extract data from the source. |
| data.timestampColumn | string | Yes | — | The name of the column containing timestamp data for the source. |
| data.timestampAsDay | boolean | No | — | Indicates whether the timestamp should be treated as a day-level granularity. |
| data.idTypeMapping | object[] | Yes | — | Array defining the mapping between Statsig unit IDs and their respective source columns. |
| data.idTypeMapping.statsigUnitID | string | Yes | — | The identifier mapping for Statsig units. |
| data.idTypeMapping.column | string | Yes | — | The corresponding column name in the source that relates to the Statsig unit ID. |
| data.sourceType | string | No | — | The type of source, indicating whether it is a database table or a custom query. Allowed values: table, query |
| data.tableName | string | No | — | The name of the database table if the source type is "table". |
| data.datePartitionColumn | string | No | — | The name of the date partition column if the source type is "table". Can be undefined. |
| data.customFieldMapping | object[] | No | — | Optional array defining mappings for custom fields using specific formulas. |
| data.customFieldMapping.key | string | Yes | — | The identifier for the custom field mapping. |
| data.customFieldMapping.formula | string | Yes | — | The formula or expression used to compute the custom field value. |
| data.isReadOnly | boolean | No | — | Specifies if the source can only be edited via the Console API. |
| data.isVerified | boolean | No | false | Marks the metric source as verified, indicating trustworthiness within the organization. |
| data.disableCURE | boolean | No | — | Disable CURE for all metrics built from this metric source |
| data.owner | object | No | {"ownerID":"user123","ownerType":"USER","ownerName":"John Doe","ownerEmail":"owner123@test.com"} | Schema for owner data including ID, type, name. Constraints: nullable |
| data.owner.ownerID | string | No | abc123 | ID of the owner |
| data.owner.ownerType | string | No | USER | Type of the owner (e.g., SDK_KEY or USER) |
| data.owner.ownerName | string | No | John Doe | The name of the owner. This field is optional. |
| data.owner.ownerEmail | string | No | — | The email of the owner. This field is optional. |
| data.team | string | No | — | Optional field indicating the team name responsible for the metric source, aiding in accountability and management. Constraints: nullable |
| data.teamID | string | No | — | Optional field indicating the team ID responsible for the metric source, aiding in accountability and management. Constraints: nullable |

```json
{
  "message": "Qualifying event updated successfully.",
  "data": {
    "name": "test_qualifying_event",
    "description": "Test description for qualifying event",
    "tags": [
      "non_production"
    ],
    "sql": "SELECT * FROM `shoppy-sales.logging.events`",
    "timestampColumn": "ts",
    "timestampAsDay": true,
    "idTypeMapping": [
      {
        "statsigUnitID": "userID",
        "column": "user_id"
      }
    ],
    "sourceType": "table",
    "tableName": "shoppy-sales.logging.events"
  }
}
```

**400** — Invalid request. Please check the request input and try again.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 400 |
| message | string | Yes | — | — |

```json
{
  "status": 400,
  "message": "Invalid request. Please check the request input and try again."
}
```

**401** — This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 401 |
| message | string | Yes | — | — |

```json
{
  "status": 401,
  "message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}
```

## Code samples

### cURL

```bash
curl -X POST "https://statsigapi.net/console/v1/experiments/qualifying_events/{name}" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.post(
    "https://statsigapi.net/console/v1/experiments/qualifying_events/{name}",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/experiments/qualifying_events/{name}", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/experiments/qualifying_events/{name}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("POST", "https://statsigapi.net/console/v1/experiments/qualifying_events/{name}", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/experiments/qualifying_events/{name}"))
      .method("POST", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/experiments/qualifying_events/{name}")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

