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

# create

POST {base_url}/api/v1/{account_id}/projects/{project_id}/rate_limiters
Content-Type: application/json

### POST /api/v1/{account_id}/projects/{project_id}/rate_limiters

This endpoint is used to create a rate limiter for a specific project within an account.

#### Request

The request body should be in JSON format and include the following parameters:

- `name` (string): The name of the rate limiter.
    
- `action` (string): The action to be taken when the rate limit is reached.
    
- `isActive` (boolean): Indicates whether the rate limiter is active.
    
- `condition` (object): An object containing the condition for the rate limiter, including fieldName, predicate, value, and type.
    
- `periodInSec` (integer): The time period in seconds for the rate limiter.
    
- `limit` (integer): The limit for the rate limiter.
    

#### Response

The response for this request is a JSON object with the following schema:

``` json
{
  "id": "",
  "customerId": "",
  "name": "",
  "url": "",
  "siteKey": "",
  "serverKey": "",
  "isProtected": true,
  "rules": {
    "order": [],
    "rules": []
  },
  "rateLimits": {
    "order": [],
    "rateLimits": []
  },
  "phishingInfo": {
    "originalUrl": "",
    "action": "",
    "allowedUrls": []
  },
  "responseExtraFields": [],
  "updatedAt": "",
  "createdAt": ""
}

 ```

- `id` (string): The unique identifier of the project.
    
- `customerId` (string): The unique identifier of the customer associated with the project.
    
- `name` (string): The name of the project.
    
- `url` (string): The URL of the project.
    
- `siteKey` (string): The site key of the project.
    
- `serverKey` (string): The server key of the project.
    
- `isProtected` (boolean): Indicates whether the project is protected.
    
- `rules` (object): An object containing order and rules arrays.
    
- `rateLimits` (object): An object containing order and rateLimits arrays.
    
- `phishingInfo` (object): An object containing originalUrl, action, and allowedUrls arrays.
    
- `responseExtraFields` (array): An array of extra fields in the response.
    
- `updatedAt` (string): The timestamp when the project was last updated.
    
- `createdAt` (string): The timestamp when the project was created.

Reference: https://api-docs.botbye.com/bot-bye-api/protection/rate-limiters/create

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/{account_id}/projects/{project_id}/rate_limiters:
    post:
      operationId: create
      summary: create
      description: >-
        ### POST /api/v1/{account_id}/projects/{project_id}/rate_limiters


        This endpoint is used to create a rate limiter for a specific project
        within an account.


        #### Request


        The request body should be in JSON format and include the following
        parameters:


        - `name` (string): The name of the rate limiter.
            
        - `action` (string): The action to be taken when the rate limit is
        reached.
            
        - `isActive` (boolean): Indicates whether the rate limiter is active.
            
        - `condition` (object): An object containing the condition for the rate
        limiter, including fieldName, predicate, value, and type.
            
        - `periodInSec` (integer): The time period in seconds for the rate
        limiter.
            
        - `limit` (integer): The limit for the rate limiter.
            

        #### Response


        The response for this request is a JSON object with the following
        schema:


        ``` json

        {
          "id": "",
          "customerId": "",
          "name": "",
          "url": "",
          "siteKey": "",
          "serverKey": "",
          "isProtected": true,
          "rules": {
            "order": [],
            "rules": []
          },
          "rateLimits": {
            "order": [],
            "rateLimits": []
          },
          "phishingInfo": {
            "originalUrl": "",
            "action": "",
            "allowedUrls": []
          },
          "responseExtraFields": [],
          "updatedAt": "",
          "createdAt": ""
        }

         ```

        - `id` (string): The unique identifier of the project.
            
        - `customerId` (string): The unique identifier of the customer
        associated with the project.
            
        - `name` (string): The name of the project.
            
        - `url` (string): The URL of the project.
            
        - `siteKey` (string): The site key of the project.
            
        - `serverKey` (string): The server key of the project.
            
        - `isProtected` (boolean): Indicates whether the project is protected.
            
        - `rules` (object): An object containing order and rules arrays.
            
        - `rateLimits` (object): An object containing order and rateLimits
        arrays.
            
        - `phishingInfo` (object): An object containing originalUrl, action, and
        allowedUrls arrays.
            
        - `responseExtraFields` (array): An array of extra fields in the
        response.
            
        - `updatedAt` (string): The timestamp when the project was last updated.
            
        - `createdAt` (string): The timestamp when the project was created.
      tags:
        - subpackage_rateLimiters
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: string
                format: uuid
        '400':
          description: fail
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/ApiV1AccountIdProjectsProjectIdRateLimitersPostResponsesContentApplicationJsonSchemaItems
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties: {}
servers:
  - url: '{base_url}'
    description: '{base_url}'
