> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hookpulse.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Domain

> Add a new domain to your HookPulse account with rate limiting and concurrency control settings

Add a new domain to your HookPulse account with rate limiting and concurrency control settings.

## Example request

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.hookpulse.io/v1/api/add_domain/ \
    -H "x-hookpulse-api-key: {{x-hookpulse-api-key}}" \
    -H "x-brand-uuid: {{x-brand-uuid}}" \
    -H "Content-Type: application/json" \
    -d '{
      "protocol_type": "{{protocol_type}}",
      "domain": "{{domain}}",
      "rate_limit_enabled": {{rate_limit_enabled}},
      "concurrency_control_enabled": {{concurrency_control_enabled}},
      "max_concurrent_jobs": {{max_concurrent_jobs}},
      "max_requests_per_second": {{max_requests_per_second}}
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.hookpulse.io/v1/api/add_domain/', {
    method: 'POST',
    headers: {
      'x-hookpulse-api-key': '{{x-hookpulse-api-key}}',
      'x-brand-uuid': '{{x-brand-uuid}}',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      protocol_type: '{{protocol_type}}',
      domain: '{{domain}}',
      rate_limit_enabled: {{rate_limit_enabled}},
      concurrency_control_enabled: {{concurrency_control_enabled}},
      max_concurrent_jobs: {{max_concurrent_jobs}},
      max_requests_per_second: {{max_requests_per_second}}
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = 'https://api.hookpulse.io/v1/api/add_domain/'
  headers = {
      'x-hookpulse-api-key': '{{x-hookpulse-api-key}}',
      'x-brand-uuid': '{{x-brand-uuid}}',
      'Content-Type': 'application/json'
  }
  payload = {
      'protocol_type': '{{protocol_type}}',
      'domain': '{{domain}}',
      'rate_limit_enabled': {{rate_limit_enabled}},
      'concurrency_control_enabled': {{concurrency_control_enabled}},
      'max_concurrent_jobs': {{max_concurrent_jobs}},
      'max_requests_per_second': {{max_requests_per_second}}
  }

  response = requests.post(url, headers=headers, json=payload)
  print(response.json())
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  uri = URI('https://api.hookpulse.io/v1/api/add_domain/')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri.path)
  request['x-hookpulse-api-key'] = '{{x-hookpulse-api-key}}'
  request['x-brand-uuid'] = '{{x-brand-uuid}}'
  request['Content-Type'] = 'application/json'
  request.body = {
    protocol_type: '{{protocol_type}}',
    domain: '{{domain}}',
    rate_limit_enabled: {{rate_limit_enabled}},
    concurrency_control_enabled: {{concurrency_control_enabled}},
    max_concurrent_jobs: {{max_concurrent_jobs}},
    max_requests_per_second: {{max_requests_per_second}}
  }.to_json

  response = http.request(request)
  puts JSON.parse(response.body)
  ```

  ```php PHP theme={null}
  <?php

  $url = 'https://api.hookpulse.io/v1/api/add_domain/';
  $data = [
      'protocol_type' => '{{protocol_type}}',
      'domain' => '{{domain}}',
      'rate_limit_enabled' => {{rate_limit_enabled}},
      'concurrency_control_enabled' => {{concurrency_control_enabled}},
      'max_concurrent_jobs' => {{max_concurrent_jobs}},
      'max_requests_per_second' => {{max_requests_per_second}}
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'x-hookpulse-api-key: {{x-hookpulse-api-key}}',
      'x-brand-uuid: {{x-brand-uuid}}',
      'Content-Type: application/json'
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ?>
  ```
</RequestExample>

## Request body

| Field                         | Type    | Required | Description                                          |
| ----------------------------- | ------- | -------- | ---------------------------------------------------- |
| `protocol_type`               | string  | Yes      | Protocol type for the domain (e.g., "https", "http") |
| `domain`                      | string  | Yes      | Domain name to add (e.g., "api.hookpulse.io")        |
| `rate_limit_enabled`          | boolean | Yes      | Enable rate limiting for this domain                 |
| `concurrency_control_enabled` | boolean | Yes      | Enable concurrency control for this domain           |
| `max_concurrent_jobs`         | integer | Yes      | Maximum number of concurrent jobs allowed            |
| `max_requests_per_second`     | integer | Yes      | Maximum requests per second allowed                  |

## Example response

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "details": "Domain added successfully"
  }
  ```
</ResponseExample>

## Response fields

| Field     | Type    | Description                             |
| --------- | ------- | --------------------------------------- |
| `success` | boolean | Indicates if the request was successful |
| `details` | string  | Success message or error details        |


## OpenAPI

````yaml POST /v1/api/add_domain/
openapi: 3.0.3
info:
  title: Hookpulse API
  description: >-
    Complete API documentation for Hookpulse. Build powerful integrations with
    our RESTful API.
  version: 1.0.0
  contact:
    name: Hookpulse Support
    email: care@hookpulse.io
    url: https://hookpulse.io
servers:
  - url: https://api.hookpulse.io
    description: Production server
security:
  - apiKeyAuth: []
    brandUuidAuth: []
paths:
  /v1/api/add_domain/:
    post:
      description: >-
        Add a new domain to your HookPulse account with rate limiting and
        concurrency control settings
      requestBody:
        description: Domain configuration
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddDomainRequest'
      responses:
        '200':
          description: Domain added successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddDomainResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AddDomainRequest:
      required:
        - protocol_type
        - domain
        - rate_limit_enabled
        - concurrency_control_enabled
        - max_concurrent_jobs
        - max_requests_per_second
      type: object
      properties:
        protocol_type:
          type: string
          description: Protocol type for the domain (e.g., 'https', 'http')
        domain:
          type: string
          description: Domain name to add
        rate_limit_enabled:
          type: boolean
          description: Enable rate limiting for this domain
        concurrency_control_enabled:
          type: boolean
          description: Enable concurrency control for this domain
        max_concurrent_jobs:
          type: integer
          description: Maximum number of concurrent jobs allowed
        max_requests_per_second:
          type: integer
          description: Maximum requests per second allowed
    AddDomainResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful
        details:
          type: string
          description: Success message or error details
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-hookpulse-api-key
      description: >-
        API key for authentication. Get this from your dashboard by selecting a
        brand and going to API Keys section.
    brandUuidAuth:
      type: apiKey
      in: header
      name: x-brand-uuid
      description: >-
        Brand UUID for authentication. Get this from your dashboard after adding
        a brand - it will be displayed in the UI.

````