---
title: Update Ingestion Source
description: Update Ingestion Source
product: general
token_estimate: 1535
---
# Update Ingestion Source

> 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 Ingestion Source

**PATCH** `/console/v1/ingestion`

Full URL: `https://statsigapi.net/console/v1/ingestion`

Update Ingestion Source

## Authorizations

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

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| dataset | string | Yes | — | Allowed values: Metrics, Events, Exposures, export_exposures |
| column_mapping | object | No | — | — |
| column_mapping.unit_id | string | Yes | — | The unique user identifier this metric is for. This might not necessarily be a user_id - it could be a custom_id of some kind. Make sure this is in the same format as your logged unit_ids. |
| column_mapping.id_type | string | Yes | — | The id_type the unit_id represents. Must be valid id_type. Default Statsig types are user_id/stable_id, but you may have generated custom id_types. Make sure this matches (case sensitive) a customID in your project, or you won’t get experiment results. |
| column_mapping.dateid | string | Yes | — | Date of the daily metric, ISO formatted (ex. 2021-02-17). We’ll load custom metrics to whatever date you use here. |
| column_mapping.metric_name | string | Yes | — | String format. Not null. Length < 128 characters. |
| column_mapping.metric_value | string | No | null | Numeric value for the metric. This OR both of numerator and denominator need to be provided. |
| column_mapping.numerator | string | No | null | Required for ratio metrics. If present along with a denominator in any record, the metric will be treated as ratio and only calculated for users with non-null denominators |
| column_mapping.denominator | string | No | null | Required for ratio metrics. If present along with a numerator in any record, the metric will be treated as ratio and only calculated for users with non-null numerators. |
| column_mapping.event_name | string | No | — | Name of the event. String under 128 characters, using ‘_’ for spaces. |
| column_mapping.timestamp | string | No | — | Unix timestamp in seconds of the event (ex. 1613584800) |
| column_mapping.ids | object | No | {} | — |
| column_mapping.metadata | object | No | {} | — |
| column_mapping.metadata_object | string | No | null | — |
| column_mapping.event_value | string | No |  | — |
| column_mapping.experiment | string | No | — | Unique identifier for the experiment. |
| column_mapping.group_id | string | No | — | Unique identifier for the experiment groups. |
| type | string | Yes | — | Allowed values: redshift, bigquery-v2, snowflake-v2, databricks, azure-synapse, s3, athena, adls |
| source_name | string | No | — | — |
| query | string | No | — | — |
| share | string | No | — | — |
| schema | string | No | — | — |
| table | string | No | — | — |
| enabled | boolean | No | — | — |

## Response (application/json)

**200** — Update Ingestion Success

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.id | string | Yes | — | — |
| data.type | string | Yes | — | — |
| data.enabled | boolean | Yes | — | — |
| data.data | object | Yes | — | — |

```json
{
  "type": "databricks",
  "dataset": "Metrics",
  "source_name": "ingestion-1",
  "query": "SELECT * FROM TABLE",
  "column_mapping": {
    "unit_id": "string",
    "id_type": "string",
    "dateid": "string",
    "metric_name": "string",
    "metric_value": "string",
    "numerator": "string",
    "denominator": "string"
  },
  "share": "string",
  "schema": "string",
  "table": "string",
  "enabled": false
}
```

## Code samples

### cURL

```bash
curl -X PATCH "https://statsigapi.net/console/v1/ingestion" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.patch(
    "https://statsigapi.net/console/v1/ingestion",
    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/ingestion", {
  method: "PATCH",
  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/ingestion");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
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("PATCH", "https://statsigapi.net/console/v1/ingestion", 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/ingestion"))
      .method("PATCH", 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/ingestion")
request = Net::HTTP::Patch.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
```

