---
title: Archive Gate
description: "Reference for the PUT /console/v1/gates/{id}/archive API endpoint."
product: general
token_estimate: 2952
---
# Archive Gate

> 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`.

## Archive Gate

**PUT** `/console/v1/gates/{id}/archive`

Full URL: `https://statsigapi.net/console/v1/gates/{id}/archive`

Archive Gate

## Authorizations

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

## Path parameters

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

## Query parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| includeArchiveMetadata (query) | string | No | — | When "true", populate archivedAt / archivedBy* / archiveReason on the gate when it is currently archived. When omitted or "false", those fields are absent from the response. Allowed values: true, false |

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| forceArchive | boolean | No | — | — |
| archiveReason | string | No | The gate is no longer needed | The reason for archiving the gate |

## Response (application/json)

**200** — Archive gate response

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.id | string | Yes | — | ID |
| data.name | string | No | — | The gate display name Constraints: min length: 3, max length: 100, pattern: ^[a-zA-Z0-9_\-. ]*$ |
| data.idType | string | No | — | — |
| data.description | string | Yes | — | Constraints: max length: 1000 |
| data.lastModifierID | string | Yes | — | ID of the last modifier. Constraints: nullable |
| data.lastModifiedTime | number | Yes | — | Time of the last modification. Constraints: format: double, nullable |
| data.lastModifierEmail | string | Yes | — | Email of the last modifier. Constraints: nullable |
| data.lastModifierName | string | Yes | — | Name of the last modifier. Constraints: nullable |
| data.creatorID | string | No | — | Constraints: nullable |
| data.createdTime | number | Yes | — | Timestamp when the entity was created. Constraints: format: double |
| data.creatorName | string | Yes | — | Name of the creator. Constraints: nullable |
| data.creatorEmail | string | No | — | Constraints: nullable |
| data.tags | string[] | No | — | — |
| data.targetApps | oneOf | No | — | Constraints: string, string[] |
| data.holdoutIDs | string[] | No | — | Holdouts applied to this configuration. |
| data.team | string | No | — | Constraints: nullable |
| data.teamID | string | No | — | Constraints: nullable |
| data.version | number | No | — | Version number Constraints: format: double |
| data.checksPerHour | number | Yes | — | Constraints: format: double, nullable |
| data.status | string | Yes | — | Allowed values: In Progress, Launched, Disabled, Archived |
| data.type | string | Yes | — | Allowed values: TEMPORARY, PERMANENT, STALE, TEMPLATE |
| data.typeReason | string | Yes | — | Allowed values: NONE, STALE_PROBABLY_LAUNCHED, STALE_PROBABLY_UNLAUNCHED, STALE_PROBABLY_FORGOTTEN, STALE_NO_RULES, STALE_PROBABLY_DEAD_CHECK, STALE_EMPTY_CHECKS, STALE_ALL_TRUE, STALE_ALL_FALSE |
| 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.isTemplate | boolean | No | — | — |
| data.store0100Exposures | boolean | No | — | Whether this gate stores 0/100 exposures for monitoring/analysis. |
| data.permalink | string | Yes | — | A permalink to this gate in the Statsig Console. Constraints: format: uri |
| data.archivedAt | number | No | — | Timestamp (ms) of the most recent archive event when the gate is currently archived; null otherwise. May be null for gates archived before audit logging existed. Constraints: format: double, nullable |
| data.archivedByID | string | No | — | ID of the user who archived this gate, when known and the gate is currently archived; null otherwise (e.g. automated archives have no user). Constraints: nullable |
| data.archivedByName | string | No | — | Name of the user who archived this gate, when known and the gate is currently archived; null otherwise. Constraints: nullable |
| data.archivedByEmail | string | No | — | Email of the user who archived this gate, when known and the gate is currently archived; null otherwise. Constraints: nullable |
| data.archiveReason | string | No | — | Free-text reason supplied when the gate was most recently archived; null when the gate is not currently archived or no reason was given. Constraints: nullable |
| data.isEnabled | boolean | Yes | — | — |
| data.rules | object[] | Yes | — | — |
| data.rules.name | string | Yes | — | The name of this rule. |
| data.rules.passPercentage | number | Yes | — | Of the users that meet the conditions of this rule, what percent should return true. Constraints: min: 0, max: 100 |
| data.rules.conditions | object[] | Yes | — | An array of Condition objects. |
| data.rules.conditions.targetValue | oneOf | No | — | Constraints: nullable, string[], number[], string, number |
| data.rules.conditions.operator | string | No | — | Allowed values: any, none, any_case_sensitive, none_case_sensitive, str_contains_any, str_contains_none, gt, lt, lte, gte, version_gt, version_lt, version_gte, version_lte, version_eq, after, before, on, is_null, is_not_null, str_matches, encoded_any, array_contains_any, array_contains_none, array_contains_all, not_array_contains_all |
| data.rules.conditions.field | string | No | — | Constraints: nullable |
| data.rules.conditions.customID | string | No | — | Constraints: nullable |
| data.rules.conditions.type | string | Yes | — | Allowed values: app_version, browser_name, browser_version, country, custom_field, email, environment_tier, fails_gate, fails_segment, ip_address, locale, os_name, os_version, passes_gate, passes_segment, public, time, unit_id, user_id, user_agent, url, javascript, device_model, target_app, experiment_group |
| data.rules.environments | string[] | No | — | The environments this rule is enabled for. Constraints: nullable |
| data.rules.id | string | No | — | The Statsig ID of this rule. |
| data.rules.baseID | string | No | — | The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout |
| data.rules.returnValue | object | No | — | The return value of the rule. |
| data.rules.completedAutomatedRollouts | object[] | No | — | Read-only: Automated rollout phases that have already completed. |
| data.rules.completedAutomatedRollouts.time | number | No | — | — |
| data.rules.completedAutomatedRollouts.passPercent | number | Yes | — | — |
| data.rules.pendingAutomatedRollouts | object[] | No | — | Read-only: Automated rollout phases that are scheduled but not yet complete. |
| data.rules.pendingAutomatedRollouts.time | number | No | — | — |
| data.rules.pendingAutomatedRollouts.passPercent | number | Yes | — | — |
| data.measureMetricLifts | boolean | No | — | — |
| data.monitoringMetrics | object[] | No | — | — |
| data.monitoringMetrics.name | string | Yes | — | — |
| data.monitoringMetrics.type | string | Yes | — | — |
| data.reviewSettings | object | No | — | — |
| data.reviewSettings.requiredReview | boolean | Yes | — | — |
| data.reviewSettings.allowedReviewers | object[] | No | — | Constraints: nullable |
| data.reviewSettings.allowedReviewers.id | string | Yes | — | — |
| data.reviewSettings.allowedReviewers.name | string | Yes | — | — |
| data.reviewSettings.allowedReviewers.email | string | Yes | — | — |
| data.releasePipelineID | string | No | — | Constraints: nullable |
| data.activeReview | object | No | — | — |
| data.activeReview.reviewID | string | Yes | — | — |
| data.activeReview.reviewStatus | string | Yes | — | — |
| data.activeReview.description | string | Yes | — | — |