components:
  schemas:
    ApiV1AccountIdProjectsProjectIdRateLimitersPostResponsesContentApplicationJsonSchemaItemsContext:
      type: object
      properties:
        maxRateLimitTtiSec:
          type: integer
        period:
          type: integer
      title: >-
        ApiV1AccountIdProjectsProjectIdRateLimitersPostResponsesContentApplicationJsonSchemaItemsContext
    ApiV1AccountIdProjectsProjectIdRateLimitersPostResponsesContentApplicationJsonSchemaItems:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        type:
          type: string
        context:
          $ref: >-
            #/components/schemas/ApiV1AccountIdProjectsProjectIdRateLimitersPostResponsesContentApplicationJsonSchemaItemsContext
      required:
        - message
        - code
        - type
      title: >-
        ApiV1AccountIdProjectsProjectIdRateLimitersPostResponsesContentApplicationJsonSchemaItems

```

## Examples



**Request**

```json
"{\n    \"name\": \"{$randomProductName}\",\n    \"action\": \"block\",\n    \"isActive\": {$randomBoolean},\n    \"condition\": {\n        \"fieldName\": \"remote_addr\",\n        \"predicate\": \"EQ\",\n        \"value\": \"{$randomIP}\",\n        \"type\": \"criteria\"\n    },\n    \"periodInSec\": 5,\n    \"limit\": {$randomInt}\n}"
```

**Response**

```json
"01919a01-8bd9-78c6-8790-b709e71d7045"
```

**SDK Code**

```python Rate limiters_create_example
import requests

url = "https://{base_url}/api/v1/account_id/projects/project_id/rate_limiters"

payload = "{
    \"name\": \"{$randomProductName}\",
    \"action\": \"block\",
    \"isActive\": {$randomBoolean},
    \"condition\": {
        \"fieldName\": \"remote_addr\",
        \"predicate\": \"EQ\",
        \"value\": \"{$randomIP}\",
        \"type\": \"criteria\"
    },
    \"periodInSec\": 5,
    \"limit\": {$randomInt}
}"
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript Rate limiters_create_example
const url = 'https://{base_url}/api/v1/account_id/projects/project_id/rate_limiters';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '"{\n    \"name\": \"{$randomProductName}\",\n    \"action\": \"block\",\n    \"isActive\": {$randomBoolean},\n    \"condition\": {\n        \"fieldName\": \"remote_addr\",\n        \"predicate\": \"EQ\",\n        \"value\": \"{$randomIP}\",\n        \"type\": \"criteria\"\n    },\n    \"periodInSec\": 5,\n    \"limit\": {$randomInt}\n}"'
};

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

