> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Get Organization Settings

GET https://api-gateway.merge.dev/v1/organization

Return the organization's settings: its name, request tags, payload
logging, zero data retention, web search mode, model deprecation handling,
and vendor and region restrictions. There's one per organization.

Reference: https://docs.merge.dev/merge-gateway/management-api/organization/get-organization-settings

## Authentication

- `Authorization` header (bearer token, required) — A management key (`mgmt_...`), sent as `Authorization: Bearer <key>`. Reading /v1/routing-policies also accepts the organization's gateway API keys; writing there needs a management key.

## Response

### 200

The organization's settings

- `auto_handle_model_deprecations` (boolean, required) — Move routing policies off deprecated models automatically.
- `created_at` (datetime, required) — When the organization was created.
- `id` (string, required) — The organization's id.
- `log_payloads` (boolean, required) — Store request and response bodies.
- `name` (string, required) — The organization's name.
- `slug` (string, required) — Set when the organization is created. It doesn't change.
- `tag_definitions` (list of TagDefinitionV1, required) — The request tag keys the organization uses, and the values each allows.
- `vendor_restrictions` (VendorRestrictionsV1, required) — Which vendors and regions requests may use, and whose credentials.
- `web_search_mode` (enum, required) — How requests that use a vendor's built-in web search run: `auto` uses the vendor's search where the route can, else Merge's; `merge` always uses Merge's; `native` only the vendor's, failing with 400 where the route can't.
  - Allowed values: `auto`, `native`, `merge`
- `zero_data_retention` (boolean, required) — Route only to vendors that retain no data.

## Errors

### 401 Unauthorized Error

The key is missing or invalid.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

### 403 Forbidden Error

The key lacks the scope this route needs, or the change is not allowed.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

## Types

### TagDefinitionV1

A request tag key and the values it allows.

- `key` (string, required) — The tag's key.
- `values` (list of string, required) — The values requests may send for the key.

### VendorRestrictionsV1

Which vendors and regions the organization's traffic may use, and whose provider credentials it uses.

- `allowed_regions` (list of string, optional, default: []) — When non-empty, the only regions the organization may route to. Each token is a vendor's `country_code` or `geo_region`, as listed by `GET /v1/organization/vendors`, like `US`, `CA` or `NA`. Case-sensitive; an unknown token is a 422.
- `allowed_vendors` (list of string, optional, default: []) — When non-empty, the only vendors the organization may route to.
- `byok_only` (boolean, optional, default: false) — For requests not linked to a customer, use only the organization's own provider credentials. Also turns off managed fallback on every credential.
- `customer_key_usage_default` (enum, optional, nullable) — Whose credentials requests linked to a customer use, for customers without their own setting: `use_any` (no preference), `prefer_byok` (the customer's, then the organization's, then Merge's), `byok_only` (the customer's or the organization's) or `customer_only` (the customer's only). null means customers follow `prefer_byok` and `byok_only` above.
  - Allowed values: `use_any`, `prefer_byok`, `byok_only`, `customer_only`
- `ignored_regions` (list of string, optional, default: []) — Regions the organization may never route to. Each token is a vendor's `country_code` or `geo_region`, as listed by `GET /v1/organization/vendors`, like `US`, `CA` or `NA`. Case-sensitive; an unknown token is a 422.
- `ignored_vendors` (list of string, optional, default: []) — Vendors the organization may never route to.
- `prefer_byok` (boolean, optional, default: false) — For requests not linked to a customer, use the organization's own provider credentials first, then Merge-managed ones.
- `vendor_routing_preference` (list of string, optional, default: []) — Vendors to try first among those that remain. Never excludes a vendor.

### ErrorResponseDetail

A message, or an object with a `code` to branch on and a `message`.

### ErrorDetail

A structured error. Some carry extra fields, like `count`.

- `code` (string, required) — A stable code to branch on, like `payment_method_required`.
- `message` (string, required) — A human-readable explanation.

## Examples

**Response**

```json
{
  "auto_handle_model_deprecations": true,
  "created_at": "2026-03-11T15:20:00Z",
  "id": "3f2b8c1e-6a4d-4e7f-9b21-5c8d0e7a4f13",
  "log_payloads": false,
  "name": "Acme",
  "slug": "acme",
  "tag_definitions": [
    {
      "key": "team",
      "values": [
        "support",
        "search",
        "billing"
      ]
    }
  ],
  "vendor_restrictions": {
    "allowed_regions": [],
    "allowed_vendors": [],
    "byok_only": false,
    "customer_key_usage_default": null,
    "ignored_regions": [
      "CN"
    ],
    "ignored_vendors": [],
    "prefer_byok": true,
    "vendor_routing_preference": [
      "bedrock"
    ]
  },
  "web_search_mode": "native",
  "zero_data_retention": true
}
```

**SDK Code**

```python
import requests

url = "https://api-gateway.merge.dev/v1/organization"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-gateway.merge.dev/v1/organization';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-gateway.merge.dev/v1/organization"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-gateway.merge.dev/v1/organization")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-gateway.merge.dev/v1/organization")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-gateway.merge.dev/v1/organization', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-gateway.merge.dev/v1/organization");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway.merge.dev/v1/organization")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```