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

# Create Widget Key

> Create a public widget key that lets the Bolna web widget start web calls to any agent in your account from chosen websites, within the limits you set.



## OpenAPI

````yaml POST /web-call/public-keys
openapi: 3.1.0
info:
  title: Bolna API
  description: >-
    Use and leverage Bolna Voice AI using APIs through HTTP requests from any
    language in your applications and workflows.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.bolna.ai
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: >-
      Bring-your-own-carrier SIP trunks, their gateways, carrier IPs and
      numbers.
paths:
  /web-call/public-keys:
    post:
      description: >-
        Create a widget key (`pk_...`) for the [web
        widget](/developer-resources/sdks/web-widget). The key belongs to your
        account, not to one agent, and can only start web calls to agents in
        your account, within its limits. Browsers only start them from the
        websites in `allowed_domains`; that check reads the request's `Origin`
        header, which a script outside a browser can set, so the limits are what
        cap misuse. It is meant for page HTML. An organization can have up to 10
        active keys.
      requestBody:
        description: The key's domains, variables and limits
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebWidgetKeyCreateRequest'
            example:
              name: Website
              allowed_domains:
                - acme.com
                - '*.acme.com'
              allowed_variables:
                - name
              per_minute_limit: 30
              max_call_seconds: 600
        required: true
      responses:
        '201':
          description: Key created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebWidgetKey'
        '422':
          description: >-
            The key can't be created as asked, for example an invalid domain, a
            limit out of range, `max_concurrent_calls` above your web-call
            concurrency, web calls not turned on for your account, or 10 active
            keys already
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebWidgetKeyMessage'
components:
  schemas:
    WebWidgetKeyCreateRequest:
      type: object
      required:
        - name
        - allowed_domains
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: A name to recognise the key by
        allowed_domains:
          type: array
          minItems: 1
          maxItems: 20
          items:
            type: string
          description: >-
            The websites the key works on, as hostnames with no scheme, port or
            path. `acme.com` matches only `https://acme.com`; `*.acme.com`
            matches its subdomains over HTTPS but not `acme.com` itself.
            `localhost` and `127.0.0.1` allow local testing over HTTP. Wildcards
            over shared hosting domains such as `*.vercel.app` are refused.
        allowed_variables:
          type: array
          maxItems: 20
          items:
            type: string
          description: >-
            The prompt variable names a page may send. A call that sends any
            other name is refused.
        max_concurrent_calls:
          type: integer
          minimum: 1
          nullable: true
          description: >-
            Most live calls on this key at once, at most your account's web-call
            concurrency. `null` lets the key use all of your web-call
            concurrency.
        per_minute_limit:
          type: integer
          default: 30
          minimum: 1
          maximum: 120
          description: New calls on this key a minute, across all visitors
        per_day_limit:
          type: integer
          default: 500
          minimum: 10
          maximum: 5000
          description: Calls on this key a day
        per_ip_minute_limit:
          type: integer
          default: 3
          minimum: 1
          maximum: 10
          description: Calls from one visitor IP address a minute
        per_ip_day_limit:
          type: integer
          default: 20
          minimum: 5
          maximum: 100
          description: Calls from one visitor IP address a day
        max_call_seconds:
          type: integer
          default: 600
          minimum: 60
          maximum: 1800
          description: >-
            The longest a call on this key may last, in seconds. The call ends
            when it reaches it.
    WebWidgetKey:
      type: object
      properties:
        key:
          type: string
          example: pk_4f6c1d2e3a5b4c7d8e9f0a1b2c3d4e5f
          description: The widget key to put in the `public-key` attribute
        name:
          type: string
          description: A name to recognise the key by
        allowed_domains:
          type: array
          items:
            type: string
          description: >-
            The websites the key works on, as hostnames with no scheme, port or
            path. `acme.com` matches only `https://acme.com`; `*.acme.com`
            matches its subdomains over HTTPS but not `acme.com` itself.
            `localhost` and `127.0.0.1` allow local testing over HTTP. Wildcards
            over shared hosting domains such as `*.vercel.app` are refused.
        allowed_variables:
          type: array
          items:
            type: string
          description: >-
            The prompt variable names a page may send. A call that sends any
            other name is refused.
        max_concurrent_calls:
          type: integer
          nullable: true
          description: >-
            Most live calls on this key at once, at most your account's web-call
            concurrency. `null` lets the key use all of your web-call
            concurrency.
        per_minute_limit:
          type: integer
          description: New calls on this key a minute, across all visitors
        per_day_limit:
          type: integer
          description: Calls on this key a day
        per_ip_minute_limit:
          type: integer
          description: Calls from one visitor IP address a minute
        per_ip_day_limit:
          type: integer
          description: Calls from one visitor IP address a day
        max_call_seconds:
          type: integer
          description: >-
            The longest a call on this key may last, in seconds. The call ends
            when it reaches it.
        is_active:
          type: boolean
          description: Always `true` for a key returned by these endpoints
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    WebWidgetKeyMessage:
      type: object
      properties:
        message:
          type: string
          example: Key not found for this account
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.