```go Rate limiters_create_example
package main

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

func main() {

	url := "https://{base_url}/api/v1/account_id/projects/project_id/rate_limiters"

	payload := strings.NewReader("\"{\\n    \\\"name\\\": \\\"{$randomProductName}\\\",\\n    \\\"action\\\": \\\"block\\\",\\n    \\\"isActive\\\": {$randomBoolean},\\n    \\\"condition\\\": {\\n        \\\"fieldName\\\": \\\"remote_addr\\\",\\n        \\\"predicate\\\": \\\"EQ\\\",\\n        \\\"value\\\": \\\"{$randomIP}\\\",\\n        \\\"type\\\": \\\"criteria\\\"\\n    },\\n    \\\"periodInSec\\\": 5,\\n    \\\"limit\\\": {$randomInt}\\n}\"")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://{base_url}/api/v1/account_id/projects/project_id/rate_limiters")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "\"{\\n    \\\"name\\\": \\\"{$randomProductName}\\\",\\n    \\\"action\\\": \\\"block\\\",\\n    \\\"isActive\\\": {$randomBoolean},\\n    \\\"condition\\\": {\\n        \\\"fieldName\\\": \\\"remote_addr\\\",\\n        \\\"predicate\\\": \\\"EQ\\\",\\n        \\\"value\\\": \\\"{$randomIP}\\\",\\n        \\\"type\\\": \\\"criteria\\\"\\n    },\\n    \\\"periodInSec\\\": 5,\\n    \\\"limit\\\": {$randomInt}\\n}\""

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

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

HttpResponse<String> response = Unirest.post("https://{base_url}/api/v1/account_id/projects/project_id/rate_limiters")
  .header("Content-Type", "application/json")
  .body("\"{\\n    \\\"name\\\": \\\"{$randomProductName}\\\",\\n    \\\"action\\\": \\\"block\\\",\\n    \\\"isActive\\\": {$randomBoolean},\\n    \\\"condition\\\": {\\n        \\\"fieldName\\\": \\\"remote_addr\\\",\\n        \\\"predicate\\\": \\\"EQ\\\",\\n        \\\"value\\\": \\\"{$randomIP}\\\",\\n        \\\"type\\\": \\\"criteria\\\"\\n    },\\n    \\\"periodInSec\\\": 5,\\n    \\\"limit\\\": {$randomInt}\\n}\"")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://{base_url}/api/v1/account_id/projects/project_id/rate_limiters', [
  'body' => '"{\\n    \\"name\\": \\"{$randomProductName}\\",\\n    \\"action\\": \\"block\\",\\n    \\"isActive\\": {$randomBoolean},\\n    \\"condition\\": {\\n        \\"fieldName\\": \\"remote_addr\\",\\n        \\"predicate\\": \\"EQ\\",\\n        \\"value\\": \\"{$randomIP}\\",\\n        \\"type\\": \\"criteria\\"\\n    },\\n    \\"periodInSec\\": 5,\\n    \\"limit\\": {$randomInt}\\n}"',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Rate limiters_create_example
using RestSharp;

var client = new RestClient("https://{base_url}/api/v1/account_id/projects/project_id/rate_limiters");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "\"{\\n    \\\"name\\\": \\\"{$randomProductName}\\\",\\n    \\\"action\\\": \\\"block\\\",\\n    \\\"isActive\\\": {$randomBoolean},\\n    \\\"condition\\\": {\\n        \\\"fieldName\\\": \\\"remote_addr\\\",\\n        \\\"predicate\\\": \\\"EQ\\\",\\n        \\\"value\\\": \\\"{$randomIP}\\\",\\n        \\\"type\\\": \\\"criteria\\\"\\n    },\\n    \\\"periodInSec\\\": 5,\\n    \\\"limit\\\": {$randomInt}\\n}\"", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Rate limiters_create_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = "{
    \"name\": \"{$randomProductName}\",
    \"action\": \"block\",
    \"isActive\": {$randomBoolean},
    \"condition\": {
        \"fieldName\": \"remote_addr\",
        \"predicate\": \"EQ\",
        \"value\": \"{$randomIP}\",
        \"type\": \"criteria\"
    },
    \"periodInSec\": 5,
    \"limit\": {$randomInt}
}" as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://{base_url}/api/v1/account_id/projects/project_id/rate_limiters")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```