---
updatedAt: 2026-04-21T09:18:29.000Z
agentTools:
  projectIndex: https://docs.esputnik.com/llms.txt
---

# Add one web push domain

The method is used for adding one domain for web push notifications.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "esputnik.com",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://esputnik.com"
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "tags": [
    {
      "name": "Site"
    }
  ],
  "paths": {
    "/api/v1/site/webpush/domain": {
      "post": {
        "tags": [
          "Site"
        ],
        "summary": "Add one web push domain",
        "description": "The method is used for adding one domain for web push notifications.",
        "operationId": "addWebPushDomain",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebPushDomain"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain is created/already registered in this organization",
            "content": {
              "application/json; charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/WebPushDomainsResults"
                }
              }
            }
          },
          "400": {
            "description": "The domain is registered in another organization"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "WebPushDomainResult": {
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "Domain name"
          },
          "message": {
            "type": "string",
            "description": "Response message"
          },
          "status": {
            "type": "string",
            "description": "Response status"
          }
        },
        "description": "Web Push Domain Result"
      },
      "WebPushDomainsResults": {
        "type": "object",
        "properties": {
          "success": {
            "type": "array",
            "description": "List of successfully added domains",
            "items": {
              "$ref": "#/components/schemas/WebPushDomainResult"
            }
          },
          "errors": {
            "type": "array",
            "description": "List of domains that could not be added",
            "items": {
              "$ref": "#/components/schemas/WebPushDomainResult"
            }
          }
        },
        "description": "Web Push Domains Results"
      },
      "WebPushDomain": {
        "required": [
          "domain",
          "serviceWorkerName",
          "serviceWorkerPath",
          "serviceWorkerScope"
        ],
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "Site for web push integration (HTTPS only)."
          },
          "serviceWorkerName": {
            "type": "string",
            "description": "Web push service worker file name, in *.js format"
          },
          "serviceWorkerPath": {
            "type": "string",
            "description": "Relative path on site, where service worker will be stored. Must start and end with slash"
          },
          "serviceWorkerScope": {
            "type": "string",
            "description": "Relative path on site, where service worker will work. Usually is the same as serviceWorkerPath"
          }
        },
        "description": "Web Push Domain"
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  }
}
```