```json
{
  "message": "Gate updated successfully.",
  "data": {
    "id": "a_gate",
    "name": "A Gate",
    "description": "description",
    "idType": "userID",
    "lastModifierID": "1vaQaBoLlkauH9iiuOSBP2",
    "lastModifiedTime": 1705691355849,
    "lastModifierName": "CONSOLE API",
    "lastModifierEmail": null,
    "creatorID": "1vaQaBoLlkauH9iiuOSBP2",
    "createdTime": 1705691325569,
    "creatorName": "CONSOLE API",
    "creatorEmail": null,
    "targetApps": [],
    "holdoutIDs": [],
    "tags": [],
    "isEnabled": true,
    "status": "Archived",
    "rules": [],
    "checksPerHour": 0,
    "type": "PERMANENT",
    "typeReason": "NONE",
    "team": null,
    "reviewSettings": {
      "requiredReview": false,
      "allowedReviewers": []
    },
    "measureMetricLifts": true,
    "store0100Exposures": false,
    "owner": {
      "ownerID": "user123",
      "ownerName": "CONSOLE API",
      "ownerType": "SDK_KEY",
      "ownerEmail": ""
    },
    "monitoringMetrics": [],
    "version": 2,
    "permalink": "https://console.statsig.com/company_id/gates/a_gate"
  }
}
```

## Code samples

### cURL

```bash
curl -X PUT "https://statsigapi.net/console/v1/gates/{id}/archive" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.put(
    "https://statsigapi.net/console/v1/gates/{id}/archive",
    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/gates/{id}/archive", {
  method: "PUT",
  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/gates/{id}/archive");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
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("PUT", "https://statsigapi.net/console/v1/gates/{id}/archive", 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/gates/{id}/archive"))
      .method("PUT", 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/gates/{id}/archive")
request = Net::HTTP::Put.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
```

