> ## Documentation Index
> Fetch the complete documentation index at: https://velt-mintlify-e6426361.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Allowed Domains

> Add one or more domains to the allowed domains list for a Velt workspace using the v2 REST API to control which origins can use your API keys.

Use this API to add one or more domains to the allowed domains list for a workspace.

<Info>
  This endpoint uses **API-key-level auth**: pass `x-velt-api-key` and `x-velt-auth-token` as headers. You can obtain these from the [Get Auth Tokens](/api-reference/rest-apis/v2/workspace/authtokens-get) endpoint.
</Info>

# Endpoint

`POST https://api.velt.dev/v2/workspace/domains/add`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="domains" type="string[]" required>
      Array of domains to add. Max 100 entries. You can send full URLs (e.g., `"https://www.example.com"`) or bare domains (e.g., `"example.com"`). The API normalizes all entries by stripping the protocol and `www` prefix — the stored and returned value will be the bare domain (e.g., `"example.com"`). Wildcard subdomains are supported (e.g., `"*.firebase.com"`).
    </ParamField>
  </Expandable>
</ParamField>

# Example Request

```JSON theme={null}
{
  "data": {
     "domains" : [
        "https://www.google.com",
        "https://*.firebase.com"
     ]
  }
}
```

# Example Response

#### Success Response

```JSON theme={null}
{
    "result": {
        "status": "success",
        "message": "Domain(s) added successfully to allowed domains.",
        "data": {
            "domainsAdded": [
                "google.com",
                "*.firebase.com"
            ]
        }
    }
}

```

#### Failure Response

##### If some domains are already in the allowed domains

```JSON theme={null}
{
    "error": {
        "details": {
            "domainsAdded": [
                "velt.dev"
            ],
            "skippedDomains": [
                "google.com"
            ]
        },
        "message": "Domain(s) added successfully to allowed domains. Skipped existing domains.",
        "status": "INTERNAL"
    }
}

```

<ResponseExample>
  ```js theme={null}
  {
      "result": {
          "status": "success",
          "message": "Domain(s) added successfully to allowed domains.",
          "data": {
              "domainsAdded": [
                  "google.com",
                  "*.firebase.com"
              ]
          }
      }
  }
  ```
</ResponseExample>
