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

# Przetestuj narzędzie HTTP

> Wysyła raz żądanie narzędzia HTTP z przykładowymi wartościami, bez zapisywania go. Zwraca to, co dostałby agent (`result`), wysłane żądanie z zamaskowaną autoryzacją, surową odpowiedź oraz schemat funkcji widziany przez model.



## OpenAPI

````yaml /api-reference/openapi.pl.json post /api/v1/tools/test-http
openapi: 3.1.0
info:
  title: Brosbots API
  description: >
    Publiczne REST API Brosbots. Buduj i zarządzaj agentami głosowymi,

    uruchamiaj kampanie wychodzące, odczytuj rozmowy i zużycie oraz zarządzaj

    numerami telefonów, narzędziami, bazami wiedzy i integracjami.


    ## Uwierzytelnianie


    Każde żądanie musi zawierać klucz API organizacji w nagłówku `X-API-Key`:


    ```

    X-API-Key: bb_live_...

    ```


    Klucze tworzysz i unieważniasz w panelu: kliknij swoje konto w lewym dolnym
    rogu paska bocznego, a potem **Brosbots API**.


    ## Adres bazowy


    ```

    https://app.brosbots.com/api/v1

    ```


    ## Konwencje


    - Ciała żądań i odpowiedzi są w JSON (`Content-Type: application/json`).

    - Znaczniki czasu w ISO 8601 ze strefą czasową.

    - Listy stronicowane parametrami `page` / `limit`; odpowiedź zawiera
      `total_count` / `total_pages`.
    - Błędy używają standardowych kodów HTTP z ciałem JSON:
      `{"detail": "czytelny powód błędu"}`.
    - `{agent_id}` przyjmuje publiczne ID agenta (`agent_...`) albo jego numer.


    ## Limity


    API nie ma dziś stałego limitu liczby zapytań na klucz. Kod `429` zwracają

    endpointy dzwoniące (`POST /agents/{agent_id}/calls` i

    `POST /triggers/{trigger_id}/calls`), gdy wszystkie kanały wychodzące są
    zajęte; nagłówek `Retry-After` podaje, ile sekund odczekać.

    Obsługuj `429` ogólnie: czekaj tyle, ile mówi `Retry-After`, a gdy go nie ma
    -

    ponawiaj z wykładniczym odstępem. Limit zapytań może zostać wprowadzony.
  version: 1.0.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/v1/tools/test-http:
    post:
      tags:
        - Narzędzia
      summary: Przetestuj narzędzie HTTP
      description: >-
        Wysyła raz żądanie narzędzia HTTP z przykładowymi wartościami, bez
        zapisywania go. Zwraca to, co dostałby agent (`result`), wysłane żądanie
        z zamaskowaną autoryzacją, surową odpowiedź oraz schemat funkcji
        widziany przez model.
      operationId: post_tools_test_http
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestHttpToolRequest'
      responses:
        '200':
          description: Pomyślna odpowiedź
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestHttpToolResponse'
        '404':
          description: Nie znaleziono
        '422':
          description: Błąd walidacji
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TestHttpToolRequest:
      properties:
        name:
          type: string
          maxLength: 255
          default: test
        description:
          anyOf:
            - type: string
            - type: 'null'
        config:
          $ref: '#/components/schemas/HttpApiConfig'
        arguments:
          additionalProperties: true
          type: object
        call_variables:
          additionalProperties: true
          type: object
          description: Przykładowe wartości zmiennych rozmowy, np. caller_number.
      type: object
      required:
        - config
      title: TestHttpToolRequest
      description: Próbne wywołanie niezapisanego narzędzia HTTP.
    TestHttpToolResponse:
      properties:
        result:
          additionalProperties: true
          type: object
        request:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
        response:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
        function_schema:
          additionalProperties: true
          type: object
      type: object
      required:
        - result
        - function_schema
      title: TestHttpToolResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
      title: HTTPValidationError
    HttpApiConfig:
      properties:
        method:
          type: string
          description: Metoda HTTP (GET, POST, PUT, PATCH, DELETE).
        url:
          type: string
          description: Docelowy URL.
        headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          description: Stałe nagłówki dołączane do żądania.
        credential_uuid:
          anyOf:
            - type: string
            - type: 'null'
          description: ID zapisanych danych uwierzytelniających używanych do autoryzacji.
        parameters:
          anyOf:
            - items:
                $ref: '#/components/schemas/ToolParameter'
              type: array
            - type: 'null'
          description: Parametry, które narzędzie przyjmuje od modelu językowego.
        timeout_ms:
          anyOf:
            - type: integer
            - type: 'null'
          description: Limit czasu żądania w milisekundach.
          default: 5000
        trigger_phrases:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: Co mówią rozmówcy, gdy należy użyć tego narzędzia.
        wait_message:
          anyOf:
            - type: string
            - type: 'null'
          description: Wypowiadane do rozmówcy w trakcie wykonywania żądania.
        response_fields:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: Ścieżki (z kropkami) do pól odpowiedzi przekazywanych modelowi.
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          description: Co agent mówi rozmówcy, gdy żądanie się nie powiedzie.
        template_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Szablon kreatora, z którego utworzono narzędzie.
      type: object
      required:
        - method
        - url
      title: HttpApiConfig
      description: Konfiguracja narzędzia HTTP API.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ToolParameter:
      properties:
        name:
          type: string
          description: Nazwa parametru (klucz w ciele żądania).
        type:
          type: string
          description: 'Typ parametru: string, number lub boolean.'
        description:
          type: string
          description: Opis, do czego służy parametr.
        required:
          type: boolean
          description: Czy parametr jest wymagany.
          default: true
      type: object
      required:
        - name
        - type
        - description
      title: ToolParameter
      description: Parametr przyjmowany przez narzędzie.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Klucz API organizacji (konto w lewym dolnym rogu panelu → Brosbots API).

````

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